- StreamingToolParser now extracts <think> and <thinking> blocks before tool call parsing, buffering content until closing tag (same pattern as <tool_call>) — nothing leaks to client text - Partial think tag detection prevents fragments like '<thi' from flushing - flush() emits remaining thinking as reasoning_content - chat.ts non-streaming path strips residual think tags from content - Move Python debug/fix scripts to scripts/ directory - Add integration, largeBuffer, and leak test files - Improve JSON parsing robustness and tool call guard validation - Update README and .gitignore
12 lines
432 B
Python
12 lines
432 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Replace the corrupted logging block in chat.ts non-streaming path.
|
|
Lines 433-438 are corrupted. Replace with clean merged logging block.
|
|
"""
|
|
with open('src/routes/chat.ts', 'r') as f:
|
|
lines = f.readlines()
|
|
|
|
# The correct replacement for lines 433-438 (0-indexed: 432-437)
|
|
# These 6 lines need to be replaced with the fixed logging code
|
|
replacement = [
|
|
' if (vStr.includes(' + repr(' |