mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 08:19:59 +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>)
|
? (parsed.source as Record<string, unknown>)
|
||||||
: undefined;
|
: undefined;
|
||||||
const description =
|
const description =
|
||||||
source?.type === 'url' && typeof source.url === 'string'
|
source?.type === 'url'
|
||||||
? source.url
|
? 'url image payload'
|
||||||
: source?.type === 'base64' && typeof source.media_type === 'string'
|
: source?.type === 'base64' && typeof source.media_type === 'string'
|
||||||
? `${source.media_type} base64 payload`
|
? `${source.media_type} base64 payload`
|
||||||
: 'unsupported image payload';
|
: 'unsupported image payload';
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ describe('ProxyRequestTransformer regressions', () => {
|
|||||||
role: 'tool',
|
role: 'tool',
|
||||||
tool_call_id: 'toolu_1',
|
tool_call_id: 'toolu_1',
|
||||||
content:
|
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