Skip to content

Show file path in activity status for running tool calls#39

Open
elvistranhere wants to merge 3 commits intolcoutodemos:mainfrom
elvistranhere:fix/activity-status-file-path
Open

Show file path in activity status for running tool calls#39
elvistranhere wants to merge 3 commits intolcoutodemos:mainfrom
elvistranhere:fix/activity-status-file-path

Conversation

@elvistranhere
Copy link
Copy Markdown
Contributor

Summary

  • The activity status bar showed generic text like "Running Edit..." without indicating which file was being operated on
  • Now extracts file_path from the streaming tool input JSON and updates the activity text, e.g. "Running Edit: .../src/theme.ts"
  • Long paths are truncated from the left to keep the status bar readable
  • Works for Edit, Read, Write (file_path), Bash (command), and any tool with a path field
  • No change if the JSON is still streaming and not yet parseable

What changed

src/renderer/stores/sessionStore.ts - tool_call_update handler: after appending partial input, try to parse the accumulated JSON and extract a file path or command to show in the activity bar.

Test plan

  • Trigger an Edit tool call, verify activity bar shows "Running Edit: .../filename"
  • Trigger a Read tool call, verify it shows "Running Read: .../filename"
  • Trigger a Bash tool call, verify it shows "Running Bash: command..."
  • Verify long paths are truncated from the left
  • Verify no regression when tool input JSON is still incomplete (activity stays as "Running ToolName...")
  • npm run build passes with zero errors

The activity status bar showed generic text like "Running Edit..." without
indicating which file was being operated on. Now extracts file_path from
the streaming tool input JSON and updates the activity text to show it,
e.g. "Running Edit: .../src/theme.ts".

Fixes part of the tool call visibility issue.
Copilot AI review requested due to automatic review settings March 21, 2026 16:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the renderer session store to make the status/activity bar more informative during streaming tool execution by displaying the target file path (or command) when it can be derived from the tool input JSON.

Changes:

  • Accumulates streaming tool_call_update JSON fragments and opportunistically parses them.
  • Extracts file_path / path / command from parsed tool input to show Running <Tool>: <detail>.
  • Truncates long details from the left to keep the activity text readable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/stores/sessionStore.ts Outdated
Comment thread src/renderer/stores/sessionStore.ts Outdated
Use lightweight regex to extract file_path/path/command from the
streaming tool input instead of re-parsing the entire accumulated
JSON on every chunk. Avoids performance issues with large payloads.
@elvistranhere
Copy link
Copy Markdown
Contributor Author

@copilot review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/stores/sessionStore.ts Outdated
Use JSON.parse instead of regex to correctly handle escaped quotes in
Bash commands. Only attempt parsing until the activity detail is set,
avoiding repeated parsing of large payloads on subsequent chunks.
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.

2 participants