Skip to content

fix(tui): show bare tool results, extract parallel results arrays - #76

Merged
jkyberneees merged 1 commit into
mainfrom
fix/tool-result-render
Sep 4, 2026
Merged

jkyberneees merged 1 commit into
mainfrom
fix/tool-result-render

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Tool-result peeks now show only the tool result:

  • Injection wrappers fold away entirely — the ⚠ untrusted: <source> badge line is gone; the wrapped body renders bare (sanitize() still runs; provenance framing survives via the ⎿ peek under the tool head).
  • Parallel-tool envelopes are extracted — parallel_shell/delegate_tasks return a top-level results array; each item now renders its display body (stdout → content/result/output/text → headline priority), a leading exit status N line when the item failed, and stderr: … when present. Command echoes, indexes, and durations stay hidden. Items are labelled [1] [2] … only when there are several.
  • Failed items surface reliably — a non-zero exit_code anywhere in the envelope flags the step (hasFailedExit OR-ed into isErr), so it tints red and auto-expands even when the stdout looks innocuous.
  • Fail-safe intact: foreign shapes (empty arrays, non-object items, unknown fields) render byte-identical — never lossy.

Review findings addressed (2 adversarial reviewers, iterate-until-clean)

  • Per-item envelope decode (item stdout that is itself a {"content":…} envelope no longer renders mangled half-JSON).
  • Failed-item detection via hasFailedExit + leading exit status N (both reviewers flagged this).
  • Rebutted with rationale: all-or-nothing revert on foreign shapes (pinned fail-safe contract), int(f) truncation (wire sends integers), receipt-heuristic misfires (pre-existing class).

Test plan

  • RED-first: expectations flipped before implementation; new tests for parallel extraction, single-item, headline items, fail-safe shapes, hasFailedExit
  • go test -race -count=1 ./... green
  • go vet ./... clean · golangci-lint run → 0 issues
  • Round-2 adversarial verification: CLEAN

@jkyberneees
jkyberneees merged commit aa7f346 into main Sep 4, 2026
7 checks passed
@jkyberneees
jkyberneees deleted the fix/tool-result-render branch September 4, 2026 23:31
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