Skip to content

Fix TUI tool-call argument rendering#9

Merged
hzhaoy merged 2 commits into
mainfrom
fix/add-tool-args
Jun 2, 2026
Merged

Fix TUI tool-call argument rendering#9
hzhaoy merged 2 commits into
mainfrom
fix/add-tool-args

Conversation

@hzhaoy

@hzhaoy hzhaoy commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • normalize tool-call arguments across direct tool calls, streamed chunks, and update snapshots
  • preserve message segment boundaries around tool calls and tool results
  • use ToolMessage.status instead of result-text heuristics for success/error state

Tests

  • uv run pytest tests/tui/test_stream_handler.py -q --no-cov
  • uv run pytest

Tool calls arrive through several LangChain and DeepAgents shapes, including partial tool_call_chunks and later updates snapshots. The TUI now normalizes those shapes, accumulates argument fragments, and keeps message segments from bleeding across tool boundaries.

Constraint: LangChain streams tool-call arguments through partial chunks and may only provide complete arguments in updates snapshots
Rejected: Only display arguments from token.tool_calls | real streams often expose empty args there
Rejected: Treat result text containing Error as failure | source files can legitimately contain that text
Confidence: high
Scope-risk: moderate
Directive: Keep tool-call argument handling covered by stream_handler regression tests before changing accumulator behavior
Tested: uv run pytest tests/tui/test_stream_handler.py -q --no-cov
Tested: uv run pytest
Not-tested: Manual TUI session after commit
Co-authored-by: OmX <omx@oh-my-codex.dev>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfd2e3d66e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/deep_code_agent/tui/bridge/stream_handler.py Outdated
@hzhaoy hzhaoy merged commit 9e1e813 into main Jun 2, 2026
1 check 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