fix(subagent): strip MessagePart::Image from transcript writes - #6310
Merged
Conversation
TranscriptWriter::append serialized the full Message verbatim to the sub-agent's JSONL transcript with no filtering. Sub-agents never call Agent::persist_message, so their transcripts bypassed the MessagePart::Image strip landed in #6307 for spec-072 C1 entirely. Extract the strip logic into a shared MessagePart::strip_images helper in zeph-llm and call it from both Agent::persist_message and TranscriptWriter::append, closing the defense-in-depth gap before #6240 (MCP image emission in tool-result processing) can make it reachable. Closes #6305
bug-ops
enabled auto-merge (squash)
July 16, 2026 16:02
5 tasks
bug-ops
added a commit
that referenced
this pull request
Jul 16, 2026
…ce in spec-072 Sub-agent transcripts (TranscriptWriter::append) were added as a fourth MessagePart::Image strip site by PR #6310, but spec-072 section 4 (C1, FR-008, AC-5, threat model) still only listed three persistence surfaces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TranscriptWriter::appendserialized the fullMessageverbatim to the sub-agent's<task_id>.jsonltranscript with no filtering. Sub-agents never callAgent::persist_message, so their transcripts bypassed theMessagePart::Imagestrip landed in fix(core): strip ephemeral Image parts before persistence writes #6307 for spec-072 §4 C1 entirely — a defense-in-depth gap, not currently exploitable, but reachable once Implement: P2 MediaSanitizer decode/validate/attach + vision-tier routing for MCP image passthrough #6240 (MCP image emission in tool-result processing) lands.MessagePart::strip_imageshelper onzeph-llm'sMessagePart(avoids duplicating the filter and avoids a circular dependency, sincezeph-commoncannot host it whilezeph-llmalready depends onzeph-common). BothAgent::persist_messageandTranscriptWriter::appendnow call this shared helper.Messageis unaffected;TranscriptWriter::appendstrips a clone before serializing.Closes #6305
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml -p zeph-subagent -p zeph-llm -p zeph-core --lib --bins(3381 passed)cargo test --doc -p zeph-llm(25 passed, including the extendedstrip_imagesdoctest)RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"gitleaks protect --staged --no-banner --redact— no leaks