Skip to content

Commit 582ff5d

Browse files
committed
fix: omit StructuredOutput from tool intent injection
StructuredOutput is mechanical and its consumers treat the advertised schema as an exact contract.
1 parent adeb06b commit 582ff5d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/agent-core/src/loop/tool-intent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { ExecutableTool } from './types';
22

33
export const INTENT_FIELD = 'i';
44
export const INTENT_MAX_LENGTH = 120;
5-
/** Tool names excluded from intent injection. Empty today; add names when a tool's intent is self-evident. */
6-
export const INTENT_OMIT_TOOLS: ReadonlySet<string> = new Set();
5+
/** Tool names excluded from intent injection. StructuredOutput is mechanical and has an exact schema contract. */
6+
export const INTENT_OMIT_TOOLS: ReadonlySet<string> = new Set(['StructuredOutput']);
77

88
// oxlint-disable-next-line no-control-regex -- model-authored terminal text must not retain escape sequences.
99
const ANSI_ESCAPE = /\u001B(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007]*(?:\u0007|$))/gu;

packages/agent-core/test/loop/tool-intent.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ describe('tool intent schema injection', () => {
6161
}
6262
});
6363

64+
it('returns StructuredOutput unchanged', () => {
65+
const tool = makeTool('StructuredOutput');
66+
expect(injectIntentIntoTools([tool])[0]).toBe(tool);
67+
});
68+
6469
it('returns tools with an intent collision unchanged', () => {
6570
const tool = makeTool('collision', {
6671
type: 'object',

0 commit comments

Comments
 (0)