Repository navigation
fix(opencode): preserve bounded provider failure causes #2114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
68
commits into
main
Choose a base branch
from
fix/opencode-redaction-safe-provider-envelope-2112
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 12 commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
4a5bfec
test(opencode): expose missing provider failure envelope
seonghobae a7a4f78
test(opencode): require owned telemetry quality lane
seonghobae 14f3740
fix(opencode): preserve bounded provider failure causes
seonghobae 4341566
fix(ci): pair review dispatch with exact blob pin
seonghobae 10cd412
test(opencode): follow failure envelope authority
seonghobae 187f9fc
test(opencode): reject credential-shaped failure metadata
seonghobae 0e7f7e4
fix(opencode): suppress credential-shaped failure fields
seonghobae 7f9489e
test(opencode): reject prose-spoofed failure causes
seonghobae 2b78ea6
test(opencode): reject excessively deep gateway envelopes
seonghobae 2e2d61d
test(opencode): reproduce deep gateway recursion
seonghobae fe035a8
fix(opencode): derive failure class from structured receipt
seonghobae 76194e1
test(opencode): bind causal classes to structured fields
seonghobae ab44b39
style(opencode): normalize regression test spacing
seonghobae fc13c6c
test(opencode): reject unproven identifier provenance
seonghobae a8eb135
fix(opencode): require allowlisted receipt identifiers
seonghobae d062bc1
test(opencode): require receipt identifier allowlists
seonghobae d44c8b3
test(opencode): fail closed on unproven route identities
seonghobae b383d7e
style(opencode): remove obsolete regex dependency
seonghobae ac647df
docs(opencode): state receipt provenance boundary
seonghobae f1179a4
docs(opencode): doctor unproven identity handling
seonghobae 4c96d60
docs(opencode): record identity provenance gap
seonghobae ba20074
test(opencode): reject deeply nested failure events
seonghobae ae49bc3
fix(opencode): fail closed on deeply nested events
seonghobae 5d408ce
test(opencode): reject unproven exception identities
seonghobae 6de920e
fix(opencode): suppress unproven exception identities
seonghobae 8f38a3b
fix(opencode): enforce bounded tail and JSON depth
seonghobae be1d52a
test(opencode): align bounded-tail and synthetic-secret fixtures
seonghobae 1b2b1a3
test(opencode): require structured failure causes
seonghobae 79f2ee1
test(security): scope synthetic provider token allowlist
seonghobae f537c34
fix(opencode): align bounded tail to complete JSONL events
seonghobae cc570f0
test(opencode): cover complete-line tail parsing
seonghobae e8e3ba2
refactor(opencode): remove unreachable payload check
seonghobae 442216b
test(opencode): close depth and status coverage branches
seonghobae e4a06af
fix(opencode): preserve aligned bounded tail record
seonghobae 2b0b52b
test(opencode): cover exactly aligned bounded tail
seonghobae 4e68a81
docs(opencode): carry provider failure decision forward
seonghobae 62e935f
test(opencode): reject contradictory receipt authorities
seonghobae 2e07208
fix(opencode): fail closed on contradictory receipt authority
seonghobae f4f0166
style(opencode): remove trailing test blank line
seonghobae b1f3ac2
fix(opencode): authenticate bounded failure causes
seonghobae 2a0154b
fix(security): classify OpenCode synthetic token history
seonghobae 87510bb
fix(opencode): preserve bounded successor evidence
seonghobae b450e1c
fix(security): restore exact synthetic fixture classification
seonghobae 646f3fd
test(security): bind synthetic fixture classification
seonghobae b386b47
test(security): preserve conjunctive leak classification
seonghobae c3937d0
test(opencode): fail closed across gateway body aliases
seonghobae 3df808c
fix(opencode): reconcile every gateway body authority
seonghobae 77d0263
docs(opencode): qualify control-plane references
seonghobae 8f05458
fix(security): keep synthetic-secret allowlist self-nonmatching
seonghobae 9cbc4a2
style(opencode): normalize test separation
seonghobae 69d2c15
test(security): verify leak rule stays self-nonmatching
seonghobae 009cc96
fix(opencode): preserve attempt phase within each body
seonghobae b3044ff
test(opencode): cover malformed mapping and alias paths
seonghobae 5a7f9c3
test(opencode): cover malformed gateway mapping branches
seonghobae 86863a6
test(opencode): reject malformed body authority override
seonghobae 3c43dd1
fix(opencode): keep malformed gateway cause fail-closed
seonghobae 07af79a
test(opencode): reject present malformed body aliases
seonghobae f163887
fix(opencode): distinguish missing and null body aliases
seonghobae 8f1d645
test(opencode): cover present malformed body aliases
seonghobae 6faee54
test(opencode): keep regression in canonical suite
seonghobae 646315a
fix(security): anchor OpenCode synthetic token allowlist
seonghobae bb183e4
fix(security): scope synthetic allowlist to exact secret
seonghobae af6de73
test(opencode): reproduce reviewed failure-envelope authority gaps
seonghobae 5fb9c98
fix(opencode): preserve protocol layers in failure authority
seonghobae f506694
test(opencode): bind reviewed authority repairs to owner suite
seonghobae e7c58c0
test(opencode): retire duplicate review regression file
seonghobae a32d9fa
merge(main): resolve #2114 conflicts; keep provider-failure envelope
seonghobae 58fed57
test(strix): materialize evidence binder in gate fixtures
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # OpenCode provider-failure envelope | ||
|
|
||
| ## Problem and exact evidence | ||
|
|
||
| On 2026-09-12, `.github` PR | ||
| [`#2106`](https://github.com/ContextualWisdomLab/.github/pull/2106) at exact | ||
| head `24bb6591ab7df23558cb793b4af60c567ff9da97` reached the single required | ||
| `contextual-orchestrator/orchestrator/free` model route in OpenCode run | ||
| [`34693400612`](https://github.com/ContextualWisdomLab/.github/actions/runs/34693400612). | ||
| The request failed after the sidecar and route preflight had succeeded, but the | ||
| only surviving causal evidence was `class=provider-error`, two byte counts, | ||
| and a statement that provider content was suppressed. That was enough to keep | ||
| the review fail-closed, but not enough to distinguish queue admission, HTTP | ||
| 429/5xx, request size, malformed JSON, route exhaustion, or missing serving | ||
| identity. Issue | ||
| [`#2112`](https://github.com/ContextualWisdomLab/.github/issues/2112) owns the | ||
| repair. | ||
|
|
||
| ## Constraints | ||
|
|
||
| - OpenCode, Noema, and Strix keep the single `orchestrator/free` gateway route; | ||
| no provider/model/group override or paid fallback is introduced. | ||
| - Telemetry is diagnostic only. It cannot produce approval, clean evidence, a | ||
| retry, a timeout, or a merge bypass. | ||
| - Provider-controlled messages, bodies, prompts, credentials, headers, source | ||
| text, and arbitrary nested payloads never reach stdout, status text, or | ||
| annotations. | ||
| - Values that survive are bounded scalar identifiers or validated HTTP status | ||
| numbers. Missing or invalid fields are explicit `unknown` values. | ||
|
|
||
| ## Alternatives and decision | ||
|
|
||
| Keeping the previous byte-count-only line was rejected because it preserves | ||
| secrecy at the cost of causal attribution. Printing the raw OpenCode event or | ||
| gateway response was rejected because public `pull_request_target` logs cannot | ||
| safely carry provider-controlled text. Adding caller-side retries or an | ||
| elapsed-time diagnosis was rejected because the gateway owns routing and the | ||
| observed five-second failure did not prove a timeout. | ||
|
|
||
| The selected design adds a small standard-library parser at the OpenCode | ||
| adapter boundary. It reads at most 65,537 bytes from each failure artifact and | ||
| accepts only an OpenCode `type=error` event. From the gateway response it reads | ||
| only the canonical `error.detail`/`error_detail` receipt and its last bounded | ||
| attempt. The emitted line preserves class, phase, normalized reason, provider, | ||
| HTTP status, exception class, elapsed seconds, served model, and artifact byte | ||
| counts. Malformed JSON and malformed Unicode fail closed to bounded metadata. | ||
|
|
||
| ## Executable evidence, risks, and effects | ||
|
|
||
| The production launcher fixtures cover HTTP 429/queue capacity, provider 503, | ||
| non-JSON response bodies, HTTP 413 request admission, no eligible route, absent | ||
| served-model metadata, and secret-bearing ignored fields. Unit tests cover all | ||
| parser statements and branches, and the consolidated runtime-quality workflow | ||
| selects this suite whenever the launcher, parser, fixture, or this authority | ||
| record changes. | ||
|
|
||
| The remaining risk is semantic drift in the gateway receipt. Unknown fields | ||
| are deliberately not guessed or copied; a future versioned schema change must | ||
| add a failing fixture before extending the allowlist. Operators can now route a | ||
| 429/queue failure to capacity policy, a 5xx to the gateway/provider boundary, | ||
| a 413 to request admission, and malformed JSON to the response adapter without | ||
| reading secret-bearing bodies. Until exact-head hosted checks, independent | ||
| review, protected-main integration, and an unchanged-head replay of #2106 are | ||
| complete, this repair remains Proposed rather than released evidence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.