mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 20:24:21 +00:00
test(proxy): assert tool_result image URLs stay redacted
This commit is contained in:
@@ -204,7 +204,10 @@ describe('ProxyRequestTransformer regressions', () => {
|
|||||||
tool_use_id: 'toolu_1',
|
tool_use_id: 'toolu_1',
|
||||||
content: [
|
content: [
|
||||||
{ type: 'text', text: 'screenshot captured' },
|
{ type: 'text', text: 'screenshot captured' },
|
||||||
{ type: 'image', source: { type: 'url', url: 'https://example.com/error.png' } },
|
{
|
||||||
|
type: 'image',
|
||||||
|
source: { type: 'url', url: 'https://storage.example.com/error.png?X-Amz-Signature=secret' },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'image',
|
type: 'image',
|
||||||
source: { type: 'base64', media_type: 'image/png', data: 'ZmFrZQ==' },
|
source: { type: 'base64', media_type: 'image/png', data: 'ZmFrZQ==' },
|
||||||
@@ -222,6 +225,9 @@ describe('ProxyRequestTransformer regressions', () => {
|
|||||||
content:
|
content:
|
||||||
'screenshot captured\n[tool_result image omitted: url image payload]\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]',
|
||||||
});
|
});
|
||||||
|
expect(result.messages[1]?.content).not.toContain('https://storage.example.com');
|
||||||
|
expect(result.messages[1]?.content).not.toContain('X-Amz-Signature');
|
||||||
|
expect(result.messages[1]?.content).not.toContain('secret');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('rejects unsupported assistant blocks instead of silently dropping them', () => {
|
it('rejects unsupported assistant blocks instead of silently dropping them', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user