Skip to content

CONTRACT: fix host inference refusals reported as subscription auth failures - #4018

Merged
schlessera merged 16 commits into
mainfrom
fix/3787-inference-relay-refusal
Nov 15, 2026
Merged

schlessera merged 16 commits into
mainfrom
fix/3787-inference-relay-refusal

Conversation

@schlessera

@schlessera schlessera commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Issue

Closes #3787

What changed

Claude relay refusals now end and replay as host_refused, without a subscription re-login action or authentication-failure activity. HTTP 403 and cancelled-admission 499 share the classification. An unambiguous host admission reason reaches the live failure card; legacy replay names only host refusal. Relay status codes, HTTP body and subscription status contracts stay unchanged.

Why this shape

Recognize the relay-owned error type or fixed runtime error text before trusting Claude's authentication class. Host-only observation supplies the denial cause without changing provider history. The additive first-party class, API snapshot, wire documentation and minor changeset ship together. No admission guard or retry behavior changes.

Pi inspection: its turn-failure.ts maps 403/499 to unknown, without an auth action or subscription re-login reporting; the authentication misclassification here is Claude-specific.

Proof

  • Failing-first: the new live/replay 403/499 cases failed the intended class assertions before implementation (36 pass, 4 fail).
  • Restored focused proof: 86 tests pass across api-failure, history-api-failure, turn-units, runtime-record and inference-egress. Includes real loopback/Unix relay admission, host safety reason propagation, unchanged wire body, genuine authentication failures, and unchanged subscription failure history/no WARN.
  • Additional failing-first: the bare retained refusal replay case failed with failure: undefined (15 pass, 1 fail), then passed without inventing a status or host cause.
  • Additional failing-first: two real relay refusals with distinct causes followed by a delayed runtime error incorrectly attached the latest cause. The named turn-units case failed on the message assertion; distinct or unknown causes now retain generic host-refusal wording.
  • Mutation: disabled hostRefusal recognition; seven tests failed, including live/replay class assertions and preservation of the seeded auth history. Restored source; focused proof passes.
  • bun run build passes. NODE_OPTIONS=--max-old-space-size=16384 bun run typecheck passes (default Node heap was too small).
  • Changeset manifest and complete pending plan validate. Provider-history host-authority guard: four pass. The native capture probe exits before its receipt on both this branch and an independently installed unchanged main archive; evidence is recorded on test: offline runtime placement probe exits before producing its receipt #4005, without weakening isolation.
  • Final refreshed-base bun run check:pr --base origin/main passes all gates and all 993 selected fast tests. Earlier local runs hit temporary-storage quota errors in fixture copies; those failures are retained in the local receipts, and the final complete preflight is green. Tested head 31f205b4b1497bbbb0ccb5a487fc321a7b11209f, base eb3c53ac296808291e4aded36c9e4aa65a7e8aae.
  • Collision scan at the initial PR head found shared proof-closure collisions only, with no direct path collisions. A final exact-head scan is recorded before confirmation.
{"version":1,"kind":"brain-check-pr-receipt","head":"2e02847c184ede33fb64dd8faeae9a28275d2742","base":"origin/main","mode":"focused","startedAt":"2026-11-15T21:58:49.145Z","finishedAt":"2026-11-15T22:00:37.071Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":21211.307720999997},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":206.73712499999965},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":188.07772799999657},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":21.680571999997483},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":86275.817179}]}

Checklist

  • Complete selected hosted candidate proof passes before merge.
  • All issue acceptance criteria have focused behavioral proof.
  • PR and issue target 0.45.0.
  • Consumer-visible changeset and additive contract documentation included.
  • No personal data in the diff; lint/leakage gates pass.
  • Documentation and moved code citations updated.
  • No fail-closed guard changed; only its existing refusal reporting changes.
  • Provider history remains unchanged; host-only metadata stays outside it.

Anything left open

No implementation criteria remain. Hosted candidate proof must qualify the final head before merge. Existing #4005 holds the separate local native probe prerequisite evidence; no new follow-up issue was filed.

@schlessera schlessera added this to the 0.45.0 milestone Nov 15, 2026
@schlessera schlessera added type: fix Something is broken and must behave the way it is documented. area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. area: backends AgentBackend implementations and the seam they share. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. labels Nov 15, 2026
@schlessera

Copy link
Copy Markdown
Owner Author

Final pre-confirmation collision scan at head 4197b1a92e49f1eb69095f1985117383ca209fed: shared proof-closure collisions with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4007, #4008, #4012, #4013, #4016 and #4020; no direct path or unknown collisions. The shared integration reservation serializes candidate confirmation and landing. Final refreshed-base local preflight passed all gates and 993 fast tests.

@schlessera

Copy link
Copy Markdown
Owner Author

Refreshed confirmation candidate: head d54969c2b110e72f4cb79d6c9fa43e8c10352726, base c0bce42e7730f565cc1dac43aca4aea6eaf84675. The exact-head collision scan again reports proof-closure collisions only (with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4008, #4012, #4013, #4016, #4020 and #4021), with no direct path or unknown collisions. Both main advances merged cleanly; refreshed preflight passes all gates and 993 fast tests. The PR body contains exactly one receipt for this head.

@schlessera

Copy link
Copy Markdown
Owner Author

Fresh combined-tree candidate: head f52664e8ef061754d11da4171fbac5b5465a04d7, base c6f98e8d9d2f63d144ff82d6d1d6ff0db128547c. Exact-head collision scan: shared proof closures with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4008, #4012, #4013, #4016, #4021 and #4022; no direct path or unknown collisions. The main advance changed six disjoint CI diagnostic files. The previous passing preflight remains identified by its actual tested head/base in the receipt; confirmation is fresh for this combined tree.

@schlessera

Copy link
Copy Markdown
Owner Author

Final behavior candidate: head 104112ae8444ced3eaf99070d1c1857fa6aa6d81, base c6f98e8d9d2f63d144ff82d6d1d6ff0db128547c. The exact-head scan reports closure collisions with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4008, #4012, #4013, #4016, #4021, #4022. Non-closure reports: 0. The additional bare-text replay case was shown failing before the correction; all 86 focused tests and the final local preflight pass. The receipt records the pre-commit working tree that included this correction.

@schlessera

Copy link
Copy Markdown
Owner Author

Refreshed tested candidate: head 741a4f26ba2433d3c803a18e8e23e01ff305e50f, base 3988a9bf9aab8c3730ca8e1228a63c169d17cab8. Exact-head scan reports closure collisions with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4008, #4012, #4013, #4021, #4022; non-closure reports: 0. The documentation overlap merged cleanly, and preflight was rerun: all gates and 993 fast tests pass. The PR body now carries exactly one receipt for this immutable head.

@schlessera

Copy link
Copy Markdown
Owner Author

Fresh confirmation candidate: head 931756aca71443c652a8c8b8bc3ba857f758ad05, base 7e36fdc899408b12bb3774902a09a09c3eab146a. Exact-head collision scan reports closure, textual collisions with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4008, #4012, #4021, #4022, #4023; non-closure reports: 1. The main advance changes disjoint CI incident-reporting files. The retained passing preflight receipt keeps its actual tested head/base; candidate proof is fresh for this combined tree. Both PR and issue milestones were read back as 0.45.0.

@schlessera

Copy link
Copy Markdown
Owner Author

Refreshed tested candidate: head 42db9186f1390372f99d799d97ecd1ecce68aac4, base 388feb483751e8a7550f908de6f0a518eda03117. Exact-head collision scan reports closure, textual collisions with #3054, #3056, #3059, #3069, #3116, #3437, #3581, #3622, #3806, #4002, #4008, #4021, #4022, #4023, #4024; non-closure reports: 1. Both documentation overlaps merged cleanly, and the required preflight was rerun: all gates and 993 fast tests pass. The PR body carries exactly one receipt for this immutable head.

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

Labels

area: backends AgentBackend implementations and the seam they share. area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. type: fix Something is broken and must behave the way it is documented.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

backends: a host inference-relay refusal is reported as "Failed to authenticate" and asks for a subscription re-login

1 participant