Repository navigation
[PR] feat: visibilityMarkers tri-state — model-only receipt delivery - #1708
ranxianglei wants to merge 14 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7308-pr.1708.ef7ce15This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr1708.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review complete (branch pulled, code read end-to-end, drive-by independently reproduced, CI verified on final head). Verdict per gate: ① 原 issue(#1701)— 方向关 ✅Implements the owner-approved design (floor 4「可以,动手」) faithfully. Verified all five gate points against the design: derived flags ② 回归审查 — 既有行为清单(逐项判定)
③ 代码审查 — 主关 ✅
④ 测试有效性 — 质量关 ✅The 14 new tests have teeth: they assert actual wire bytes (zero ⑤ diff 整洁度 ✅(一处已直接修掉)Clean except three lines of indentation drift introduced on changed lines ( Pre-flight & CILocal: typecheck ✓, build ✓ (dist-import-annotations OK), targeted suites ✓. Full CI on final head Conclusion: no regressions found; all intentional changes disclosed; mergeable once you merge (merge stays human-only per repo rules — I did not merge). Only follow-up worth noting: sequence #1449 against this PR (see ②.8). 中文摘要: 实现了 #1701 拍板的 visibilityMarkers 三态(stream/model-only/off),默认行为字节级不变、model-only 下回执对客户端零字节且终态恰好一条 ❌;审查未发现回归,顺手修了 3 行缩进漂移(commit a3a3f2a),CI 13/13 全绿,可以合并。 |
a3a3f2a to
48c1709
Compare
…ster red) The unused-exports CI job fails on this branch with INTERNAL_ONLY src/agent/client-build-note.ts: ClientBuildCheck — an inherited failure: the file is byte-identical to master tip 146b34f, where the same job fails with the identical line (#4545 train added a type-only export the de-export sweep missed). One-word fix per the few-line CI-fix discipline: remove the leading export; the type remains used inside its own file. Local gates: unused-export clean (6 waived), tsc --noEmit green. Duplicates PR #4606 commit 1 (root fix vehicle); drop this commit when rebased after #4606 merges.
(ai: vllm-qwen/qwen3.8-27b) CI auto-fix lane (attempt 1/2): the failing The red line was: 结构化结论(八问)
遗留风险提示:master 还有另一处继承红(LIVE_FILES 护栏—— 结论:本轮目标检查(unused-exports)已在分支侧修复,新 head |
…solution) Union at the runCompressLoop call site: keep master's new 'reply' (handoff-reply, #4248) plus this PR's 'visibilityMode' tri-state. Merged loop options accept both (reply?: HandoffReply / visibilityMode?: VisibilityMode).
(ai: vllm-qwen/qwen3.8-27b) 上游冲突已解决:master( 冲突点: 语义交叉核对(hot-file 纪律):合并后全仓 grep 所有 usage——每个 Pre-flight:typecheck ✓ · build ✓(dist-import-annotations OK)· 结构化结论(八问):
CI 提示:分支现同时含 ci-fixes tip 结论:冲突已解、分支已推(a489ac8),等 CI 重触发与 owner 合并。 |
|
冲突 |
# Conflicts: # src/server/handle.ts
(ai: vllm-qwen/qwen3.8-27b) 收到「冲突」——已核验,当前不存在文本冲突:PR 分支头已完整包含 master 尖。 证据链(三层):
解读: 如果你说的「冲突」指别的东西——某个具体 CI 分片红、或与另一条分支(release lane / bugfix 车道)的冲突——告诉我具体 ref 或症状,我按那个方向查。 结论:分支侧无需动作;等你确认所指 + CI 跑完即可推进合并。 |
(ai: vllm-qwen/qwen3.8-27b) 结论:当前无文本冲突,无需 rebase/merge/push——master 已完整包含于本 PR head,PR 处于可合并状态(仅待评审/必需检查解锁)。 核验证据(全部基于远端权威 SHA,非本地陈旧 checkout):
关于再次触发:本 PR 的 head 与 master 自 floor 21(2026-10-27 17:00,当时同样判定「无文本冲突、blocked≠dirty」)以来均未变化,merge-guard 却再次以 reason=conflict 触发——两次输入完全相同、结论不同,指向 guard 侧读到的是 GitHub 异步重算 收工判定:分支侧无需动作,等评审/必需检查解锁即可合并(合并权在 owner)。 |
…conflicts) Merged origin/master (58e61a3, +121 commits) into the PR #1708 branch 2026-09-29_model-only-visibility. Two content conflicts, both confined to the import block of the two prepare lanes — resolved as a union of orthogonal additions (no logic change): src/server/prepare-openai.ts + import type { VisibilityMode } from "../compress-settings.js" (this PR) + import { effectivePromptCacheRouting } from "../config.js" (master #5079) src/server/prepare-responses.ts compress-settings import gains `type VisibilityMode` (this PR) config.js import gains `effectivePromptCacheRouting` (master #5079) All other hunks auto-merged cleanly in separate regions: this PR's visibilityMode call-sites and master's prompt_cache_key routing / resolvePromptCacheKey sessionId param do not overlap. Local pre-flight on the merged head: typecheck OK, build OK (dist-import- annotations OK, dist-external OK), tests/visibility-markers.test.ts 15/15, tests/issue5079-pck-default-off.test.ts 8/8, tests/issue3813-responses-pck-ablation.test.ts 2/2. Full-suite verdict is the remote CI test lanes on the pushed head. Resolves the merge-guard conflict trigger for PR #1708.
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决并推送:把 origin/master(58e61a3d5,+121 commit)merge 进 PR 分支,两处 import 块冲突按「正交新增取并集」处理——prepare-openai.ts 同时保留本 PR 的 |
Merged origin/master (c0fa5b2) into PR #1708 branch 2026-09-29_model-only- visibility per the merge-guard "behind" sync request. Clean auto-merge — no conflicts, no manual resolution. Master's new commits did NOT touch src/server/prepare-openai.ts or src/server/prepare-responses.ts, so this PR's visibilityMarkers feature code is byte-identical; the sync only pulls master's unrelated work forward. Local pre-flight on the synced head: typecheck OK, build OK (dist-import- annotations OK, dist-external OK), tests/visibility-markers.test.ts 15/15, tests/issue5079-pck-default-off.test.ts 8/8, tests/issue3813-responses-pck-ablation.test.ts 2/2. Full-suite verdict = the remote CI test lanes on the pushed head. Brings the branch current to reduce drift ahead of merge.
Pull e5e2108 (master) into the PR branch. Master added the #4521 statusLine block into prepare-openai.ts / prepare-responses.ts in the same nudge-injection region as this PR's visibilityMode call-sites; the two changes are orthogonal and auto-merged cleanly (both retained). Verified on the merged tree: typecheck, build, visibility-markers (15/15), issue5079-pck-default-off (8/8).
Closes #1701
Implements the owner-approved design from #1701: proxy-internal receipts (
\u{1F4E6} [ACP] Compressed ...,\u274C [ACP] ... FAILED) become model-visible, client-invisible under the newmodel-onlymode, so clients (Codex etc.) stop persisting and re-sending them.Config surface
Field:
compress.visibilityMarkers(existing field, type extended — no new key, no new section)booleanboolean | "stream" | "model-only" | "off"truetrue≡"stream")true/falsetrue≡stream,false≡off"false","STREAM",0)Why the existing surface could not express this: the boolean conflated two independent concerns — client-stream visibility vs model-side injection (#1701 fact 3). Mechanisms considered before extending it: a separate top-level switch (rejected: splits one concern across two places), env-var-only (rejected: not tierable per route/model like the rest of compress config), new
compress.*sibling field (rejected: same field already owns the concern; tri-state keeps one knob). Migration: none needed — existing configs behave byte-identically.Behavior changes (old → new)
true⇒stream: client stream and model-side injection exactly as today (both derived gates evaluate to the same booleans as the old!== false).model-only: zero receipt bytes in the client stream (success receipts AND intermediate failure retries); model-side injection unchanged (paired tool-call/tool-result was never gated; orphan marker message + JSON-lane developer item stay on); one visible ❌ line at terminal compression failure (repeated-identical-failure early break / max-rounds cap), because intermediate ❌s are now silent and the user needs exactly one trace of the terminal state.off(≡ legacyfalse): double-off, semantics unchanged from legacy false.MARKER_SILENCE_CLAUSE) follows model visibility: on forstream+model-only, off foroff. Inmodel-onlythe model still sees receipts in same-request re-requests, so dropping the clause would re-trigger [Question] zocde调用子智能体的时候,子智能体有概率出错,导致子智能体停止工作 #862-style narration.Scope: proxy lane only (streaming Responses/OpenAI/Anthropic/Google + JSON Responses). The plugin lane (host-embedded) takes effect where the proxy controls the response stream; its marker path is unverified per #1701 and will follow up separately. The proposal's optional add-ons (SSE-comment form, belt-and-suspenders filter extension) are NOT included — separate work.
Drive-by fix (labeled, unrelated to #1701)
tests/issue1086-chain-self-exemption.test.tsusedrmSyncwithout importing it — pre-existing ReferenceError on clean master (verified on a worktree of origin/master @ 8293a54: 21 tests, 1 fail). One-word import addition, own commit.Pre-flight
npm run typecheck✓npm test: 3278 tests, 3266 pass, 0 fail, 12 skipped (e2e-gated) ✓npm run build✓ (dist-import-annotations OK)Tests added (
tests/visibility-markers.test.ts): tri-state parse round-trip + poison cases; merge deepest-wins;resolveVisibilityModenormalization; per-mode streaming-loop parity (marker present/absent, re-request pair intact, graceful completion); model-only terminal failure = exactly one visible ❌ receipt message preceding completion; off double-off at terminal failure; JSON-lane polarity split (developer marker on re-request, zero marker bytes in returned output); JSON cap-exit terminal marker.Cache-prefix note: receipts live only within one request's re-request chain (never written to session state), so cross-turn client history and model view stay byte-stable by construction.