Skip to content

test: responses-wire seam probes for reasoning prefix stability (#1650) - #1663

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-29_responses-seam-probes
Sep 29, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-29_responses-seam-probes

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

New file tests/responses-seam-probes.test.ts — a Responses-wire cache-seam probe suite modeled on tests/cache-seam-probes.test.ts. Pure test addition; zero production-code changes.

Why

The chat-wire seam net (cache-seam-fuzz / -probes / -detector) pins byte-prefix stability for the OpenAI-chat shape only — zero coverage of the Responses wire's reasoning items (verified by grep: 0 mentions in all three files). #1638's production fingerprint (cached pinned at 39×128 tokens) points exactly at host-side churn where a large opaque block sits early in the input: on the provider side the first changed element IS the prefix-cache breakpoint. Kernel pin bumps, src/loop/adapter-responses.ts refactors, or ingress normalize/sanitize adjustments that break Responses-wire prefix stability would currently pass the entire regression net silently.

Probes

Real proxy + scripted fake Responses upstream; each turn appends omp's faithful quad: type-less user message (normalizeResponsesMessageItems stamps type at ingress, #242) + reasoning item (~1KB opaque encrypted_content, stable rs_* id) + function_call + function_call_output, over 12 burst turns (no folds — those are covered by responses-fold-cache-seam #1548 / abort-rewind-cache-seam).

  • RP1 — tools array deep-equal across every consecutive request pair (element-0 prefix break guard).
  • RP2 — adjacent outbound bodies: input strictly extends; element-wise identity through the stable head (divergence allowed only at the trailing volatile slots: chain checkpoint / nudge / fresh turn items); plus a self-scaling byte-LCP floor so key-order drift outside input cannot hide behind the element walk.
  • RP3 — every rs_* reasoning item byte-identical across ALL bodies carrying it (tracked by id, since growth shifts positions) and persistent from introduction onward; every role-bearing item left typed by the ingress stamp ([Bug] Responses ACP round 2 生成 66 字符 message id,导致 Codex 后续请求持续 400 #242); final body carries ≥ TURNS distinct <acp> refs proving the untyped user prompts entered the kernel (a silently-dropped item would never get one).

Fake upstream reports no usage field (estimate-grade regime, same rationale as the chat probes). RESPONSES_SEAM_DUMP=<dir> dumps captured bodies for inspection.

Pre-flight

  • npm run typecheck — clean
  • npm test — 3193 tests, 3177 pass, 0 fail, 16 skipped (env-gated e2e/registry suites)
  • npm run build — success
  • new file alone: 3/3 pass in ~3.5s, clean process exit

No config-surface changes. No behavior changes (test-only).

Fixes #1650

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-29_responses-seam-probes (ac4614e)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.1608-pr.1663.784f8af

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr1663.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit a084876 into master Sep 29, 2026
12 checks passed
antclt pushed a commit to antclt/billion-context that referenced this pull request Oct 1, 2026
…in responses lane (ranxianglei#1638)

OMP-style plugin clients append custom_message-derived developer
notifications mid-history and re-send them every turn. The kernel's
responsesToCore hoists system/developer content from ANY position into
projection.systemParts, and prepareResponses re-injects the merged block
at input[0] — so every notification append rewrote the outbound FIRST
item and the upstream prefix cache missed the whole input (production
sawtooth: cached pinned to the instructions-only residual, ranxianglei#1638).

In plugin mode, mark the non-head system/developer items with an
unknown type just for the duration of responsesToCore: they land in the
projection layout as coreId-less slots and patchResponsesInput re-emits
them verbatim in their original position — the position-preserved
semantics the openai-chat wire already has (head-only hoist). The head
run keeps the hoist (stable system prompt), so the front developer
block stays byte-identical across turns. Proxy mode (native codex)
keeps the hoist-and-anchor behavior (ranxianglei#1085) untouched.

Transition cost: one-time cache miss per active plugin session at
upgrade (front block no longer carries accumulated notification text).

Tests (tests/responses-plugin-dev-position.test.ts): front block
byte-stability + in-place notification re-emission + append-only bodies
+ no sentinel leak; fold interaction (in-place carrier counts keep the
ranxianglei#1567 pins); leading additional_tools head-neutrality; proxy-mode
negative pin (hoist semantics unchanged). Fills the developer-item gap
neptune62 flagged in ranxianglei#1650/ranxianglei#1663.
@ranxianglei
ranxianglei deleted the 2026-09-29_responses-seam-probes branch October 15, 2026 05:32
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.

test gap: seam 回归网零覆盖 responses wire reasoning 条目(#1638 实验暴露的盲区)

1 participant