Skip to content

Preserve unknown tool calls and original names; relax allowlist filtering and adjust stream handling#152

Closed
CJackHwang wants to merge 3 commits intodevfrom
codex/investigate-tool-execution-bugs-in-output
Closed

Preserve unknown tool calls and original names; relax allowlist filtering and adjust stream handling#152
CJackHwang wants to merge 3 commits intodevfrom
codex/investigate-tool-execution-bugs-in-output

Conversation

@CJackHwang
Copy link
Owner

Motivation

  • Make tool-call parsing less strict so that unknown or differently-cased tool names are preserved and emitted rather than being suppressed by a local allow-list policy.
  • Avoid prematurely treating buffered assistant text as a tool use in the Claude stream path.
  • Align JS and Go stream/tool-sieve behavior so incremental deltas and final tool_calls are consistently emitted for unknown tools.

Description

  • Removed allow-list enforcement from tool-call parsing and filtering so parsed calls are preserved even when availableToolNames is empty or doesn't include the parsed name, and original tool name casing is kept (changes in internal/util/* and internal/js/helpers/*).
  • Changed incremental tool-call delta filtering logic to stop marking unknown names as blocked and to populate seenNames with the original parsed name (changes in internal/adapter/openai/handler_toolcall_format.go and internal/js/chat-stream/toolcall_policy.js).
  • Updated the Claude stream runtime to stop parsing buffered text for tool calls while bufferToolContent is set, removing the preemptive ParseToolCalls detection that triggered early finalization (change in internal/adapter/claude/stream_runtime_core.go).
  • Updated numerous tests to reflect the new behavior: unknown tool names are emitted as tool calls, original name casing is preserved, and stream finish reasons now report tool_calls where applicable (tests under internal/adapter/openai, internal/adapter/responses, internal/util, and tests/node).

Testing

  • Ran Go unit tests with go test ./... covering modified packages (internal/util, internal/adapter/openai, internal/adapter/claude, etc.) and updated tests; all tests passed.
  • Ran JS unit tests for the stream-tool-sieve with npm test/node test runner (tests under tests/node/stream-tool-sieve.test.js) and they passed.

Codex Task

@vercel
Copy link

vercel bot commented Mar 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment Mar 22, 2026 11:46am

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@CJackHwang CJackHwang closed this Mar 22, 2026
@CJackHwang CJackHwang deleted the codex/investigate-tool-execution-bugs-in-output branch March 22, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant