Skip to content

[PR] fix: un-show a nudge whose request the upstream rejected - #6531

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
MohammadErfan-Jabbari:2026-11-13_rejected-nudge-rearm
Nov 15, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
MohammadErfan-Jabbari:2026-11-13_rejected-nudge-rearm

Conversation

@MohammadErfan-Jabbari

Copy link
Copy Markdown
Contributor

Fixes #6530

Problem

The kernel stamps a nudge as shown when it decides to inject it, before the request goes upstream. When the upstream rejects that request (4xx), the model never saw the nudge, yet the stamp holds the cadence as if it had: the next nudge waits until the context grows a full growth floor past the rejected request (22,500 tokens at the default cadence), and longer when the client's next request is smaller. Seen in a Claude Code session on 0.1.213 after a #5432 400 (growth=-21002 ... blocked: T1 (cadence)); any 4xx produces it.

Fix (host side, no kernel change)

  • src/server/prepare-anthropic.ts records the nudge stamps from before the turn (nudgeStampsBefore) only when the request carries an injected nudge.
  • src/server/relay.ts: on a 4xx for such a request, rejectNudge (src/session.ts) restores lastNudgeShownTokens / lastShownByTier and sets transient.nudgeHeldAfterReject.
  • While held, prepare injects no nudge, so the next request goes out without the nudge in case the nudge drew the rejection. src/cache-ledger.ts clears the hold when a request succeeds, and the next turn decides from the old reference.
  • One info log line per rejection: nudge rejected with its request (upstream 400): stamps rolled back ....

Both compression modes

  • Proxy mode: this is where bili injects the nudge, so this is where the fix acts.
  • Plugin mode: the agent owns compression and the proxy injects no nudge, so nudgeStampsBefore is never set and nothing changes.

The fix covers the Anthropic wire only. prepare-openai.ts, prepare-responses.ts and prepare-google.ts do not record stamps, so they behave as before. Extending them is a follow-up if the maintainers want it.

Tests

  • tests/rejected-nudge-rearm.test.ts (new): sends a smaller request after the 400, as the client did. It fails on master (after a request succeeds, the undelivered nudge is re-armed), passes with the fix, and checks that a delivered nudge is not re-armed.
  • npm run typecheck clean.
  • Not run: the codex e2e suite (ACP_TEST_E2E=1). This touches the relay path, so the maintainers may want that lane before merge.

Review tier

This touches nudge cadence state in the session, so per §7.4 it stays with a human reviewer rather than auto-merge. No config, persistence-format, wire-shape or kernel change.

🤖 Generated with Claude Code

