Skip to content

fix(hermes): preserve artifact blocks when converting to native content - #64

Merged
NishantJoshi00 merged 2 commits into
skillsynchq:mainfrom
Adityakk9031:fix/hermes-preserve-artifacts
Sep 25, 2026
Merged

NishantJoshi00 merged 2 commits into
skillsynchq:mainfrom
Adityakk9031:fix/hermes-preserve-artifacts

Conversation

@Adityakk9031

Copy link
Copy Markdown
Contributor

Summary

When exporting or converting transcripts with Block::Artifact to Hermes format (Hermes::from_common), artifact blocks were completely dropped.

In src/harness/hermes.rs, native_content only filtered for Block::Text and Block::Image. Any Block::Artifact was matched by _ => None and discarded. If a message consisted solely of an artifact (or text + artifact), the artifact content was completely omitted from the resulting Hermes message content.

Other harnesses without native artifact storage (such as Pi, Cursor, Fx, Grok, and Codex) retain artifact content using artifact.display_text().

Changes

  • Updated native_content in src/harness/hermes.rs:
    • In the string content path: extract artifact.display_text() and append it to the text blocks joined by \n.
    • In the multimodal array path: emit {"type": "text", "text": artifact.display_text()} for any Block::Artifact.
  • Added regression test from_common_preserves_artifacts in tests/integration/hermes.rs checking both user and assistant turns.

@NishantJoshi00
NishantJoshi00 merged commit 9b9f5a7 into skillsynchq:main Sep 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants