Skip to content

Live tool call popup: show arguments that arrive in a later tool_call_update - #1192

Merged
catatafishen merged 1 commit into
catatafishen:masterfrom
BambinoSK:fix/tool-call-popup-late-arguments
Oct 20, 2026
Merged

catatafishen merged 1 commit into
catatafishen:masterfrom
BambinoSK:fix/tool-call-popup-late-arguments

Conversation

@BambinoSK

Copy link
Copy Markdown
Contributor

Fixes #1191.

Problem

During a live session, clicking a tool chip opens the tool call popup with Inputs 0 chars (~0 tokens) even though the tool had input, while reloading the same session from history shows the inputs correctly. OpenCode emits session/tool_call with an empty rawInput and only reveals the tool input in a later session/tool_call_update; the store captures those late arguments (that was #1008), but NativeChatPanel.updateToolCall dropped them, so the per-chip UI state kept arguments = null for the rest of the live session. The popup builds its Inputs section from that state, and the chip label is derived from the arguments at chip creation time, when they are still unknown.

What this PR does

  • Late arguments now reach the live panel state. NativeChatPanel.updateToolCall applies update.arguments to the chip's ToolCallData, mirroring ConversationEntryStore.updateToolCall, so the live popup shows the same inputs history replay shows. Blank argument updates are skipped on both sides, so a blank update cannot wipe an input captured earlier and history replay stays in sync with the live popup.
  • Chip labels re-derive once the input is known. When the chip was created without arguments and the late arguments carry a title (or a sleep-style label), the chip label and the popup title are re-derived via the existing ToolCallArgParser helpers. Chips labeled from their initial arguments are never touched.

Notes for reviewers

  • The relabeling only fires when the chip was created with null or blank arguments, which is exactly the OpenCode empty-rawInput shape; agents that send full arguments up front see no behavior change.
  • The sub-agent chip paths are untouched: they already had their own late-details handling (applySubAgentDetails).
  • Diff stat: 4 files, +234/-2.

Verification

  • ./gradlew :plugin-core:test --tests 'com.github.catatafishen.agentbridge.ui.NativeChatToolCallArgumentsTest': 6 tests, all green (new regression tests for late arguments, blank-update tolerance and chip relabeling).
  • ./gradlew :plugin-core:test --tests 'com.github.catatafishen.agentbridge.session.ConversationEntryStoreTest': 43 tests, all green (one new test pins that a blank late update cannot wipe captured arguments).
  • Live check in the IDE with a build of this change: an OpenCode execute call's popup shows the executed input in the live session, where it previously showed Inputs 0 chars.

How to verify the interactive behavior

  1. Start an OpenCode session and prompt the agent to run its execute tool (any task that triggers a JS tool call works).
  2. While the session is live, click the execute chip: the popup's Inputs section shows the JSON that was executed, with the char/token count and the copy link.
  3. Reload the session from history and click the same chip: the inputs are identical to step 2.

Closes #1191

Symptom: clicking a tool chip during or after a live OpenCode session
opens the popup with "Inputs 0 chars" even though the tool had input,
while the same session reloaded from history shows the inputs fine.

Root cause: OpenCode emits session/tool_call with an empty rawInput and
only reveals the input in a later session/tool_call_update. The store
side already captures those late arguments (issue catatafishen#1008), but
NativeChatPanel.updateToolCall dropped them, so the per-chip UI state
kept a null arguments field for the rest of the live session even though
the persisted row had the full input.

Fix: apply update.arguments in NativeChatPanel.updateToolCall the same
way ConversationEntryStore does, and re-derive the chip label once the
input is known when the arguments carry a title field. Blank argument
updates are skipped on both sides, so a blank update cannot wipe an
input captured earlier and history replay stays in sync with the live
popup.

Trade-offs: label re-derivation only fires when the chip was created
without arguments, so chips labeled from their initial arguments never
change.
@github-actions

Copy link
Copy Markdown

⚠️ ClusterFuzzLite — Maintainer Security Review Required

A maintainer needs to approve the ClusterFuzzLite PR fuzzing workflow run for this fork PR.

Before approving, please review the code changes from BambinoSK/agentbridge@0773248b to confirm there is no code that could:

  • Exfiltrate the CFLITE_STORAGE_REPO_TOKEN CI secret
  • Abuse CI infrastructure or the fuzz corpus storage repository

The fuzz targets from the fork branch will be compiled and executed with access to repository secrets. Rubber-stamping this approval without reviewing the code is a security risk.

This comment is posted automatically whenever ClusterFuzzLite is triggered on a fork PR.

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@catatafishen
catatafishen merged commit fc2e731 into catatafishen:master Oct 20, 2026
22 of 25 checks passed

This branch is waiting to be deployed

1 waiting deployment
fuzzing-gate — 0773248b Waiting Oct 19, 2026 by BambinoSK via Maintainer approval gate (fork PR) #1642
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.

Live tool call popup shows 'Inputs 0 chars' when arguments arrive in a later tool_call_update

2 participants