Skip to content

fix(chat): expose full tool invocation details in compact rows - #36634

Open
gentslava wants to merge 11 commits into
stablyai:mainfrom
gentslava:fix/native-chat-tool-invocation-details
Open

gentslava wants to merge 11 commits into
stablyai:mainfrom
gentslava:fix/native-chat-tool-invocation-details

Conversation

@gentslava

@gentslava gentslava commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Expand a compact tool row to see exactly which tool the agent called and the input it received. Shortened commands and additional arguments remain inspectable before or after output arrives.

What Changed

  • Show the exact tool name, available input and integration identity in the existing desktop/mobile disclosure; label Input and Output separately.
  • Copy complete input, keep long input initially bounded, and provide an explicit Show full input action. Explain unavailable legacy input without inventing parameters.
  • Derive a missing MCP identity with the existing identity helper in expanded details, matching the compact row. Preserve explicit identity verbatim.
  • Reuse existing formatter, disclosure, clipboard and mobile scroll owners while retaining command fallback, diff/search/output presentation and read-file links.

Why

A row summary can omit working directories, offsets, nested arguments and long custom-tool input. CSS can clip even a command shorter than the formatter's preview limit. Exposing the input already held in the transcript solves this without new provider requests or wire fields.

Linked Issue

Fixes #36633

Visual Proof

Earlier captures retain their original source and capture context. This refresh does not claim a new rendered, packaged-app or physical-device run.

Actual production-component fixtures, in English. Before uses upstream b45d71bf8dc5; after uses this change. The same fixture and interaction expand both rows in each capture. No image files are included in the PR tree.

Before — wide, light After — wide, light
Before: expanded rows show only output After: complete tool name, input and output
Before — narrow, dark After — narrow, dark
Before: clipped invocation on a narrow viewport After: invocation wraps within a narrow viewport

Testing

  • Fresh manual rendered or physical-device acceptance.
  • Four desktop suites pass all 140 tests; two mobile suites pass all 30 tests. Coverage includes complete input/tool identity, running calls, full copy, bounded expansion and output ownership.
  • The existing running-MCP-call regressions failed before the expanded identity correction on desktop and mobile, then passed with it. Explicit identity remains covered.
  • Normal commit-hook lint/plugin/ast-grep/React Doctor/formatting tasks complete, and whitespace checks pass.
  • Full-project typechecks were interrupted to reduce machine pressure. Full production typecheck/build, hosted tool-pairing E2E, aggregate CI, physical devices, Windows/Linux GUI and live SSH acceptance remain pending. The earlier browser captures above are not a fresh rendered run.

Risk

Level: Low

This changes transcript presentation only. The riskiest boundary is showing incomplete legacy tool input or retaining long text in an open disclosure; unknown input stays explicit and the initial display is bounded. Existing local/remote output ownership and mixed-version wire contracts remain unchanged. Revert this PR to restore the output-only disclosure; no persisted data or provider action needs reversal.

AI Disclosure

Implemented and checked with OpenAI Codex assistance. The contributor owns the change and its validation.

Review

Qualified against frozen upstream main 18f674e69ff6708b634f53d668582d3943acb74d. Fixed the derived-identity finding from the formal review. Deferred the proposed desktop/mobile null-input change: src/main/claude/claude-message-journaling.ts uses input: null when the original tool use is unavailable; src/main/claude/structured/journal/claude-structured-item-translation.ts coalesces omitted input to null; and src/main/codex/codex-structured-item-translation.ts:mcpToolArguments maps both omitted arguments and an empty object to null. The current producer contract cannot distinguish those states, so treating only undefined as unavailable would label some unknown legacy input as a valid empty invocation. A producer/contract correction is outside this presentation change. The review bot is paused before the current head; latest-head external approval is not claimed.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source or related material is copied or translated.

Notes

Input is rendered as text and copied only on user action. There are no new execution, approval, routing or platform-process paths. The advisory docstring percentage does not justify repetitive comments contrary to repository guidance.

Checklist

  • This PR is small and focused.
  • User-facing behavior, mechanism and rationale explained.
  • Risk, affected users and backout described.
  • Earlier before/after evidence attached with its original capture context.
  • Self-reviewed for correctness, security and performance.
  • Cross-platform, remote, mobile and backwards-compatibility impact considered.
  • Full lint/typecheck/test/build gates (CI will cover; scoped local results above).

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Expanded native-chat tool rows now show tool identity and formatted invocation input separately from output. Long input can be expanded and copied. Rows can disclose input while a call is running, and show a fallback when input is unavailable. Desktop and mobile use this behavior, with English labels and test coverage.

Severity of issue fixed: Medium

Merge Risk: Minimal · previous review fa355

The changes add the requested tool-input inspection without an identified merge-blocking behavior.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: exposing complete tool invocation details in compact chat rows.
Linked Issues check Passed Issue #36633 has coding requirements. Desktop and mobile disclosures now show the exact tool name, optional MCP identity, available input, and output as separate sections. Long input has bounded displ…
Out of Scope Changes check Passed The changed source files, locale entries, fixtures, and tests support issue #36633. The result-availability test update supports correct output attribution for expanded tool rows. The summary shows no…
Description check Passed The pull request description is complete and follows the repository template. It explains the user-facing change, implementation approach, rationale, linked issue, visual proof, testing status, risks,…
Full details: Linked Issues check

