Skip to content

[Bug][omp native] 0.1.214: a degraded direct send keeps the stamped prompt_cache_key, strict upstreams answer 400 #6802

Closed

Description

@Maziar123

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

  1. Run an omp session with the native plugin attached to a lane proxy.
  2. 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).
  3. 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 — stampPromptCacheKey stamps 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 — when readyOrigin gives no origin, the request goes to directSendOrRefuse (:1729).
  • directSendOrRefuse only asks the lane's prepareDirectSend hook. The omp lane uses createPrepareDirectSend() (src/agent/omp-native.ts:218), which only restores or refuses incremental bodies. Nothing on this path removes prompt_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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions