Skip to content

feat(native-chat): add execution details and tool row identity - #19226

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/nc-tool-identity
Sep 7, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/nc-tool-identity

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​482 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​482
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​284 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​263

What this does, in plain terms

Every tool row in the chat looks the same, and three useful facts were being thrown away:

  1. Exit codes. When a command failed, we already knew why — we read the exit code, used it to colour the row red, then discarded the number. Now it's shown.
  2. Which MCP server. A tool called mcp__linear__list_issues rendered as one opaque blob. Now the server and the tool read separately.
  3. Web search results. The agent searched, we showed a globe and the query, and silently dropped the results it actually found.

Before → After

Before After
A command fails Red row, no reason Red row with its exit code
A fast command — Shows real duration, not a misleading "0s"
MCP tool call mcp__linear__list_issues Server and tool, legibly separated
Agent searches the web Globe + query, results discarded Results listed, compactly, inside the row

These are annotations on the existing one-line tool row — it doesn't become a card, and rows without this data look exactly as they do today.


Technical detail

ELI5

Command rows now show their exit code and supplied duration, MCP calls distinguish the server from the tool, and web searches reveal result links inside the existing row disclosure.

What Changed

  • Preserve optional execution metadata and bounded search results on the existing tool-call journal kind and shared projection; keep raw names, inputs, and bounded output for older readers.
  • Render command annotations, distinct MCP labels, and up to five safe HTTP(S) result links through native chat's existing link handler.
  • Accept both duration field casings, display translated milliseconds below one second, and retain command duration when oversized stream snapshots are reduced.
  • Carry optional explicit MCP server/tool identity from confirmed provider calls, preserving raw names and leaving ordinary dotted or path-shaped tool names unchanged.

Why

Tool lines previously discarded command exit codes and duration, obscured MCP identity, and exposed search results only as raw output. The change keeps the existing inline layout and adds no cards or journal item kinds.

Linked Issue

Coordinator-assigned tool row identity task; no issue number supplied.

Visual Proof

Pending real-session before/after screenshots. A background Electron build was attached over CDP and verified as this worktree, but its fresh profile contained no chat session; no substitute fixture screenshots are presented as product evidence.

Testing

  • 263 focused desktop/shared tests passed across 13 files, including provider translation, journal validation/projection, inline rendering, disclosure, and link routing.
  • 23 mobile consumer tests passed across 2 files.
  • Localization catalog verification passed for all 14,320 references.
  • Changed-file oxlint passed; commit hooks also passed oxlint, React doctor rules, and owned-file formatting.
  • Real-session visual QA remains; tests ran on macOS, with no native focus or window activation.
  • Typechecking is assigned to the coordinator; no local typecheck was run.

Review

Independent same-model review is clean after fixes for ambiguous MCP name classification and millisecond translation. Reviewed optional-field compatibility, bounded result parsing, HTTP(S)-only links, raw-name preservation, and negative identity cases for paths, filenames, and classified commands. Shared metadata remains optional for mobile and mixed-version SSH peers; no execution ownership changes. Opening readiness audit identified those two candidates; closing audit found zero remaining candidates, including the mobile compatibility checklist. Severity counsel was unavailable at dispatch depth 1; no formal opening severity verdict is claimed.

Agent skill upstream boundary

  • Not applicable.

Notes

Oversized streamed web-search snapshots retain their existing degradation and may omit result metadata. Full provider output remains the old-reader fallback on ordinary rows.

Checklist

  • Focused scope with no new cards or journal kinds.
  • Automated tests and changed-file lint pass.
  • Cross-platform, mobile, SSH, and mixed-version compatibility considered.
  • Before/after visual proof and central typecheck remain before merge.

@brennanb2025
brennanb2025 marked this pull request as ready for review September 7, 2026 06:58
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 4e25eeb4-ca17-402f-b24a-832dfb59b81e

📥 Commits

Reviewing files that changed from the base of the PR and between 9fed61e and 5804d1e.

📒 Files selected for processing (20)
  • src/main/codex/codex-structured-item-stream-bounds.ts
  • src/main/codex/codex-structured-item-translation.test.ts
  • src/main/codex/codex-structured-item-translation.ts
  • src/main/codex/codex-tool-identity-translation.test.ts
  • src/renderer/src/components/native-chat/NativeChatMessageRow.tsx
  • src/renderer/src/components/native-chat/NativeChatToolAnnotations.tsx
  • src/renderer/src/components/native-chat/NativeChatToolIcon.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.identity.test.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/shared/agent-session-journal-schemas.test.ts
  • src/shared/agent-session-journal-schemas.ts
  • src/shared/agent-session-journal-types.ts
  • src/shared/native-chat-tool-icon.test.ts
  • src/shared/native-chat-tool-icon.ts
  • src/shared/native-chat-tool-identity.test.ts
  • src/shared/native-chat-tool-identity.ts
  • src/shared/native-chat-types.ts
  • src/shared/structured-agent-session-projection.test.ts
  • src/shared/structured-agent-session-projection.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

This PR fails the project typecheck — pnpm tc (both tc:web and tc:node) reports error TS2345 on a new test fixture, so CI will block merge. The fix is a one-line addition (see inline comment).

