style: sync structured output formatting fallout

This commit is contained in:
Eyejoker
2026-03-28 05:57:50 +09:00
parent fe6314108c
commit 0eb2270030
3 changed files with 12 additions and 13 deletions

View File

@@ -13,12 +13,10 @@ export function stringifyLegacyAgentResult(
}
}
export function getAgentOutputText(
output: {
output?: StructuredAgentOutput;
result?: string | object | null;
},
): string | null {
export function getAgentOutputText(output: {
output?: StructuredAgentOutput;
result?: string | object | null;
}): string | null {
if (output.output?.visibility === 'silent') {
return null;
}
@@ -28,10 +26,8 @@ export function getAgentOutputText(
return stringifyLegacyAgentResult(output.result);
}
export function isSilentAgentOutput(
output: {
output?: StructuredAgentOutput;
},
): boolean {
export function isSilentAgentOutput(output: {
output?: StructuredAgentOutput;
}): boolean {
return output.output?.visibility === 'silent';
}

View File

@@ -132,7 +132,7 @@ export class MessageTurnController {
? classifySuppressTokenOutput(raw, this.options.suppressToken)
: raw
? classifySuppressTokenOutput(raw, undefined)
: 'none';
: 'none';
const text = raw && suppressState === 'none' ? formatOutbound(raw) : null;
if (raw) {

View File

@@ -45,7 +45,10 @@ describe('classifySuppressTokenOutput', () => {
it('treats the exact structured silent envelope as exact silent output', () => {
expect(
classifySuppressTokenOutput('{"ejclaw":{"visibility":"silent"}}', undefined),
classifySuppressTokenOutput(
'{"ejclaw":{"visibility":"silent"}}',
undefined,
),
).toBe('exact');
});
});