Repository navigation
feat: compress.streamSummary — force streaming preflight summaries (#2133) - #2135
Merged
Merged
Conversation
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2178-pr.2135.6aa11e5This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2135.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
[bot] 🏷 PR review 完成 — https://github.com/ranxianglei/billion-context/pull/2135(head 中文结构化结论(七问)
证据
判定:可合并(merge 由人执行:https://github.com/ranxianglei/billion-context/pull/2135)。 |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.34-master.1d59262 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2133
做了什么
新增
compress.streamSummary配置键(boolean)。置true后,preflight 摘要请求从首次尝试起强制走流式(SSE)。支持三级级联(global → provider → model),最深层生效,可只限定出问题的 route。为什么这样做
现有
session.metadata.preflightStreamSummary自学习标志只在「HTTP 400 且响应体命中stream … true」时置位(#626)。Cloudflare(或同类网关)掐断长非流式补全时回的是 524/503/502——不匹配正则,自学习永远不触发,每轮摘要重复「非流式 → 524 → 重试」循环,压缩空转不折叠(即 #2133 报告的现象;手工把会话文件改成 true 立即恢复)。设计决策:不扩展自动学习到 5xx——一次 503 限流抖动就可能永久翻转会话的 wire shape,启发式误伤风险高;issue 作者也明确要确定性配置而非更多错误驱动学习。因此提供显式配置逃生门,学习路径原样保留(只覆盖真正的 400 stream-required)。
config surface(按规范声明)
compress.streamSummary,boolean,默认不设(= 旧行为:非流式优先、400 时学习)。纯增量,无迁移。compress、provider 级providers[<url>].compress、model 级providers[<url>].models.<m>.compress(配置文件顶层键是providers,或providersPath/ACP_PROVIDERS指向的外部 providers.json;routes只是解析后的内存表示)。最深层获胜(显式false覆盖浅层true)。nudgeGrowthTokens同为仅配置文件)。website/config-reference/compress.yaml增 seed 条目,已重新生成 CONFIGURATION.md / zh-CN + website 产物(CI docs-sync / docs-coverage 守卫覆盖)。行为变更披露
stream标志。metadata.preflightStreamSummary)——forced ≠ learned,两个来源独立(有测试钉住)。测试
tests/preflight-stream-summary-config.test.ts:parse 严格 boolean 校验、merge deepest-wins(含 model 级 false 压 global true)、e2e×3——① global ON:524 模拟网关后所有摘要首次即流式、折叠成功、200、learned flag 保持空;② default OFF:钉住不变行为(非流式 → 524 → fail-fast 502、不转发);③ per-provider scope:只有带配置的 route 走流式。preflight-stream-summary.test.ts(Codex(ChatGPT 登录)preflight 摘要被 400「Stream must be set to true」拒绝,长会话返回 502 #626 学习路径)+compress-settings.test.ts+web-routing.test.ts全绿(49+8 pass);typecheck + build 绿。全量回归交 CI。顺手小修(独立 commit)
工作中发现
mergeCompress里stripImages一行自上游起就顶格缩进(格式瑕疵),单独一个 cosmetic commit 修掉。