Repository navigation
Description
Summary
The omp plugin stamps the session id as a top-level prompt_cache_key while a proxy is claimed (BILLION_CONTEXT_PROXY is set). The proxy strips the field before it forwards. When a single request falls back to a direct send — the proxy is not ready, or its respawn failed — the claim is still set, so the body was already stamped, and nothing removes the field. A strict upstream rejects the whole request:
400 prompt_cache_key: Extra inputs are not permitted
Environment
- billion-context 0.1.214, master
e7a42bab. - Host: omp native plugin, Anthropic Messages wire through a local router, Linux.
Steps
- Run an omp session with the native plugin attached to a lane proxy.
- Make the proxy unable to serve for a moment while the claim stays set (in my case it was blocked by [Bug][reconcile] 0.1.214: fold reconcile does anchors x candidates text work; a resumed session blocks the event loop for over 300 s #6800 and then killed by the event-loop watchdog, [bug] After event loop wedge, zombie still holds port 18789 — parent respawn loop spins on EADDRINUSE indefinitely; manu | [bug] 事件循环卡死后僵尸仍握 18789 端口,parent 重拉全部 EADDRINUSE 死循环,只能手工杀进程恢复(event loop wedge holds listen socket, respawn loop fails with EADDR… #4762).
- Send a turn.
Evidence
From the plugin log, then the host's captured 400, in the same second:
[native-client] bili-native: proxy respawn failed — model requests go direct (uncompressed): http://127.0.0.1:<router-port>/v1/messages
The captured request body sent to http://127.0.0.1:<router-port>/v1/messages (not a /bili/ URL) has "prompt_cache_key": "<the omp session id>" at the top level, and the upstream answered 400 … prompt_cache_key: Extra inputs are not permitted.
Code path on master e7a42bab:
src/agent/pi.ts:539-553—stampPromptCacheKeystamps when the intercept is installed and a proxy is claimed (the live-claim gate from fix: native omp identity stamp + tool registration mirror the fetch interceptor (#1579) #1586).src/agent/native-intercept.ts:2125-2130— whenreadyOrigingives no origin, the request goes todirectSendOrRefuse(:1729).directSendOrRefuseonly asks the lane'sprepareDirectSendhook. The omp lane usescreatePrepareDirectSend()(src/agent/omp-native.ts:218), which only restores or refuses incremental bodies. Nothing on this path removesprompt_cache_key.
The claim is cleared only on give-up (onGiveUp), not when one request degrades, so this window exists whenever the proxy is busy, restarting or dying.
Expected
A degraded direct send carries no field that only the proxy understands.
Actual
The stamped prompt_cache_key reaches the upstream and the turn fails with 400.
Related
- [Bug] bili omp 扩展 stampPromptCacheKey 无条件注入顶层 prompt_cache_key —— 严格 schema 上游(opencode zen anthropic 端点)全量 400 #1403 / fix: stop leaking prompt_cache_key into anthropic upstreams (#1403) #1404: the original stamp leak into strict upstreams.
- omp 18.4.1 回归:扩展事件 before_provider_headers 已不存在(改名 before_provider_request),会话头永不附加,/acp 恒显一行空面板 #1579 / fix: native omp identity stamp + tool registration mirror the fetch interceptor (#1579) #1586: the live-claim gate on the stamp.
- [Bug] Anthropic requests leak prompt_cache_key when Cowork transport bypasses native fetch interception #2583 / fix: withhold prompt_cache_key stamp when OMP's Cowork transport bypasses fetch interception (#2583) #2589: the Cowork transport carve-out.
None of these covers a per-request fallback while the claim is still set.
Suggested fix
Give the omp lane its own direct-send guard: run the shared incremental guard, then drop a top-level prompt_cache_key only when its value is one the plugin stamped in this process. A key the host set itself stays. PR to follow.
Activity