Skip to content

v1.1.0: shell soft tiers, [ROUTE] discipline line, dispatch opt-out, ro bash allowlist - #12

Merged
mrzturn merged 4 commits into
mainfrom
dev
Sep 15, 2026
Merged

mrzturn merged 4 commits into
mainfrom
dev

Conversation

@mrzturn

@mrzturn mrzturn commented Sep 15, 2026

Copy link
Copy Markdown
Owner

v1.1.0 — graceful shell lifecycle, routing discipline, and a friendlier gate

English

Added

  • Shell subagent soft tiers + inline HANDOFF relay — two graceful advisories (conserve → hand-off) now precede the hard-cap termination, reusing the main session's absolute thresholds (soft 50k / hard 90k by default). A spent shell ends with HANDOFF: inline · progress: n/m · next: …; protocol §2 codifies it as the authoritative remaining-work state. Window-clamped pull-down keeps tiers under the real termination line; context.subagentForceTokens is now optional and defaults to forceTokens.
  • Per-turn [ROUTE] line — the token cost model (hands-on grows this session's context; a dispatch spends a fresh shell context) plus the declaration discipline, on every main-session turn from a single pure module.
  • dispatch: "off" project opt-out — stand down all task-call governance via .switchman/settings.json (read per call, no restart); caps/lang/watermark gates deliberately stay on.
  • Locale-following language ask — first-run questions localize into 11 locales from env LC_ALL/LANG; the capture anchor stays byte-stable so parsing is locale-independent.
  • Injection mode configured — narrows the injected shell face to the configured models' shells (fail-open to chain when nothing is configured).

Changed

  • Read-only shells gain a read-only bash allowlist — git status/diff/log/show/blame/…, listing-only forms of mutable git commands, and search/inspect utilities (rg, grep, ls, cat, head, tail, …) now run on ro shells; edit stays denied and find/sed/awk/echo stay blocked (mutation forms).
  • Default context watermarks retuned 60/80/120k → 50/90/130k — earlier conserve signal, more wrap-up room, longer handover runway; subagent advisories and the shared 130k termination line follow automatically. Explicit user context.* values are untouched.
  • ROUTE_META gate: synthesize-and-observe instead of deny — a missing/malformed META gets a lane-default synthesis + status note and the dispatch proceeds; a present-but-wrong META still denies with the sample. The three plugin-side prompt-rewrite retries collapse into the gate; redirected dispatches carry the prompt as-is.

Upgrade notes

Restart opencode to apply (startup-level injection changes). Users relying on the missing-META deny as a discipline prod should note the [ROUTE] declaration discipline is now the replacement surface.

中文

新增

  • 子代理软阈值 + 内联 HANDOFF 交接 — 硬终止前新增两级优雅建议(收缩 → 交接),直接复用主会话绝对阈值(默认 soft 50k / hard 90k)。耗尽的 shell 以 HANDOFF: inline · progress: n/m · next: … 结尾;协议 §2 将该交接块定为剩余工作的权威状态。窗口钳位等比下拉,建议线永不越过真实终止线;context.subagentForceTokens 改为可选,缺省跟随 forceTokens。
  • 每回合 [ROUTE] 行 — 携带 token 成本模型(亲自操作逐回合增长本会话上下文;派发只消耗全新 shell 上下文)与"每个实质动作前声明"纪律,由单一纯模块渲染。
  • dispatch: "off" 项目级退出 — 在 .switchman/settings.json 设置即让全部 task 治理下岗(每次调用重读,无需重启);上限/语言/水位门禁保留。
  • 语言询问跟随 UI locale — 首次询问按环境变量 LC_ALL/LANG 本地化为 11 种语言;捕获锚点字节稳定,解析与 locale 无关。
  • 注入模式 configured — 注入面收窄为已配置模型的 shell(未配置时回退 chain)。

变更

  • 只读 shell 获得只读 bash 白名单 — git status/diff/log/show/blame/…、易变 git 命令的列表形态、以及搜索/查看工具(rg、grep、ls、cat、head、tail 等)现在可在 ro 壳执行;edit 仍拒绝,find/sed/awk/echo 因存在变异形态继续禁止。
  • 默认上下文水位 60/80/120k → 50/90/130k — 收缩信号更早、收尾空间更大、交接跑道更长;子代理建议与共享 130k 终止线自动跟随。用户显式配置的 context.* 不受影响。
  • ROUTE_META 门禁从拒绝改为合成观察 — 缺失/不可解析的 META 合成 lane 默认值并放行(附状态注记);存在但错误的 META 仍附样例拒绝。插件侧三处改写重试收敛进门禁本身,重定向派发原样携带 prompt。

升级提示

重启 opencode 生效(注入面为启动级变更)。若你曾依赖"缺 META 即拒绝"作为纪律鞭策,请注意 [ROUTE] 行的声明纪律是替代面。

…-out, and META synthesis gates

1. Shell advisories reuse the main session's absolute soft/hard thresholds (conserve 60k / hand-off 80k / shared 120k cap, window-clamped pull-down); subagentForceTokens is now an optional override defaulting to forceTokens
2. Per-turn [ROUTE] token-economy line plus a project-level dispatch:"off" opt-out that stands down all task-call governance (cap/lang gates stay on)
3. Gate 6 synthesizes missing/malformed ROUTE_META with an observe note instead of denying; the three plugin-side META-rewrite retry paths in index.ts collapse into the single gate-side synthesis
4. Locale-following first-run language ask (env LC_ALL -> LANG -> en, byte-stable capture anchor) and injection mode "configured" narrowing the injected shell face to the configured set
1. ro shells' bash goes from a blanket deny to a permission object: catch-all "*" deny first, allow entries for read-only git subcommands (diff/log/show/status/blame/...), listing-only forms of mutable git commands, and search/inspect utilities (rg/grep/ls/cat/head/tail/...); edit stays denied
2. find/sed/awk/echo stay disallowed (mutation forms: -delete/-exec, -i, redirection writes); compound commands judged per segment so chained mutations still fall to the catch-all deny
3. one-line RO note appended to the ro shell prompt so review shells report findings instead of attempting writes; tests pin the allowlist shape, prompt suffix, and mutation exclusions
1. soft 60->50k (earlier conserve signal), hard 80->90k (more wrap-up room before reads close), force 120->130k (longer auto-handover runway); both default sites (config.ts, context-watch.ts thresholdsOf) synced with a pairing comment
2. shell subagent advisories and the shared termination line follow automatically: conserve/hand-off sit at the 50k/90k lines, default subagent cap 130k, window clamping recomputed
3. tests, CHANGELOG, and bilingual reference docs synced for the 1.1.0 batch
@mrzturn
mrzturn merged commit f990aca into main Sep 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant