Skip to content

fix(native): preserve structured tool results and inspector images - #254

Merged
rynfar merged 2 commits into
nativefrom
nw/233-tool-output
Nov 4, 2026
Merged

rynfar merged 2 commits into
nativefrom
nw/233-tool-output

Conversation

@rynfar

@rynfar rynfar commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Structured MCP results with blank text showed the whole content/structuredContent envelope, and results with images preferred their text summary over structured data. The native inspector also left JSON/HTML arguments and output unhighlighted, and images followed arguments inside the output slot.

Port the current itemDetail.ts and V2ItemInspector.tsx behavior from pingdotgg/t3code#30389: prefer meaningful structuredContent when text is blank or images are present, retain unsupported/overflow image markers and the original eight served-image indices, put images before arguments independently of the output slot, and prepare JSON/HTML syntax once in the existing bounded inspector cache. Large JSON arguments remain capped with plain text beyond the syntax budget. The existing off-thread derivation and fetched-item lifetimes stay in place. Regenerate the existing item-detail fixture from the real TypeScript implementation.

Tracks #233. TR-INSPECT remains partial; filename inference and unported web lexers remain tracked by #64/#78/#108/#233. All other 130 actual-base ledger rows, intake source/Issue/status bookkeeping, and UPSTREAM are preserved against fork/native 917a20b.

Validation: reproduced the exact upstream conformance red (6 pass/1 fail, structured-blank output text), then all 7 conformance cases passed. Core behavior and inspector derivation tests also failed before their fixes. Final checks after the last source change: 1,383 native workspace tests, 42 parity tests, strict workspace Clippy, theme generation, conformance generation, scoped row formatting/whitespace, and normal plus snapshot builds all passed. The full ledger already has unrelated formatter drift on the base; only the owned row was formatted, and the pre-commit autoformatter was skipped to preserve the other rows. No repo-wide check:changed was run.

Local evidence (not uploaded or committed):

  • Structured result before: /private/tmp/native-factory-2f5f764a/evidence233/before-structured.png
  • Structured result after: /private/tmp/native-factory-2f5f764a/evidence233/after-structured.png
  • Image placement before: /private/tmp/native-factory-2f5f764a/evidence233/before-images.png
  • Image placement after: /private/tmp/native-factory-2f5f764a/evidence233/after-images.png
  • Source manifests/patches, feature blobs, exact build/capture argv, cwd, timestamps, joined exits, hashes, initial attempts and all raw logs: /private/tmp/native-factory-2f5f764a/evidence233/final-proof.json and adjacent files.

Inspected both before/after pairs using identical fixtures and gestures. These are offscreen captures through the existing turn-items hook and a copied 14658-only home. The image pair proves fallback placement, not successful signed/live MCP image fetching. No real windows or provider turns were used by this worker; live image delivery remains unverified. The historical #185 incident remains recorded in the factory handoff, and known #202 glyph loss is separate. The existing user app bundle hash is unchanged. Primary merged integration remains the factory's gate.

R1 follow-up: separated JSON/HTML argument labels now use the existing selectable text helper, preserving their muted typography and stable IDs. This is a one-line view change and also restores selection for the pre-existing TypeScript label path; capping, syntax budgets and cached derivation are unchanged. No state/logic changes or trivial UI unit tests were added. All required native checks and both builds passed again after the final source change.

R1 local selection proof: /private/tmp/native-factory-2f5f764a/evidence233-r1/final-proof.json; HTML before/after PNGs before-html-selection.png and after-html-selection.png, JSON before/after PNGs before-json-selection.png and after-json-selection.png in that directory. Identical fixtures and drags leave labels unselected before and visibly selected after. The HTML pair is fully legible; the JSON after capture shows the selected options label with known #202 glyph loss elsewhere, preserved as a limitation. No clipboard action was used. Original evidence and final-proof.json are unchanged.

Built with GPT-6.1 Sol in Codex

@rynfar

rynfar commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

R1 fixed in 142f796 on actual fork/native 917a20b. The one-line change renders CallPart::Key with the existing selectable helper and stable part ID, keeping muted typography and all JSON/HTML/TypeScript value rendering, bounds and caches intact. No new state or trivial UI wiring tests.

Identical-fixture offscreen drags leave html/options labels unselected before and visibly selected after. Local HTML pair: /private/tmp/native-factory-2f5f764a/evidence233-r1/before-html-selection.png and /private/tmp/native-factory-2f5f764a/evidence233-r1/after-html-selection.png. The adjacent JSON pair shows selected options after the fix, with known #202 glyph loss elsewhere in that after capture; that limitation is preserved. No clipboard action or real window was used.

After the final source change: 1,383 native tests, 42 parity tests, strict Clippy, theme/conformance generation, scoped formatting and both normal/snapshot builds passed. All commands joined, and the branch is clean. Source/build/capture manifests, exact argv, exits, hashes and all attempts are separate in /private/tmp/native-factory-2f5f764a/evidence233-r1/final-proof.json. Original evidence233/final-proof.json remains byte-identical. TR-INSPECT/#233 remain partial/open; other 130 rows/intake bookkeeping and UPSTREAM are unchanged. Existing signed/live image delivery, historical #185 and #202 limits remain.

@rynfar
rynfar merged commit 8ae4831 into native Nov 4, 2026
@rynfar rynfar mentioned this pull request Nov 4, 2026
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.

1 participant