[Drive-by] OpenAI lane: estimate-only emergency truncation still fires after a legitimate membership refusal

Open
#8,166 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Read the nudge and emergency-truncation logic and trace how membership refusals, estimates, real usage samples, and upstream overflow rejections affect truncation latches. The issue requires choosing between adding state tracking and relying on a separate fix, so first determine how the current flow handles each case. Done means estimate-only truncation is prevented after a legitimate membership refusal while existing latches replay and the specified real usage and overflow paths still work.

Written by the indexing model from the issue text.

Description

bug needs-decision p2 scope/kernel

🤖 Powered by ework · qwen3.8-27b

来源: 分析 PR #8165 (fix for #8163) 时发现
查重: 无

背景

PR #8165 修复了 #8163 的症状 1(OpenAI chat 车道 membership probe 传 undefined 而非 incomingMsgIds,主轮被误拒、usage anchor 不更新)。这是观察到的级联的根因。

症状(未修复)

#8163 还有症状 2,PR #8165 未触碰:membership 拒绝后,estimate 单独触发新的 emergency truncation。原 issue #8163 的 Expected:

Following a membership refusal, an estimate alone should not create fresh emergency clips. Continue replaying existing truncation latches to preserve the outbound prefix. Clear the hold on the next accepted real usage sample or an explicit upstream context-overflow rejection. Real usage over the threshold and confirmed overflow should retain the emergency path.

触发条件

当 membership 拒绝是合法的(真正的 side request,共享 conversation id)时,anchor 不更新(正确),但下一轮 estimate 可能 overshoot → emergency truncation → 新 clip → 冷读(零缓存)。

症状 1 修复后,观察到的级联(主轮被误拒 → estimate overshoot → truncation)不再发生。但症状 2 是通用 defense-in-depth 要求,适用于任何合法 membership 拒绝场景。

方案选项

  • Option A(推荐): nudge/emergency-truncation 逻辑中,上一轮是 membership 拒绝时,estimate 单独不触发新 emergency clip;继续 replay 现有 truncation latch。清除:下一个被接受的 real usage sample 或明确的 upstream overflow 拒绝。
    • 代价: 需修改 nudge/emergency-truncation 逻辑,增加状态跟踪。
  • Option B: 不修改,依赖症状 1 修复后 membership 拒绝变少。
    • 代价: 合法 membership 拒绝场景(真正 side request)仍可能触发 estimate-only truncation。

阻塞

需要设计决策(Option A vs B)+ 对 nudge/emergency-truncation 逻辑的深入调查。


Mirrored from ework issue #8167

Dominant language
TypeScript
Stars
619
Forks
60
Avg merge
1d 2h
Merged PRs (30d)
349

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ranxianglei/billion-context

All issues in ranxianglei/billion-context

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.