Repository navigation
[PR] fix(omp): default PI_ANTHROPIC_MESSAGE_THREADS=0 so bili sees the full history - #6113
SajjadPSavoji wants to merge 0 commit into
Conversation
(ai: opencode/qwen3.8-27b) Duplicate screening: not a duplicate. Searched open+closed issues/PRs for Labels: bug / omp / scope/wiring / p1 — one-line reason: silent loss of bili's core compression promise for every OMP ≥18.18 session on the official Claude URL (core promise broken ⇒ p1 per the 2026-10-19 revision). CI on head |
(ai: opencode/qwen3.8-27b) Verdict: APPROVE — mergeable (human merge; auto-merge gate not met by design: touches five src modules and changes a product default — §7.4 items 4/5). Direction (source issue #6088). The report is well-evidenced (repro table: threads on → 1 request / 2 msgs / 2 Interaction with the existing threads lane. No conflict: Regression inventory (existing behaviors on touched paths).
Tests. All three new tests are genuine red→green (on master they fail by construction: import of not-yet-existing exports / assertion on an unset child-env value). Local run on head Two non-blocking observations (recorded as notes, no commits pushed):
结构化八问(中文)
行为变更披露(旧→新): 判定:可合并(人工合并)。两条非阻塞观察已列上方,不构成合并障碍。 |
|
conflicts |
|
merged master in, it's clean again now |
(ai: qwen/qwen3.8-27b) The merge conflict is already cleared — the PR is now Why it was dirty: the branch was based on an old master ( What I did (independent verification): I reproduced the exact same merge locally — same two parents (
Then I validated the result: Nothing pushed. The author had already pushed Live CI (head 七问
结论:冲突已解除( |
[ework] CI fix verified green ✓ |
Resolve the src/server/handle.ts conflict from master drift (ranxianglei#6113 round 2). Master added the ranxianglei#6220 BILI_PLUGIN_BYPASS warn-once flags at the same module-level spot the PR added its ranxianglei#6088 messageThreadsWarned set; keep both (independent declarations, no interaction).
(ai: qwen/qwen3.8-27b) Resolved and pushed. This time the conflict was real — both sides had moved since the author's earlier merge:
Where it conflicted: How I resolved it: kept both (they don't interact). Then validated the merged tree locally: Push: merge commit Live state now: 七问
结论:冲突已解除并推送( |
(ai: vllm-qwen/qwen3.8-27b) CI red triaged and resolved as far as this lane can take it — all 4 failing shards are inherited/known, none caused by this PR. Synced the branch to the latest master and reported to #4599. What was red (run 43436720968, head 6c4db56):
Root cause (both confirmed via #4599, same signatures as PRs #6429/#6435):
Action taken:
八问(中文):
判定:本 PR 的 4 个红分片全部为继承红 + 在档 flake,非本 PR 引入;已同步到最新 master 并推送(3bff4d1)。notice 测试的根治等哨兵在 ci-fixes 收敛后本 PR 应转绿;存储 flake 重跑即清。 |
|
Landed via batch PR #6482 (merged) — closing as superseded. |
3bff4d1 to
2153152
Compare
OMP 18.18+ sends official-URL Claude turns as Anthropic message threads, so after turn one each request carries only the newest message and bili never sees the conversation.
PI_PROXY_ANTHROPICleaves the model base URL official, so threads stay on and the session silently never compresses.Added
applyOmpMessageThreadsOff()innative-bootstrap.ts. It setsPI_ANTHROPIC_MESSAGE_THREADS=0only when the var is unset or blank, so a user value still wins. It's called from thebili omplauncher branch and from the omp-native extension at load, under the same gate as the first-event-timeout stamp.I also added
anthropicBetaMessageThreads()incontext-window.ts.handle.tsuses it to log one warning per session when an anthropic request carries amessage-threads-*beta. It's keyed on the id before|sub:, so forks don't repeat it.Tests: the
bili omplauncher test intests/launcher.test.tsnow asserts the child env getsPI_ANTHROPIC_MESSAGE_THREADS=0. I rantests/omp-native.test.ts(fails before the change, passes after), plustests/model-windows.test.ts,tests/launcher.test.tsandnpx tsc --noEmit -p tsconfig.json, all passing. The full suite was not run.Fixes #6088
Generated with Claude Code (Claude Opus 5.5 and Claude Sonnet 5.5)