Repository navigation
Drop nameless assistant tool_calls and emit parsed tool_calls atomically in sieve - #81
Conversation
Merge pull request #72 from CJackHwang/codex/review-changes-to-test-account-logic Normalize mobile login numbers, skip completion flow for session-only account tests, and add tests
Merge pull request #74 from CJackHwang/codex/fix-toolcall-whitelist-issue Recognize and emit executable tool_calls in mixed prose streams; normalize roles and loosen tool-name matching
Merge pull request #79 from CJackHwang/codex/analyze-and-optimize-issue-#77 fix: 避免 assistant.content=nil 注入 "null" 导致工具历史混杂
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af68d21095
ℹ️ 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".
| detected := util.ParseToolCalls(s.text.String(), s.toolNames) | ||
| if len(detected) > 0 { | ||
| s.finalize("tool_use") | ||
| return streamengine.ParsedDecision{ |
There was a problem hiding this comment.
Delay tool-call stop until fenced code context is complete
In onParsed, tool-mode streaming now calls ParseToolCalls on every partial chunk and stops immediately when it sees a parseable call. This can misfire on chunked fenced examples: if a chunk contains `````json\n{"tool_calls":...}``` before the closing fence arrives in a later chunk, stripFencedCodeBlocks cannot remove it yet and the parser treats it as a real tool call, causing an early `tool_use` stop and truncating normal assistant output.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| func parseAntmlFunctionCallStyle(text string) (ParsedToolCall, bool) { | ||
| m := antmlFunctionCallPattern.FindStringSubmatch(text) |
There was a problem hiding this comment.
Parse all ANTML function_call entries, not only the first
parseAntmlFunctionCallStyle uses FindStringSubmatch, so it captures only the first <antml:function_call> in an <antml:function_calls> payload. As a result, multi-call ANTML outputs silently drop later tool calls, which means only a subset of requested tools is executed and downstream results can be incomplete.
Useful? React with 👍 / 👎.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Merge pull request #81 from CJackHwang/codex/linear-mention-cja-8 Drop nameless assistant tool_calls and emit parsed tool_calls atomically in sieve
Motivation
tool_callsare emitted as events in the same processing tick once a complete payload is detected to avoid leaking partial JSON as text and to keep streaming behavior deterministic.Description
formatAssistantToolCallsForPromptto skip (drop) assistanttool_callsentries that do not resolve to a non-emptynameinstead of inserting anunknownname into the prompt history.TestNormalizeOpenAIMessagesForPrompt_AssistantToolCallsMissingNameAreDroppedto validate that nameless assistanttool_callsare dropped.processToolSieveChunkininternal/js/helpers/stream-tool-sieve/sieve.jsto emit pendingtool_callsevents immediately within the processing loop and continue processing, clearingpendingToolRawandpendingToolCallsto avoid treating complete tool payloads as leaked text.tests/node/stream-tool-sieve.test.jsto assert thattool_callsare emitted in the same chunk/tick when payloads become complete and that late-key convergence produces atool_callsevent while avoiding leaking the JSON marker text.Testing
TestNormalizeOpenAIMessagesForPrompt_AssistantToolCallsMissingNameAreDroppedand existing message-normalize tests, and they passed.tests/node/stream-tool-sieve.test.js) via the test suite and verified the new and updated tests passed.Codex Task