Skip to content

Commit 3efc8ca

Browse files
committed
docs(agents): explain bounded content array invariant
1 parent c71556c commit 3efc8ca

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎src/agents/embedded-agent-runner/tool-result-context-guard.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ function truncateToolResultToChars(
195195
{ minimumRawWeight: TOOL_RESULT_CHARS_PER_TOKEN_ESTIMATE },
196196
);
197197
return replaceToolResultContent(msg, [
198+
// SAFETY: Array input is preserved or mapped to another array by truncateToolResultMessage.
198199
...(bounded as { content: unknown[] }).content,
199200
...notice,
200201
]);

0 commit comments

Comments
 (0)