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
سلام، بعد از یک قطعی کوتاه اینترنت، در Freebuff Desktop 0.0.202 دیگر هیچ ابزار لوکالی برای جلسه ثبت نمیشود. پروژه روی Local است و composer هم Local نشان میدهد، ولی در هر پیام agent میگوید کامپیوتر در دسترس نیست و ابزارهایی مثل خواندن فایل و ترمینال اصلاً در جلسه وجود ندارند (خطای «not available» میدهند، نه timeout). سیستم روشن و در حال استفاده است، اینترنت پایدار است و VPN هم ندارم. بستن کامل برنامه، باز کردن چت جدید و ریاستارت سیستم را امتحان کردهام و فایدهای نداشته. لطفاً راهنمایی کنید چطور اتصال ابزارهای لوکال (machine binding) را ریست کنم.
Not with the team — I'm a community member helping triage this backlog, and this one reproduces without needing a real long session.
The result first: the trigger is an unfinished gzip stream at the end of the response body, not a dropped connection. The chat-completions response is gzipped SSE, and when the HTTP body ends before the gzip stream itself is finished, Bun's fetch throws ZlibError fetching <url> — even when the connection closed politely. That is why the error can land after a turn has visibly finished: the events have already been decoded and rendered when the stream ends.
Three things from you would settle the rest:
Did the turn continue afterwards, or was it dead at that point?
Did you see a message about Freebuff not confirming that the provider finished its response after several retries, or a bare ZlibError?
Roughly how many turns into the session, and is a fresh session with the same prompt clean?
The evidence for that first sentence, since it is a stronger claim than "a network blip":
cut-clean — compressor not finished, body ends cleanly
ZlibError
ZlibError
no throw
cut-abort — stream unfinished, socket destroyed
ECONNRESET
ECONNRESET
TypeError
finish-abort — stream finished, then socket destroyed
no throw
no throw
no throw
identity — no gzip
no throw
no throw
no throw
Three things fall out of that table:
The trigger is the unfinished gzip stream, not the dropped connection.finish-abort destroys the socket and throws nothing; cut-clean closes the body politely and throws. Any diagnosis that blames a network blip is looking one layer too high.
Node ends the same truncated body cleanly. That is why this only shows up on the Bun host, and why the existing test in sdk/src/impl/__tests__/compressed-stream-cut.test.ts has to tolerate the no-throw case.
Both Bun versions do it. 1.3.14 raises an Error and 1.4.4 a TypeError, but code stays ZlibError in both — so the classifier in common/src/util/error.ts still matches it. Anything matching on error name or instanceof Error would not survive that change.
Why this build asks for a gzipped stream at all
Worth putting next to the repro, because it explains why a cut connection turns into a decompression error for some users and not others:
Where
What it says
common/src/constants/sse-compression.ts
The server gzips the stream only for requests carrying x-freebuff-sse-gzip-recovery: 1. Builds that don't send the header get an uncompressed stream, which a cut ends cleanly — so older clients cannot hit this at all.
sdk/src/impl/model-provider.ts (~635)
The SDK sends that header on every chat-completions request.
common/src/util/error.ts (~440)
ZlibError and BrotliDecompressionError are listed in TRANSIENT_NETWORK_ERROR_CODES, with a comment describing this exact case and recording that on 2026-10-08 it produced 545 failed turns in 15 minutes across deploys.
So the failure mode is known, was mitigated by classifying the error as transient, and still reaches users. The open question is what lets it past the mitigation on a given build.
That open question makes me suspect the recovery budget rather than zlib: packages/agent-runtime/src/tools/stream-parser.ts sets MAX_CONSECUTIVE_STREAM_RECOVERIES = 3, and the turn fails loudly once three back-to-back recoveries have happened with only partial output between them. If that is what is happening, the fix is about the budget and the message, not the decompressor. Question 2 above is the one that separates those.
The repro (save as repro-zliberror-sse.mjs; run with bun, or node for contrast)
#!/usr/bin/env bun
importhttpfrom'node:http'import{constantsaszlibConstants,createGzip}from'node:zlib'constEVENTS=3functionstartServer(mode){returnnewPromise((resolve)=>{constserver=http.createServer((_req,res)=>{constgzipped=mode!=='identity'res.writeHead(200,{'Content-Type': 'text/event-stream',
...(gzipped ? {'Content-Encoding': 'gzip'} : {}),})constgzip=gzipped ? createGzip({flush: zlibConstants.Z_SYNC_FLUSH}) : nullif(gzip)gzip.pipe(res)constwrite=(frame)=>(gzip ? gzip.write(frame) : res.write(frame))constflush=(cb)=>(gzip ? gzip.flush(cb) : cb())letsent=0consttick=()=>{write(`data: {"choices":[{"delta":{"content":"chunk-${++sent}"}}]}\n\n`)flush(()=>{if(sent<EVENTS)returnsetTimeout(tick,10)setTimeout(()=>{if(mode==='finish'||mode==='finish-abort'){if(gzip)gzip.end()setTimeout(()=>{if(mode==='finish-abort')res.destroy()elseres.end()},30)return}if(gzip)gzip.unpipe(res)if(mode==='cut-abort')res.destroy()elseres.end()},20)})}tick()})server.listen(0,'127.0.0.1',()=>resolve(server))})}asyncfunctionrun(mode){constserver=awaitstartServer(mode)const{ port }=server.address()letevents=0try{constresponse=awaitfetch(`http://127.0.0.1:${port}/`)constreader=response.body.getReader()constdecoder=newTextDecoder()for(;;){const{ done, value }=awaitreader.read()if(done)breakevents+=(decoder.decode(value,{stream: true}).match(/chunk-/g)||[]).length}console.log(`${mode.padEnd(13)} no throw events=${events}`)}catch(error){console.log(`${mode.padEnd(13)} THREW events=${events} type=${error.name} code=${String(error.code)}`,)}finally{server.close()}}for(constmodeof['finish','cut-clean','cut-abort','finish-abort','identity']){awaitrun(mode)}
Reporter datapoint from the terminal CLI on Linux, since the thread is still waiting on version/OS/behaviour details.
Client:freebuff CLI 0.2.36, installed via npm global, run in bash
OS: Linux
Model: DeepSeek V4.1 Flash
Symptom:compression error: ZlibError appears directly above the prompt input, after a turn has completed and its response is fully rendered. No retry, no killed turn, no visible partial output.
Session shape: long-running session with a large transcript, which matches the "more frequent after a long session" note.
Logs: none available locally — the project-local .freebuff/ directory contains only project-id, so there is nothing to attach. If the CLI has a documented log path, I can collect one.
This matches the triage finding that the trigger is a cut-clean end to a gzipped SSE body, not a dropped socket: the error surfaces after the events were already decoded and rendered.
Two questions that would decide how to live with it:
Is there a supported way to opt out of x-freebuff-sse-gzip-recovery: 1 (env var or flag), so the stream is served uncompressed and a truncated body ends cleanly?
Is the banner intended behaviour when the turn has already succeeded, or is it meant to be suppressed unless the recovery budget in stream-parser.ts is actually exhausted?
If a specific Bun/Node matrix on Linux would help confirm the table from the earlier comment, tell me which commands you want run and I will report the output.
Activity
mahdijon5080-tech commentedon Nov 13, 2026
سلام، بعد از یک قطعی کوتاه اینترنت، در Freebuff Desktop 0.0.202 دیگر هیچ ابزار لوکالی برای جلسه ثبت نمیشود. پروژه روی Local است و composer هم Local نشان میدهد، ولی در هر پیام agent میگوید کامپیوتر در دسترس نیست و ابزارهایی مثل خواندن فایل و ترمینال اصلاً در جلسه وجود ندارند (خطای «not available» میدهند، نه timeout). سیستم روشن و در حال استفاده است، اینترنت پایدار است و VPN هم ندارم. بستن کامل برنامه، باز کردن چت جدید و ریاستارت سیستم را امتحان کردهام و فایدهای نداشته. لطفاً راهنمایی کنید چطور اتصال ابزارهای لوکال (machine binding) را ریست کنم.
lukew2580 commentedon Nov 16, 2026
Not with the team — I'm a community member helping triage this backlog, and this one reproduces without needing a real long session.
The result first: the trigger is an unfinished gzip stream at the end of the response body, not a dropped connection. The chat-completions response is gzipped SSE, and when the HTTP body ends before the gzip stream itself is finished, Bun's
fetchthrowsZlibError fetching <url>— even when the connection closed politely. That is why the error can land after a turn has visibly finished: the events have already been decoded and rendered when the stream ends.Three things from you would settle the rest:
ZlibError?The evidence for that first sentence, since it is a stronger claim than "a network blip":
finish— compressor finished, response ends normallycut-clean— compressor not finished, body ends cleanlyZlibErrorZlibErrorcut-abort— stream unfinished, socket destroyedECONNRESETECONNRESETTypeErrorfinish-abort— stream finished, then socket destroyedidentity— no gzipThree things fall out of that table:
finish-abortdestroys the socket and throws nothing;cut-cleancloses the body politely and throws. Any diagnosis that blames a network blip is looking one layer too high.sdk/src/impl/__tests__/compressed-stream-cut.test.tshas to tolerate the no-throw case.Errorand 1.4.4 aTypeError, butcodestaysZlibErrorin both — so the classifier incommon/src/util/error.tsstill matches it. Anything matching on error name orinstanceof Errorwould not survive that change.Why this build asks for a gzipped stream at all
Worth putting next to the repro, because it explains why a cut connection turns into a decompression error for some users and not others:
common/src/constants/sse-compression.tsx-freebuff-sse-gzip-recovery: 1. Builds that don't send the header get an uncompressed stream, which a cut ends cleanly — so older clients cannot hit this at all.sdk/src/impl/model-provider.ts(~635)common/src/util/error.ts(~440)ZlibErrorandBrotliDecompressionErrorare listed inTRANSIENT_NETWORK_ERROR_CODES, with a comment describing this exact case and recording that on 2026-10-08 it produced 545 failed turns in 15 minutes across deploys.So the failure mode is known, was mitigated by classifying the error as transient, and still reaches users. The open question is what lets it past the mitigation on a given build.
That open question makes me suspect the recovery budget rather than zlib:
packages/agent-runtime/src/tools/stream-parser.tssetsMAX_CONSECUTIVE_STREAM_RECOVERIES = 3, and the turn fails loudly once three back-to-back recoveries have happened with only partial output between them. If that is what is happening, the fix is about the budget and the message, not the decompressor. Question 2 above is the one that separates those.The repro (save as
repro-zliberror-sse.mjs; run withbun, ornodefor contrast)aj-nelson-0001 commentedon Nov 24, 2026
Reporter datapoint from the terminal CLI on Linux, since the thread is still waiting on version/OS/behaviour details.
freebuffCLI0.2.36, installed via npm global, run in bashcompression error: ZlibErrorappears directly above the prompt input, after a turn has completed and its response is fully rendered. No retry, no killed turn, no visible partial output..freebuff/directory contains onlyproject-id, so there is nothing to attach. If the CLI has a documented log path, I can collect one.This matches the triage finding that the trigger is a cut-clean end to a gzipped SSE body, not a dropped socket: the error surfaces after the events were already decoded and rendered.
Two questions that would decide how to live with it:
x-freebuff-sse-gzip-recovery: 1(env var or flag), so the stream is served uncompressed and a truncated body ends cleanly?stream-parser.tsis actually exhausted?If a specific Bun/Node matrix on Linux would help confirm the table from the earlier comment, tell me which commands you want run and I will report the output.