Repository navigation
[PR] Configurable hard timeout for the compress tool call (compress.timeoutSeconds) - #2535
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5256-pr.2535.71fc3deThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2535.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
继续 看上面消息 |
dc5576b to
9b665f4
Compare
继续处理完成(上一会话因磁盘空间中断,本次接手)。PR 代码本身此前已完成且 CI 绿,但分支落后 master 60 个提交——本轮做了完整 review + rebase 到最新 master + 重新验证。新 head: Review 结论(结构化八问)
测试有效性:25 个测试用真实 遗留项(PR 已声明,不在本 PR 范围): 判定:review 通过,分支已更新到最新 master,CI 全绿——可合并(feat 类新增配置面,按仓库纪律由人工合并:https://github.com/ranxianglei/billion-context/pull/2535)。 |
9b665f4 to
3f21e93
Compare
(ai: vllm-qwen/qwen3.8-27b) 上游冲突已解决并 force-push。PR #2535 的单提交 rebase 到最新 master( 冲突点与解法(核心判断,两处文件)
八问
判定:冲突已解、rebase 干净、本地定向验证绿、分支直接落在 master 之上——可进入人工合并(feat 类新增配置面,按仓库纪律由人工合并)。全量回归以 CI 为准:#2535 |
Closes #2524
What
Adds
compress.timeoutSeconds— a configurable hard timeout for the agent-sidecompresstool call.timeout after …ms (compress.timeoutSeconds)), which pi surfaces as anisErrortool result0/null→ disable the hard cap entirely (host turn cancellation via AbortSignal still works)shared.forwardToolHow
forwardToolinsrc/agent/shared.ts— the single seam through which every agent extension (pi / omp / dsh / opencode lanes) forwards tool calls — gated ontool === "compress". One seam covers all plugin-mode lanes uniformly; no per-agent duplication.fetchJsongains an optional timeout label and treatstimeoutMs <= 0as "no timer" (an external abort still aborts; with no timer, an external abort throws the original AbortError).configuredCompressTimeoutSeconds()reads the config file live on each call (hot reload, no restart). Tri-state:undefined= unset → built-in backstop;null/0= disabled;>0= cap in seconds. Any read/parse failure degrades to unset — a bad config file can never break tool calls.src/config.js: that module pulls acp-kernel values in, which would inline the kernel into light agent bundles (dsh-acp.jsdeclares "no acp-kernel import"). It mirrorsparseCompressSettings' validation for just this one key (null | finite number ≥ 0).src/config.ts:parseCompressSettingsnow acceptstimeoutSeconds(null | finite ≥ 0; anything else rejects the whole section, matching the existing section-level contract) so the web-UI save path round-trips it; added toCOMPRESS_SETTING_FIELDS.config surface
New key:
compress.timeoutSeconds(number | null, global level only).toolBashDefaultTimeoutapplies to bash only,delegate.*TimeoutMinutesto acp_delegate only,httpIdleTimeoutMsto provider HTTP streaming only. The only generic bound was the hard-coded 60 s backstop insideshared.forwardTool, not user-visible.BILI_*env var rejected — 彻底整治环境变了滥用,除非必要都走配置文件 #2030 discipline reserves env vars for secrets/spawn channels/host posture/path relocation/third-party conventions, and the issue itself specified the JSON shape; a kernel-side timeout rejected — wrong layer, the kernel does not own host tool forwarding.compresssections intentionally do NOT honor it (same as the injection toggles): the extension-side consumer reads the global block only. Documented in CONFIGURATION.md en+zh.Behavior change disclosure
None on the default path: with the key unset, every tool still gets exactly the fixed 60 s backstop it gets today. Observable differences only when the key IS set: (a) the compress cap becomes N seconds or unlimited; (b) when the configured cap fires, the error text gains a
(compress.timeoutSeconds)label.Out of scope / residuals
src/mcp.ts(codex/claude MCP lane) has its own forwardTool copy with a fixed 60 s; untouched here — separate failure domain, follow-up candidate.Tests
tests/issue2524-compress-timeout.test.ts(25 tests): parse accept/reject matrix; resolver tri-state incl. BOM / malformed JSON / misplaced top-level / provider-level cases + live reload across two writes; forwardTool against reallisten(0)servers proving the cap fires before a slow response, is compress-only, honors 0/null-disable, keeps the backstop when unset, and lets a pre-aborted host signal win when disabled.dsh-acp.jsverified kernel-free after bundling; issue2524 + compress-settings + config-file-cache 78/78; all 15 parseCompressSettings consumer suites 231/231.