Commit Graph
4 Commits
Author SHA1 Message Date
Tianyi Cui 8de41bbe99 Merge embedded stream migration into v2 snapshot rollout
# Conflicts:
#	docs/testing.i18n.yaml
#	docs/testing.md
#	docs/testing.zh.md
#	packages/test-support/session-snapshot/README.i18n.yaml
#	packages/test-support/session-snapshot/README.md
#	packages/test-support/session-snapshot/README.zh.md
#	snapshots/session/read-image-attachment-path/session.v2.jsonl
#	snapshots/session/read-image-dimension/session.v2.jsonl
#	snapshots/session/read-image-reencode/session.v2.jsonl
#	snapshots/session/read-image/session.v2.jsonl
#	snapshots/web/navigation-panes/session.jsonl
#	snapshots/web/ptc-round/session.v2.jsonl
#	snapshots/web/pwsh-terminal/session.jsonl
#	snapshots/web/seeded-history/session.jsonl
2026-09-02 18:45:14 +08:00
Tianyi Cui f693946509 test(snapshot): roll corpus forward to format v2 2026-09-02 04:18:52 +08:00
Chinesezjc a4d4404708 feat(ui-tool): render read_image results as the image
A settled top-level `read_image` call printed its raw attachment object as
literal text in the tool card — `{"type":"image","attachment":{…}}` —
instead of the image, because no presentation metadata told a client card
how to present the reference and the tool-card layer had no image concept.

Host: `read_image` declares an `output.presentationMeta` persisting
`{ path }` only. The attachment reference deliberately lives in the
settled result content — the single record a `tools/post-execute`
replacement rewrites — not in `meta`; the id is opaque and
provider-owned, checked for existence only.

Client: `imageCardModel` derives the card from the call head, the meta
path, the result's own image block, and a shape-matched envelope. ToolRow
gains an `image` card slot; the `read_image` toolview declares the
Tool-owned `tool.call.images` slot as its child and dispatches the
gallery through it. ui-chat down-threads the session-authorized loader
(`ChatNodeOwnerProps.loadImage`), so the tool layer supplies only derived
references plus the loader and never imports an attachment
implementation; ui-attachment fills the slot with its message gallery
renderer. The card keeps the envelope text below the gallery for the
no-attachment-plugin deployment. An image-bearing tool registers a keyed
toolview; the generic fallback keeps its flattened text. `read_image`
joins the read variant with its own locale title key; both rows share
`read-family-row.tsx`.

Verification: `read-image.spec.ts` (metadata projection, envelope by
shape, reference narrowing, real-execution round trip, rejection
branches incl. non-digest ids), `image-card.client.spec.tsx` (derivation,
row render site dispatching the slot, keyed registration with the
child-slot declaration, empty-slot fallbacks, media-type enum), keyless
snapshots (`read-image-gif` added; read-image/-dimension/-reencode
updated to the `{path}` meta), five injected-defect negative controls,
and a demo GIF recorded from this PR's head through the official
image-capable model.
2026-08-29 17:41:05 +08:00
Tianyi Cui 6a74eec7a3 fix(test): reconcile snapshot corpus with merged parent 2026-08-24 21:37:58 +08:00