Explanation

Issue #36633 has coding requirements. Desktop and mobile disclosures now show the exact tool name, optional MCP identity, available input, and output as separate sections. Long input has bounded display, full-input expansion, and complete-value copying. Rows remain inspectable for running calls and calls without output. Missing input has an explicit unavailable state. Tests cover narrow-window command visibility, read-file details, output, diff, search, and existing command fallback behavior. The changes do not add provider calls or transcript protocol fields.

Full details: Out of Scope Changes check

Explanation

The changed source files, locale entries, fixtures, and tests support issue #36633. The result-availability test update supports correct output attribution for expanded tool rows. The summary shows no unrelated provider, permission, execution, routing, or wire-contract changes. The presentation and regression-test changes remain within the linked issue scope.

Full details: Description check

Explanation

The pull request description is complete and follows the repository template. It explains the user-facing change, implementation approach, rationale, linked issue, visual proof, testing status, risks, AI use, compatibility considerations, and rollback plan. It clearly discloses that fresh manual validation and full repository gates remain pending.

Full details: Docstring Coverage

Explanation

Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 13 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d2c6e51-1b17-4190-82fe-6407d9b8835a
Commits

Reviewing files that changed from the base of the PR and between fc350b0 and fa3552c.

Files selected for processing: 1

  • tests/e2e/native-chat-tool-pairing.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

gentslava pushed a commit to gentslava/orca that referenced this pull request Oct 31, 2026
# Conflicts:
#	src/renderer/src/i18n/locales/en.json

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (3)

Minor · Use mcpToolIdentity for the expanded identity line. · NativeChatToolInvocation.tsx:21-27

src/renderer/src/components/native-chat/NativeChatToolInvocation.tsx:21-27
Minor · Functional Correctness · Quick win

Use mcpToolIdentity for the expanded identity line.

The expanded header currently bypasses the identity helper. For an MCP name without explicit identity, the compact row shows the derived server / tool, but the expanded header does not. Use the helper for the expanded identity line while keeping call.name so the exact tool name remains available.

Suggested fix
 import {
   formatToolInput,
   MAX_TOOL_DETAIL_LENGTH,
   truncateToolDetail
 } from '../../../../shared/native-chat/tools/native-chat-tool-summary'
+import { mcpToolIdentity } from '../../../../shared/native-chat/tools/native-chat-tool-identity'
 import { NativeChatCopyButton } from './NativeChatCopyButton'
@@
   const [expanded, setExpanded] = useState(false)
   const available = call.input !== null && call.input !== undefined
+  const identity = mcpToolIdentity(call.name, call.mcpIdentity)
   return (
@@
-      {call.mcpIdentity ? (
+      {identity ? (
         <p className="whitespace-pre-wrap break-all font-mono text-xs text-chat-foreground-faint">
-          {call.mcpIdentity.server} / {call.mcpIdentity.tool}
+          {identity.server} / {identity.tool}
         </p>
       ) : null}
Minor · Treat null as a valid no-argument input. · NativeChatToolInvocation.tsx:17-19

src/renderer/src/components/native-chat/NativeChatToolInvocation.tsx:17-19
Minor · Functional Correctness · Quick win

Treat null as a valid no-argument input.

Claude and Codex persist reachable no-argument calls with input: null. The current predicate sends those calls to the unavailable-input message. Keep undefined as the omitted legacy-input case, but render null through the valid empty-input path.

Suggested fix
-  const available = call.input !== null && call.input !== undefined
+  const available = call.input !== undefined
Minor · Distinguish omitted input from a valid no-argument… · MobileNativeChatToolInvocation.tsx:30-32

mobile/src/session/native-chat/transcript/MobileNativeChatToolInvocation.tsx:30-32
Minor · Functional Correctness · Quick win

Distinguish omitted input from a valid no-argument call.

Claude and Codex persist reachable no-argument calls with input: null. The current predicate treats those calls as unavailable, so mobile can display Input is not available in this transcript. instead of the valid invocation details. Check only for omitted undefined input. This preserves the legacy fallback without inventing parameters.

Suggested fix
-  const available = call.input !== null && call.input !== undefined
+  const available = call.input !== undefined

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d5528c07-ef53-4e74-a0a8-31a7e55fd8eb
Commits

Reviewing files that changed from the base of the PR and between 1953932 and c4e2604.

Files selected for processing: 1
  • mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tool-result-availability.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

gentslava added a commit to gentslava/orca that referenced this pull request Oct 31, 2026
gentslava pushed a commit to gentslava/orca that referenced this pull request Oct 31, 2026
# Conflicts:
#	src/renderer/src/i18n/locales/en.json
gentslava pushed a commit to gentslava/orca that referenced this pull request Oct 31, 2026
# Conflicts:
#	src/renderer/src/i18n/locales/en.json

This branch has not been deployed

No deployments
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.

[Bug]: Expanded native-chat tool rows hide full invocation arguments

1 participant