mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 04:18:05 +00:00
fix(proxy): avoid leaking tool_result image URLs
This commit is contained in:
@@ -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]',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user