You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
After some time, the work starts to break down. #30
After some time, the work starts to break down.
The proxy really works very well; I’m very satisfied, but after some time, problems start to occur (logs below). At the same time, the client that works with the proxy claims that everything is fine.
I’m using the FreeDeepseekAPI + Hermes agent combination.
[dev-agent/acct:account_1] Reusing session: 2ac6fbcf-932b-4949-857d-257a4ef54dcc (parent: 20, msg#10) [dev-agent] Got 1337 chars (+0 reasoning chars) in 6120ms (msg#11) [parseToolCall] No tool call match in 1337 chars [dev-agent] Streamed openai (tool=false) in 6120ms [dev-agent] Compacted upstream prompt 372213 -> 80000 chars [dev-agent/acct:account_1] Reusing session: 2ac6fbcf-932b-4949-857d-257a4ef54dcc (parent: 22, msg#11) [dev-agent] Got 1324 chars (+0 reasoning chars) in 6672ms (msg#12) [parseToolCall] fenced JSON.parse failed: Unexpected token 'c', "csharp pub"... is not valid JSON [parseToolCall] fenced JSON.parse failed: Unexpected token 'c', "csharp pub"... is not valid JSON [parseToolCall] inline JSON.parse failed: Expected property name or '}' in JSON at position 6 [parseToolCall] inline JSON.parse failed: Expected property name or '}' in JSON at position 6 [parseToolCall] No tool call match in 1324 chars [dev-agent] Streamed openai (tool=false) in 6672ms [dev-agent] Compacted upstream prompt 374159 -> 80000 chars [dev-agent/acct:account_1] Reusing session: 2ac6fbcf-932b-4949-857d-257a4ef54dcc (parent: 24, msg#12) [dev-agent] Got 4191 chars (+0 reasoning chars) in 12473ms (msg#13) [parseToolCall] fenced JSON.parse failed: Unexpected token 'A', "Assets\Scr"... is not valid JSON [parseToolCall] fenced JSON.parse failed: Unexpected token 'c', "csharp usi"... is not valid JSON [parseToolCall] inline JSON.parse failed: Expected property name or '}' in JSON at position 6 [parseToolCall] No tool call match in 4191 chars [dev-agent] Streamed openai (tool=false) in 12473ms
Я думаю проблема в другом, при долгой работе с чатом, сам Deepseek сбивается и начинает отвечать не по шаблону. будет время, я это перепроверю. Если это так, надо будет подумать как ему вправить мозги.
не может же токен работать работать, а потом перестать
да, так и есть:
{"tool_call":{"name":"read_files","arguments":{"files":[{"path":"c:\git\dsh-local-llm\src\index.ts","start_line":240,"end_line":350},{"path":"c:\git\dsh-local-llm\src\server-manager.ts"},{"path":"c:\git\dsh-local-llm\src\downloader.ts"}]}}
такой ответ правильный как я понимаю:
TOOL_CALL: read_files
arguments: {"files":[{"path":"c:\git\dsh-local-llm\src\downloader.ts","start_line":83,"end_line":120},{"path":"c:\git\dsh-local-llm\src\server-manager.ts","start_line":90,"end_line":245},{"path":"c:\git\dsh-local-llm\src\ui-components\components\ModelManager.tsx"},{"path":"c:\git\dsh-local-llm\src\ui-components\index.tsx"},{"path":"c:\git\dsh-local-llm\README.md","start_line":1,"end_line":60}]}
If don’t want to change the version or code of FreeDeepseekAPI, you can switch to another combination: FreeDeepseekAPI + VS Code + Cline — this will work.
@dekrezz In my changes, I also added small delays to avoid receiving messages saying “too many messages, try again.”
@wertyBSd Funny, I already had this covered. Why make every request wait when a rate-limited account can just step aside? On a 429, a "too many messages" 400, or rate_limit_reached, that login goes on cooldown and the request moves to the next one. It honors Retry-After and keeps one in-flight chat per login. There's a short pause before retries too.
Fixed in main (81374ae). Thanks for the detailed logs, they pointed straight at the cause.
Root cause. When a DeepSeek chat was reused, the proxy re-sent the whole conversation (compacted to 80 000 chars) into the same chat on every turn. The chat's context grew quadratically, so after a dozen tool steps DeepSeek drifted off the tool-call format and started answering with plain code blocks. That matches your Compacted upstream prompt 372213 -> 80000 lines followed by No tool call match.
What changed:
A reused chat now receives only the new messages (tool results, the next user turn) plus a short tool-format reminder.
A chat that grows past DEEPSEEK_MAX_SESSION_CHARS is replaced by a fresh chat with a compacted prompt.
The parser repairs raw Windows paths such as "c:\git\dsh-local-llm\src\index.ts" (your example) and raw newlines inside JSON arguments.
Code blocks in other languages (```csharp etc.) are never treated as tool calls.
Verified against live DeepSeek with a 24-step tool session plus a final answer: context is kept, and work continues after a chat rollover. If it still happens on current main, please reopen with the server log.
Activity
atharvotech commentedon Sep 6, 2026
you may try our https://github.com/atharvotech/FreeDeepseekAPI-EN you may not recieve this error these coz the the token c was not in UTF-8 encoding fixed by me.
wertyBSd commentedon Sep 15, 2026
Я думаю проблема в другом, при долгой работе с чатом, сам Deepseek сбивается и начинает отвечать не по шаблону. будет время, я это перепроверю. Если это так, надо будет подумать как ему вправить мозги.
не может же токен работать работать, а потом перестать
wertyBSd commentedon Sep 15, 2026
да, так и есть:
{"tool_call":{"name":"read_files","arguments":{"files":[{"path":"c:\git\dsh-local-llm\src\index.ts","start_line":240,"end_line":350},{"path":"c:\git\dsh-local-llm\src\server-manager.ts"},{"path":"c:\git\dsh-local-llm\src\downloader.ts"}]}}
такой ответ правильный как я понимаю:
TOOL_CALL: read_files
arguments: {"files":[{"path":"c:\git\dsh-local-llm\src\downloader.ts","start_line":83,"end_line":120},{"path":"c:\git\dsh-local-llm\src\server-manager.ts","start_line":90,"end_line":245},{"path":"c:\git\dsh-local-llm\src\ui-components\components\ModelManager.tsx"},{"path":"c:\git\dsh-local-llm\src\ui-components\index.tsx"},{"path":"c:\git\dsh-local-llm\README.md","start_line":1,"end_line":60}]}
atharvotech commentedon Sep 19, 2026
English please
dekrezz commentedon Sep 21, 2026
hey, i fixed this issue in my fork: https://github.com/dekrezz/FreeDeepseekAPI
the problem was related to long-running sessions and tool-call parsing after prompt compaction. it should now handle this case properly.
thanks a lot for reporting it and for the detailed logs, they were really helpful.
wertyBSd commentedon Sep 25, 2026
@dekrezz I’ve also made my fix) now I’m going to test it. ))
But you’re right, the problem is exactly what you wrote about.
wertyBSd commentedon Sep 25, 2026
If don’t want to change the version or code of FreeDeepseekAPI, you can switch to another combination: FreeDeepseekAPI + VS Code + Cline — this will work.
wertyBSd commentedon Sep 25, 2026
@dekrezz In my changes, I also added small delays to avoid receiving messages saying “too many messages, try again.”
dekrezz commentedon Oct 1, 2026
@wertyBSd Funny, I already had this covered. Why make every request wait when a rate-limited account can just step aside? On a 429, a "too many messages" 400, or
rate_limit_reached, that login goes on cooldown and the request moves to the next one. It honorsRetry-Afterand keeps one in-flight chat per login. There's a short pause before retries too.Check it yourself:
😉
Merge branch 'claude/keen-carson-bvdzb1': session deltas, unified mod…
ForgetMeAI commentedon Oct 7, 2026
Fixed in
main(81374ae). Thanks for the detailed logs, they pointed straight at the cause.Root cause. When a DeepSeek chat was reused, the proxy re-sent the whole conversation (compacted to 80 000 chars) into the same chat on every turn. The chat's context grew quadratically, so after a dozen tool steps DeepSeek drifted off the tool-call format and started answering with plain code blocks. That matches your
Compacted upstream prompt 372213 -> 80000lines followed byNo tool call match.What changed:
DEEPSEEK_MAX_SESSION_CHARSis replaced by a fresh chat with a compacted prompt."c:\git\dsh-local-llm\src\index.ts"(your example) and raw newlines inside JSON arguments.Verified against live DeepSeek with a 24-step tool session plus a final answer: context is kept, and work continues after a chat rollover. If it still happens on current
main, please reopen with the server log.Generated by Claude Code