Reviewed changes

  • Execution metadata on command rows — commandItem and boundStreamItem now preserve optional exitCode/durationMs (both casings) via the shared toolExecutionMetadata in the new src/shared/native-chat-tool-identity.ts.
  • MCP server/tool identity — mcpToolCallItem attaches mcpIdentity only when the provider supplies both server and tool; mcpToolIdentity splits mcp__server__tool for display while keeping the raw name intact.
  • Web-search result links — webSearchItem derives a bounded, HTTP(S)-only, deduped webSearchResults subset while retaining the raw JSON as output for older readers.
  • Renderer annotations — new NativeChatToolAnnotations (NativeChatToolName, NativeChatCommandMetadata, NativeChatSearchResults) wired through NativeChatToolRun, NativeChatToolIcon, and MessageRow; search-result clicks route through the existing onLinkClick handler.
  • Schema & projection — optional ToolMetadata added to the journal schema and intersected into AgentJournalToolCallItem/NativeChatToolCallBlock, with forward-tolerance tests.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

UI validation — tool-row annotations in the structured native chat pane (live Orca dev build, branch brennanb2025/nc-tool-identity, real NativeChatToolRun rows in dark + light themes):

failing shell row shows exit 127 in destructive red with 400ms, fast command shows exit 0 with 40ms and no misleading 0s — dark
Failing shell row shows exit 127 in destructive red with 400ms; fast command shows exit 0 with 40ms and no misleading 0s (dark).

MCP row reads Linear / list issues distinctly while browser.open and tools/read stay intact — dark
MCP row reads Linear / list issues distinctly while browser.open and tools/read stay intact (dark).

web-search links render as compact truncated rows inside the existing disclosure, row stays a flat line not a card — dark
Web-search links render as compact truncated rows inside the existing disclosure; the row stays a flat line, not a card (dark).

plain shell row with no metadata renders exactly as before, no exit or duration invented — dark
Plain shell row with no metadata renders exactly as before — no exit or duration invented (dark).

same exit-code and duration rows in light theme
Same exit-code and duration rows in the light theme.

same MCP vs dotted and path names in light theme
Same MCP vs dotted and path names in the light theme.

same compact web-search links in light theme
Same compact web-search links in the light theme.

same unchanged plain row in light theme
Same unchanged plain row in the light theme.

Verdict: all four checks pass — no regressions spotted in the surrounding rows.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Since the prior review, the single blocking concern was resolved:

  • Projection test fixture typecheck — added the required state: 'running' field to the "preserves confirmed MCP identity" fixture, clearing the TS2345 error that blocked pnpm tc.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Since the prior review, the branch merged origin/main, reconciling the PR's onLinkClick wiring with the subagent-groups feature that landed on main.

  • Merged origin/main — the subagent-group block type joined KNOWN_BLOCK_TYPES and the Block union; NativeChatToolRun gained a defaulted subagentGroups prop and renders NativeChatSubagentRun roster rows above the tool run.
  • Reconciled renderer wiring — MessageRow now mounts NativeChatToolRun when subagentGroups.length > 0 even without tools, and the PR's onLinkClick stays threaded through ToolLine alongside the roster.

The reconcile is clean: onLinkClick, mcpIdentity, execution metadata, and search results all still reach their render targets, the eda0adf typecheck fix is intact, and every caller of the widened icon/category signatures is type-consistent.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

brennanb2025 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Status: ready for review

Plan review

Reviewed before any code was written. APPROVE WITH AMENDMENTS, all applied. Two mattered:

  • Duration would have rendered "0s". formatNativeChatDuration takes seconds and floors, so any sub-second command would have displayed 0s next to its exit code. Now handled explicitly.
  • MCP detection would have produced false positives. The classifier keyed off mcp__ only; adding server.tool recognition risked reclassifying dotted or path-shaped non-MCP tool names. Negative tests now pin that, and display-splitting never mutates the raw name.

Code review loop

Same-model subagent review found and fixed both candidate issues, then returned clean on re-review. readiness-checklist at start and end; the closing run and the mobile compatibility check have zero findings. 263 desktop/shared and 23 mobile tests pass.

Wire safety

The three new journal fields (exitCode, durationMs, webSearchResults) are optional on the existing tool-call kind, with no enum and no new kind — verified at dispatch and again after merge. Rendering is correct when each is absent. Provider-supplied result URLs are http(s)-gated and routed through the existing link handler rather than rendered as raw anchors.

Verification

  • Central typecheck: exit 0.
  • Merged with origin/main, two parents verified, both resolved files inspected from HEAD.

Manual UI validation

Real Orca dev build, hidden renderer over CDP. Screenshots attached above.

Process deviations, stated plainly

  • The review loop's $orchestration arm was not used. Nested worker depth is 1 in this install, so a dispatched worker cannot dispatch its own workers (nested_worker_depth_exceeded). The UI validation lane was run directly by the coordinator at depth 0. The substance of the loop — subagent review to clean, readiness bookends, independent UI validation with visual evidence — was carried out in full.
  • readiness-checklist's severity-counsel step was unavailable for the same depth reason, and is recorded as unavailable rather than reported as a verdict.
  • Validation ran on Claude, not the originally-planned agent, which ran out of quota mid-programme.

Known-red, not caused by this PR

structured-agent-session-adoption-replay.test.ts:188 fails on a clean detached origin/main checkout — reproduced independently by two lanes, byte-identical failure. It is a pre-existing break on main and was deliberately not touched.

@brennanb2025
brennanb2025 merged commit d0506bf into main Sep 7, 2026
28 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.

1 participant