The kernel stamps a nudge as shown when it decides to inject it, before the
request goes upstream. When the upstream rejects that request (a Claude Code
session on v0.1.213, 2026-11-11: the nudge drew "role 'system' must precede an
'assistant' message"), the model never saw the nudge, yet the stamp holds the
cadence as if it had: the next request was smaller than the rejected one, the
decision read "growth=-21002 ... blocked: T1 (cadence)", and the next nudge
waits until the context grows a full growth floor past the rejected request.

On a 4xx for a request that carried a nudge, roll the shown stamps back to
their pre-turn values and hold nudges until a request succeeds, so the next
request goes out without the nudge that may have drawn the 400, and the turn
after a success re-decides from the old reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ranxianglei ranxianglei changed the title fix: un-show a nudge whose request the upstream rejected [PR] fix: un-show a nudge whose request the upstream rejected Nov 13, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Reviewed the diff, the kernel stamping mechanism, and the new test. I also ran the test locally on both master and the PR head to verify the regression claim.

Verdict: mergeable. The fix is correct for the reported repro, the test is a genuine regression test, CI is green, and the code follows repo conventions. The notes below are non-blocking.

What I verified

  1. The fix is correct for the direct 4xx path (the reported repro). The mechanism is sound: prepare-anthropic.ts captures nudgeStampsBefore immediately before core.processTurn, and relay.ts calls rejectNudge on a 4xx — which restores lastNudgeShownTokens / lastShownByTier to the pre-rejection values and sets transient.nudgeHeldAfterReject. While held, no nudge rides (so a nudge that may have drawn the rejection isn't re-sent), and settleUsageReport clears the hold on the next success, after which the cadence decides from the rolled-back reference. The rollback is precise — it preserves a prior delivered nudge's cadence rather than zeroing it (cf. the full reset in absorbAbortedTurnGrowth, src/session.ts:1133).

  2. The test is a valid regression test — I ran it. On master it fails at exactly the claimed assertion (after a request succeeds, the undelivered nudge is re-armed, false !== true); on the PR head it passes. The master log shows the bug clearly: after the 400 the next request reads growth=195/400 (ref=3492) … blocked: T1 (cadence) — the stamp sits at the rejected request's meter (3492) and the cadence holds even though the model never saw the nudge. The control session (delivered nudge) correctly keeps holding. Both directions of the gate are asserted, satisfying the Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 discipline.

Non-blocking notes

  1. PR description, "Both compression modes" — the plugin-mode line is inaccurate. It says "the agent owns compression and the proxy injects no nudge, so nudgeStampsBefore is never set and nothing changes." But per 0.1.69 回归: plugin 模式 nudge 注入被 !pluginMode 静默禁用 — INJECT 日志照打但从不投递, 自动压缩只剩 preflight 应急 #451 (src/server/prepare-anthropic.ts:510), the nudge is injected in BOTH modes — in plugin mode the agent has no nudge channel of its own, so the proxy-side nudge IS the proactive trigger. nudgeStampsBefore is set whenever nudgeOutcome === "injected", regardless of mode, so the fix also applies in plugin lanes. The code is correct and mode-agnostic; only the description wording is off. Worth a one-line correction in the PR body.

  2. Follow-up consideration (not a blocker): the overflow-refold-success path. On a 400 overflow, bili re-folds and re-sends within the same request (src/server/relay.ts:1933–1938); when that re-send succeeds, prepared is replaced and the function continues as a success, so rejectNudge is never reached and the original nudge's stamp stays stale. In practice this is a theoretical edge: in the overflow case the proxy already compressed (the fold), so the nudge is largely redundant and the low-water rule re-anchors the reference on the next (smaller) request. If maintainers want full "any 4xx" coverage, it's worth a follow-up in A nudge whose request the upstream rejects still counts as shown and delays the next nudge #6530 — it would need to roll back only when the refold re-send did not itself re-deliver a nudge.

  3. Out of scope (the issue scopes to "any 4xx"): 5xx and connection errors also leave the stamp stale (5xx has armFailureShrink but no nudge rollback). Not a defect against this issue's scope; noting for completeness.

  4. Minor: the hold is cleared only on a positive usage report (s.total > 0, src/cache-ledger.ts). A 200 with a zero-total usage sample keeps the hold one extra turn. Acceptable edge — a zero-total sample is already treated as carrying no information ([Bug] Anthropic 流式请求被中断后,可能把 lastInputTokens 错误覆盖为 0 #793).

No config, persistence-format, wire-shape, or kernel change; the new conjunct sits outside nudgeOn in prepare-anthropic only, so the lane-decisions matrix is unaffected. The human-review tier per §7.4 (nudge cadence state) is the right call.


审核八问

  1. 是什么问题:上游 4xx 拒绝了一个携带 nudge 的请求后,kernel 在「决定注入」时已把 nudge 标记为 shown(lastNudgeShownTokens/lastShownByTier),于是节奏(cadence)像 nudge 真的送达了一样被压住——但模型其实从没看到它,下一次 nudge 要等上下文从被拒请求的计量点再涨满一个 growth floor 才会出现。
  2. 什么原因导致的:根本原因在 kernel 的盖章时机——decideNudge 决定注入的那一刻就盖章(kernel/src/compress.ts ~1583),早于请求真正送达上游;上游拒绝后没有任何回滚路径,盖章残留。host 侧此前对「不完整回合」只有 abort 时的全量重置(absorbAbortedTurnGrowth),没有针对「上游拒绝」的精确回滚。
  3. 影响范围与严重程度:触发条件 = Anthropic wire 上任何一次携带 nudge 的请求被上游 4xx 拒绝(Anthropic 400: mid-conversation system must FOLLOW a user message — heal only checks the follower, and trailing nudge/notes land after a trailing system #5432 的 400 只是其中一种)。后果是 nudge 节奏被无故压住(体验/压缩及时性降级),不是数据丢失或会话不可用——属「特定条件下有问题」,p2 级。
  4. 怎么修复的:host 侧、不动 kernel。prepare 在 processTurn 前记下盖章快照;relay 在 4xx 时把盖章回滚到快照并置 nudgeHeldAfterReject 持锁(持锁期间不再注入 nudge,防止正是该 nudge 引起的拒绝被重放);下一次请求成功后(settleUsageReport 收到正 usage)解锁,节奏从回滚后的旧参考点重新判定。回滚是精确的——只撤销被拒那一次 nudge 的盖章,保留更早已送达 nudge 的节奏。
  5. 是否有回归问题:无。改动只新增「4xx 且本请求确实注入了 nudge」这一条路径上的回滚+持锁;未注入 nudge 的请求 nudgeStampsBefore 为 undefined,rejectNudge 不触发,行为与 master 完全一致。已送达 nudge 的节奏不受影响(控制会话验证)。高危模式逐项:无阈值/时序/输出格式漂移,无 fail-fast 变吞错,nudgeOn 门本身未动(新合取项在它之外、仅 prepare-anthropic)。
  6. 是否破坏缓存:不破坏。nudge 仍是独立的尾部 user 消息(cache-friendly,system 块字节稳定);持锁只是「这一轮不注入」,不改动已注入消息的字节或前缀。
  7. 是否改了设计方向:没有。沿用既有「盖章-回滚」思路(与 abort 吸收同族),只是把「全量清零」细化为「精确回滚+持锁到成功」,更保守。
  8. 是否引入了新的配置:没有。无新 env/config/默认值;nudgeHeldAfterReject 是纯内存 transient(不持久化、不上 wire),重启即失(安全:持久化的盖章已是回滚后的值)。

结论:可合。 修复正确、回归测试真实(master 红 / 修复后绿,已本地复跑)、CI 全绿;上述 3/4/5/6 为不阻塞的说明与后续项(4 建议记入 #6530 跟进)。

@ranxianglei

Copy link
Copy Markdown
Owner

(ai: vllm-qwen/qwen3.8-27b)

Reviewed. APPROVE for human merge.

The fix is correct and well-scoped: snapshot the nudge stamps before the request goes out, roll them back on a 4xx rejection, hold further nudges until a request succeeds, then re-arm.

Verified:

  • New regression test tests/rejected-nudge-rearm.test.ts fails on master, passes with the fix (true regression test).
  • typecheck clean on the PR branch.
  • 24/24 targeted nudge tests + 40/40 cache-ledger tests pass.

Non-blocking findings:

  1. PR prose is inaccurate on plugin mode — the nudge IS injected in plugin mode (0.1.69 回归: plugin 模式 nudge 注入被 !pluginMode 静默禁用 — INJECT 日志照打但从不投递, 自动压缩只剩 preflight 应急 #451 + the passing "0.1.69 回归: plugin 模式 nudge 注入被 !pluginMode 静默禁用 — INJECT 日志照打但从不投递, 自动压缩只剩 preflight 应急 #451: nudge ALSO injected in PLUGIN mode" test), so the fix works in BOTH modes. Code is correct; please fix the prose.
  2. Same mechanism, different trigger (pre-existing, not handled): the host can VETO the nudge after the kernel stamps it (nudgeOutcome = vetoed/skipped/gated), holding the cadence for a nudge never sent. Same "stamp at decision, not delivery" mechanism, prepare-side path. Out of scope for this 4xx fix; tracked as a remaining facet in the issue.
  3. 5xx out of scope (gates on 400≤status<500) — acceptable (client retries the same body on 5xx).
  4. Minor: hold clears only on a non-zero usage report; a zero-usage success delays re-arm by one request.
  5. Minor: while held, the turn.statusLine (Compression conflict banner (bili v0.1.205, node v24.19.0, win32-x64) #4521) can still ride the held request — cosmetic.

Diff clean, code follows repo conventions. No kernel/config/persistence/wire-shape change. Full 8-question review: #6532

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Acknowledged — thanks for the review and approval. The PR is ready for human merge (merging is human-only per repo rules, so I won't touch the merge button).

On the two findings beyond what I'd flagged:

  • Veto path (finding 2): Agreed — it's the same "stamp at decision, not delivery" mechanism with a prepare-side trigger. The kernel stamps lastNudgeShownTokens the moment decideNudge sets shouldInject, but a host veto (nudgeOutcome = vetoed/skipped/gated) means the nudge never rides the wire, yet the stamp still holds the cadence. It's a distinct facet from the 4xx relay path this PR fixes, and correctly out of scope here — good that it's tracked in the issue as a remaining facet.
  • statusLine while held (finding 5): Agreed, cosmetic — the Compression conflict banner (bili v0.1.205, node v24.19.0, win32-x64) #4521 statusLine is independent of the nudge and is still informative on a held request; no action needed.

The one actionable item for the PR body before merge is the plugin-mode prose correction (finding 1): per #451 the nudge is injected in both modes, so "the proxy injects no nudge … nothing changes" should be reworded to say the fix is mode-agnostic.

ranxianglei added a commit that referenced this pull request Nov 15, 2026
…nes too (#6531)

The reject re-arm from #6531 only captured the cadence stamps in the
anthropic lane, but the nudge rides every protocol lane (all four
prepare-* files can set nudgeOutcome = "injected") — a 4xx reject on any
other lane kept the stale shown-stamp and starved the cadence exactly as
the issue describes.

Mirror the anthropic-lane pattern into prepare-google/openai/responses:
snapshot before processTurn, restore while the hold flag is set, veto
injection while held, expose nudgeStampsBefore only when actually
injected. The relay 4xx hook (rejectNudge) is lane-agnostic, so no relay
change is needed.

Tests: consecutive-4xx idempotency (a second 4xx must neither re-restore
the stamps nor clear the hold; the nudge re-arms exactly once after the
usage-settled success) and a full google-lane re-arm e2e (reject -> hold ->
re-arm), alongside the existing anthropic pair.
ranxianglei added a commit that referenced this pull request Nov 15, 2026
#6531)

Review finding on the #6531 extension: the hold flag was only cleared by
settleUsageReport for s.total > 0 samples, so on upstreams that never report
usage (#1595 route class) a single 4xx on a nudge request latched the hold
for the rest of the process lifetime — the exact failure #6531 fixes,
relocated.

Clear it at every no-usage success site (proxy-json, acp-loop, the three
plugin lanes) via releaseNudgeHold, matching the documented
'hold until the next success' contract. New e2e test: a stream with no
usage fields at all, one rejected nudge, hold released by the first
no-usage 200, nudge re-armed on the following turn. Verified the test
fails without the fix (3 pass / 1 fail) and passes with it (4/4); tsc
clean; sibling suites green (overflow-refold 9/0, google progress 5/0,
phantom-read 2/0, drain-audit 9/0).
@ranxianglei

Copy link
Copy Markdown
Owner

Heads-up from the batch-merge review (this PR will land via the batch PR, which fixes two issues found in this one before merging — the fixes will be noted in the superseded comment after the merge):

1. The re-arm was Anthropic-lane only, but the nudge rides every protocol lane.
The stamp snapshot/restore lived in prepare-anthropic.ts only. The other three lanes (prepare-google.ts, prepare-openai.ts, prepare-responses.ts) can also set nudgeOutcome = "injected" — a 4xx reject on any of those lanes kept the stale lastNudgeShownTokens stamp and starved the cadence exactly as the issue describes. Fixed in the batch branch (938040fb8) by mirroring the same snapshot → restore → hold-veto pattern into all four lanes. The relay 4xx hook (rejectNudge) was already lane-agnostic, so no relay change was needed.

2. The hold flag latches forever on upstreams that never report usage (major).
session.transient.nudgeHeldAfterReject had exactly one clear site: settleUsageReport gated on s.total > 0. On routes where the upstream never reports usage (the #1595 route class — nudge decisions deliberately ride local estimates there), a single 4xx on one nudge request left the hold set for the rest of the process lifetime: every future nudge suppressed until restart. That is precisely the failure this issue fixes, relocated to a different route class. Fixed in the batch branch (4c8824e04) with a releaseNudgeHold() call at all five no-usage success sites (proxy-json, acp-loop, and the three plugin lanes), matching the documented "hold until the next success" contract.

Both fixes carry new end-to-end tests in tests/rejected-nudge-rearm.test.ts: a consecutive-4xx idempotency test (the second 4xx must neither re-restore nor clear the hold), a full Google-lane re-arm run, and a no-usage-stream run (complete Anthropic stream with no usage fields at all — reject → hold → released by the first no-usage 200 → re-armed). The no-usage test was verified to fail without the fix and pass with it.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Acknowledged — thanks for the heads-up. I independently verified the batch branch before confirming (not just trusting the commit messages).

State confirmed

  • The batch branch batch10-wave10 (PR [PR] chore(branch): land 20 single-purpose fixes as one history-preserving batch (wave 10) #6765, tip 4c8824e04) contains the base [PR] fix: un-show a nudge whose request the upstream rejected #6531 merge (89a671e620) plus both review fixes on top:
    • 938040fb8 — mirrors the anthropic-lane snapshot→restore→hold-veto pattern into prepare-google.ts / prepare-openai.ts / prepare-responses.ts. The relay 4xx hook (src/server/relay.ts:2161) is already lane-agnostic (gated on prepared.nudgeStampsBefore), so no relay change was needed — confirmed.
    • 4c8824e04 — adds releaseNudgeHold() (src/session.ts:1172) at all five no-usage success sites: proxy-json (src/server/relay.ts:2931), acp-loop (src/loop/core.ts), and the three plugin lanes (src/plugin.ts chat/responses/json).
  • All four e2e tests are present in tests/rejected-nudge-rearm.test.ts: the original re-arm pair, the consecutive-4xx idempotency test, the full Google-lane re-arm run, and the no-usage-stream run.
  • Idempotency holds by construction: while held, willInjectNudge is vetoed → nudgeOutcome !== "injected" → nudgeStampsBefore is not exposed → a second 4xx neither re-restores the stamps nor clears the hold.

CI: PR #6765 checks are running (6 success / 11 in progress / 13 skipped, 0 failure at last mirror fetch). The batch PR's CI is the authoritative gate for the merge.

On #6531's own branch: the earlier conflict-resolution takeover is now moot — it lands via the batch PR, so no rebase/conflict work is needed on the contributor's branch. I won't touch the merge (human-only) or close it (owner-only).


审核八问

  1. 是什么问题:[PR] fix: un-show a nudge whose request the upstream rejected #6531 本身 = 上游 4xx 拒绝了一个携带 nudge 的请求后,kernel 在「决定注入」时已盖的 shown 盖章残留,节奏(cadence)被像 nudge 已送达一样压住。batch-merge review 又发现两个延伸问题:① 回滚只写在 anthropic 车道,其余三条协议车道(google/openai/responses)同样会残留;② 持锁标志在「上游永不报 usage」的路由上永久锁死。
  2. 什么原因导致的:根本原因 = kernel 在「决定注入」那一刻盖章(早于请求真正送达上游),上游拒绝后 host 侧没有回滚路径。两个延伸问题各自的直接原因:① 快照/恢复/否决只实现在 prepare-anthropic.ts;② 持锁标志唯一的清除点在 settleUsageReport(s.total > 0),无 usage 路由永远到不了那个清除点。
  3. 影响范围与严重程度:① 四条协议车道任一的 4xx 都触发(覆盖面比原 PR 的 anthropic-only 更大,属「特定条件下有问题」);② 无 usage 路由(nudge: no-usage recovery leaves stale reference after network or 5xx failure #1595 类)上单次 4xx → 持锁锁死到进程重启、其后所有 nudge 被抑制——较严重,正是原 issue 要修的失败形态换了路由类。
  4. 怎么修复的:① 把 anthropic 车道的「快照→恢复→持锁否决」模式镜像到其余三条车道(relay 的 4xx 钩子本就与车道无关,无需改);② 在全部 5 个无 usage 成功点补 releaseNudgeHold(),兑现「持锁到下一次成功」的契约。
  5. 是否有回归问题:无。① 新增合取项在 nudgeOn 之外、仅 prepare-* 车道;未注入 nudge 的请求 nudgeStampsBefore=undefined,rejectNudge 不触发,行为与 master 一致;连续 4xx 幂等(第二次 4xx 时持锁已否决注入 → 快照不暴露 → 既不重恢复也不清锁)。② releaseNudgeHold 幂等(仅在标志已设时删除),5 个成功点都是「干净成功」路径,不影响有 usage 时 settleUsageReport 的既有清除路径。高危模式逐项:无阈值/时序/输出格式漂移,无 fail-fast 变吞错。
  6. 是否破坏缓存:不破坏。nudge 仍是独立尾部 user 消息(system 块字节稳定);持锁只是「这一轮不注入」,不改动已注入消息的字节或前缀。
  7. 是否改了设计方向:没有。沿用既有「盖章-回滚-持锁到成功」思路,只是把覆盖面从 anthropic 扩到全车道、把清除点从无 usage 成功补全。
  8. 是否引入了新的配置:没有。无新 env/config/默认值;nudgeHeldAfterReject 是纯内存 transient(不持久化、不上 wire)。

结论:可随 batch PR(#6765)合入。 两处修复已在 batch 分支落地并经我独立核对(代码 + 4 个 e2e 测试齐全、机制自洽),#6531 自身分支不再需要冲突处理;合入后按约定在 superseded 评论补记两处修复即可。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Not rebasing this branch this run — the conflict-resolution is moot. Live verification first (mirror cache, fetched ~05:27Z this run):

Why I'm not doing the rebase + force-push:

The owner's floor-14 decision (2026-11-15 05:13Z) is explicit: "this PR will land via the batch PR, which fixes two issues found in this one before merging." That decision still holds — the batch PR #6765 is still open and in progress at the same tip, still carrying the #6531 changes. So the contributor's own branch does not need to be rebased to land; it will be superseded by the batch PR.

Rebasing + force-pushing this branch now would be (1) unnecessary — the changes already land via #6765; and (2) risky — force-pushing onto a superseded external contributor's branch, exactly the case the push-discipline note warns about (other agents may be working on the branch concurrently).

Action: stopping without touching the branch. No rebase, no force-push, no needs-decision label (this is not an open design decision — the owner already decided the landing path).

If the intent has changed and #6531 should instead merge directly on its own branch (not via the batch PR), confirm in-thread and I'll do the rebase + conflict resolution in a follow-up run.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei
ranxianglei merged commit 89a671e into ranxianglei:master Nov 15, 2026
56 checks passed
@ranxianglei

Copy link
Copy Markdown
Owner

Closes pair #6530 was auto-closed by the batch merge.

Superseded by #6765 (merged to master as 89a671e).

Your commit 99966e2 is in master verbatim — same content, same authorship, only the object ID changed (the batch used a real git merge, no rebase or cherry-pick rewrite). Merged under a different branch name, so GitHub does not flip this PR by itself.

Thanks for the fix — it is live in master from 89a671e onward.

Note: review found two gaps, both fixed on the batch branch before merge (full details in the Heads-up comment above): 938040f extends the re-arm to the google/openai/responses lanes (the nudge rides all four), and 4c8824e releases the hold on no-usage successes (it latched forever on upstreams that never report usage).

ranxianglei pushed a commit that referenced this pull request Nov 15, 2026
Master advanced 379 commits (incl. nudge-rearm #6531, side-passthrough,
preflight/fold, relay output-budget #6529) since the prior sync (9674cfa).
4 of the PR's 5 files overlapped; 3 auto-merged cleanly. The one conflict,
src/server/prepare-anthropic.ts, resolved as the union of both intents:
keep #4974's if (!anthropicTitleGen) gate wrapping the meter writes (the
meter writes are byte-identical on both sides modulo indent) and adopt
master's return which adds nudgeStampsBefore (nudge-rearm #6531). typecheck
clean; issue4974 + side-lane-invariants + issue2490 + issue2847 = 30/30 and
anthropic nudge suites = 7/7 pass.
ranxianglei added a commit that referenced this pull request Nov 15, 2026
Union resolution: #6531 nudgeStampsBefore on the google/responses lanes
kept alongside the #5874 re-arm/flush blocks; persist-metadata-fold-gate
test teardown takes master's closeAll(stores) helper over this branch's
per-store finally closes (same fix, master's shape).
@github-actions github-actions Bot mentioned this pull request Nov 16, 2026
ranxianglei pushed a commit that referenced this pull request Nov 16, 2026
Master advanced 68 commits (nudge-rearm #6531 recordNudgeInject, nudge-debug,
responses-system-sections, cache-ledger recovery, …) since the prior sync
(2e3cfc9). 2 of the PR's 5 files overlapped (prepare-anthropic.ts, relay.ts);
relay auto-merged cleanly. The one conflict, prepare-anthropic.ts, resolved as
the union of both intents: keep #4974's if (!anthropicTitleGen) gate wrapping
the meter writes (localInputEstimate / lastLocalTextEstimate / probeRequest
Membership / lastLocalTextEstimateOrigin) and adopt master's new
recordNudgeInject call OUTSIDE the gate — it is a cache-ledger recovery event
(nudge tracking, #6531), a separate concern from the meter the #4974 gate
protects. typecheck clean; issue4974 + side-lane-invariants + issue2490 +
issue2847 + issue6720-nudge-recovery = 41/41 and anthropic nudge suites = 7/7.
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.

A nudge whose request the upstream rejects still counts as shown and delays the next nudge

2 participants