Files
youssefvdel ab42ec6399 fix: 8 bugs from Part 3 audit
#28 double retry: removed retry loop in chat.ts, rely on qwen.ts retry only
#29 .env leak: added .env.* to .dockerignore
#30 headers TTL: reduced from 1hr to 5min to prevent WAF blocks
#31 timezone: use Intl.DateTimeFormat consistently in createQwenStream
#32 JSON corruption: scope Windows path detection to preceding text only
#34 stream disconnect: cancel upstream reader when client disconnects
#35 empty models: log warning when fetchQwenModels returns empty
#39 dup dep: removed tsx from devDependencies
#40 dead file: moved debug-parser.ts to scripts/
2026-05-24 01:58:26 +03:00

9 lines
518 B
TypeScript

import { StreamingToolParser } from './src/tools/parser.ts';
const p = new StreamingToolParser();
const r1 = p.feed('{"name": "read", "arguments": {"path": ');
console.log('after chunk1 - buffer:', p.buffer, '| toolCalls:', r1.toolCalls.length);
const r2 = p.feed('"x.txt"}}');
console.log('after chunk2 - buffer:', p.buffer, '| toolCalls:', r2.toolCalls.length);
const r3 = p.flush();
console.log('after flush - toolCalls:', r3.toolCalls.length, 'total:', [...r1.toolCalls, ...r2.toolCalls, ...r3.toolCalls].length);