fix(proxy): avoid leaking tool_result image URLs

This commit is contained in:
seilk
2026-04-30 02:18:22 +09:00
parent f6bb31c956
commit 83c16e216a
2 changed files with 3 additions and 3 deletions
@@ -224,8 +224,8 @@ function convertToolResultContent(content: unknown, isError: boolean, label: str
? (parsed.source as Record<string, unknown>)
: undefined;
const description =
source?.type === 'url' && typeof source.url === 'string'
? source.url
source?.type === 'url'
? 'url image payload'
: source?.type === 'base64' && typeof source.media_type === 'string'
? `${source.media_type} base64 payload`
: 'unsupported image payload';
@@ -220,7 +220,7 @@ describe('ProxyRequestTransformer regressions', () => {
role: 'tool',
tool_call_id: 'toolu_1',
content:
'screenshot captured\n[tool_result image omitted: https://example.com/error.png]\n[tool_result image omitted: image/png base64 payload]',
'screenshot captured\n[tool_result image omitted: url image payload]\n[tool_result image omitted: image/png base64 payload]',
});
});