Skip to content

Commit 280da35

Browse files
author
Zoo (VP)
committed
fix: correct misleading error-interception comments in tool-call parser
The parseErrors/parseFailures docblocks claimed presentAssistantMessage routes recorded failures to an INVALID_JSON_ARGUMENTS error-interception pattern. No such routing exists on this codebase; describe the actual lifecycle (consumed via the consume* APIs, cleared on new API request). Comment-only change, no behavior difference.
1 parent 4245e3f commit 280da35

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎src/core/assistant-message/NativeToolCallParser.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ export class NativeToolCallParser {
102102
/**
103103
* Stores JSON.parse error messages keyed by tool call ID.
104104
* When parseToolCall() catches a JSON.parse failure, it records the error
105-
* here so presentAssistantMessage can retrieve it and route the signal to
106-
* the INVALID_JSON_ARGUMENTS error-interception pattern instead of the
107-
* generic PARAM_MISSING path.
105+
* message here so it can be retrieved later via {@link consumeParseError}
106+
* / {@link hasParseError} (currently exercised by tests and diagnostics;
107+
* no production consumer exists). Entries persist until consumed or until
108+
* {@link clearParseFailures} runs at the start of the next API request.
108109
*
109110
* @deprecated Use {@link parseFailures} and {@link consumeParseFailure} for
110111
* typed failure descriptors. This legacy string map is retained only as a
@@ -117,7 +118,9 @@ export class NativeToolCallParser {
117118
* When parseToolCall() catches any failure (JSON syntax, missing required
118119
* arguments, or invalid argument shape), it records a typed descriptor here
119120
* so downstream consumers can classify the failure precisely instead of
120-
* relying on raw error strings.
121+
* relying on raw error strings. Entries persist until consumed via
122+
* {@link consumeParseFailure} or until {@link clearParseFailures} runs at
123+
* the start of the next API request.
121124
*/
122125
private static parseFailures = new Map<string, NativeToolParseFailure>()
123126

0 commit comments

Comments
 (0)