style: sync structured output formatting fallout
This commit is contained in:
@@ -13,12 +13,10 @@ export function stringifyLegacyAgentResult(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAgentOutputText(
|
export function getAgentOutputText(output: {
|
||||||
output: {
|
output?: StructuredAgentOutput;
|
||||||
output?: StructuredAgentOutput;
|
result?: string | object | null;
|
||||||
result?: string | object | null;
|
}): string | null {
|
||||||
},
|
|
||||||
): string | null {
|
|
||||||
if (output.output?.visibility === 'silent') {
|
if (output.output?.visibility === 'silent') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -28,10 +26,8 @@ export function getAgentOutputText(
|
|||||||
return stringifyLegacyAgentResult(output.result);
|
return stringifyLegacyAgentResult(output.result);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isSilentAgentOutput(
|
export function isSilentAgentOutput(output: {
|
||||||
output: {
|
output?: StructuredAgentOutput;
|
||||||
output?: StructuredAgentOutput;
|
}): boolean {
|
||||||
},
|
|
||||||
): boolean {
|
|
||||||
return output.output?.visibility === 'silent';
|
return output.output?.visibility === 'silent';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export class MessageTurnController {
|
|||||||
? classifySuppressTokenOutput(raw, this.options.suppressToken)
|
? classifySuppressTokenOutput(raw, this.options.suppressToken)
|
||||||
: raw
|
: raw
|
||||||
? classifySuppressTokenOutput(raw, undefined)
|
? classifySuppressTokenOutput(raw, undefined)
|
||||||
: 'none';
|
: 'none';
|
||||||
const text = raw && suppressState === 'none' ? formatOutbound(raw) : null;
|
const text = raw && suppressState === 'none' ? formatOutbound(raw) : null;
|
||||||
|
|
||||||
if (raw) {
|
if (raw) {
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ describe('classifySuppressTokenOutput', () => {
|
|||||||
|
|
||||||
it('treats the exact structured silent envelope as exact silent output', () => {
|
it('treats the exact structured silent envelope as exact silent output', () => {
|
||||||
expect(
|
expect(
|
||||||
classifySuppressTokenOutput('{"ejclaw":{"visibility":"silent"}}', undefined),
|
classifySuppressTokenOutput(
|
||||||
|
'{"ejclaw":{"visibility":"silent"}}',
|
||||||
|
undefined,
|
||||||
|
),
|
||||||
).toBe('exact');
|
).toBe('exact');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user