You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenSecret: standard Flash circuits and safe inference diagnostics - #973
GLM 5.3 Flash now follows the standard Router V2 route-health and capacity gates, so repeated timeouts, transport failures and stream failures can steer later requests to another eligible provider. Auto model selection uses the same availability policy. Healthy weights, V1 routing and the no-replay boundary stay unchanged.
Upstream HTTP errors now carry bounded diagnostics into the correlated attempt warning: an 8 KiB / 100 ms reader emits only recognized codes, types and fixed summaries. Raw provider messages and echoed customer content never enter the diagnostic record. Cancellation during that read preserves the already-known status, retry hint and probe outcome. V2 alternate Auto and sticky/fallback provider decisions also emit correlated INFO records for the route that won the send-time claim.
Validation: format check, Clippy with warnings denied, and the locked all-features test suite (701 passed, 23 intentionally ignored). Added coverage for both provider directions, Auto availability, failure thresholds and recovery, diagnostic privacy/resource bounds, and cancellation after error headers. Independent source review completed. Live providers, authenticated deployed flows and EIF/release validation remain for the release-testing stage.
Reviewed 41fbc3ce against d5f359e7 (master including #968) from an isolated detached checkout.
Verdict: approve. No P0, P1, or P2. Both issues' acceptance criteria are met, and the subtle part of the change, cancellation during the diagnostic read, is handled and tested.
FailoverPolicy is removed rather than special-cased: available_providers_for_model uses the effective snapshot for every model, and try_claim_probe_locked always includes the route-health gate, so selection and the send-time claim agree. Auto model availability consumes the same function, so the Auto path needs no separate change.
Replacement tests cover both provider directions, all four route-health failure kinds, the three-failure threshold, half-open recovery through a single fenced probe, a failed probe reopening the circuit, neutral 400 and consumer-drop outcomes, success resetting the streak, and V1 independence. The capacity-gate and V1 Flash tests the issue asked to preserve are still present. Healthy weights and the 30% Continuum split are unchanged; the routing policy version bump is appropriate.
The reader is a genuinely lossy boundary: only static allowlisted labels and fixed summaries can leave it, message text is matched by anchored prefix and never copied, unknown values are suppressed, and the Debug output therefore cannot carry control characters or echoed content. Read is bounded to 8 KiB and 100 ms total with a yield against always-ready streams; reaching the byte bound is treated as truncated without parsing the prefix; dropping the future drops the owned stream. Both transport variants share one path.
Status, Retry-After, capacity classification, the public error shape, and route-health signals are unchanged; the diagnostic only travels into the correlated attempt warning. No retry or replay is introduced.
Cancellation after error headers now records the already-known upstream failure instead of a neutral consumer-drop, and a held probe lease resolves with it. The test drops the future mid-read for 429/503/529 with and without a recovery lease and asserts exactly one terminal, the retained status and hint, and a still-fenced route.
Routing INFO record
Fires only for non-primary Auto reasons and sticky or fallback routes, after the claim, keyed by request, execution, and attempt ids, with no account identifier. This closes the observability gap noted on opensecret: health-aware Auto model selection for Router V2 #968.
Notes, none blocking
The observation guard's drop still logs "Inference attempt abandoned before terminal processing" when it has just recorded a known provider failure; the wording now overstates what happened.
The decision-time line that listed the rejected candidates and their retry hints moved to debug, so INFO shows that an alternate ran but not why the preferred model lost. Consider carrying a compact rejected summary on the new INFO record.
In a Responses tool loop the INFO record repeats once per model turn for a sticky or fallback route. Bounded and joinable, just worth knowing for volume.
Every failing provider response now waits up to 100 ms for diagnostics before the error is returned and the circuit observes it. Bounded and documented; noted only as a deliberate latency trade.
Validation executed at 41fbc3ce, pinned Nix shell with stateful hooks disabled: cargo fmt --all -- --check clean; RUSTFLAGS='-D warnings' cargo clippy --locked --all-targets --all-features -- -D warnings clean; RUSTFLAGS='-D warnings' cargo test --locked --all-features: 701 passed, 0 failed, 23 ignored (the pre-existing database and live-provider suites). Checkout stayed clean. At my last read, the Nix checks and application package job had passed and the backend format/lint/test and SDK integration jobs were still running.
Not exercised: live provider error bodies, deployed flows, and EIF/PCR evidence, consistent with the PR's own scope statement.
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
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.
GLM 5.3 Flash now follows the standard Router V2 route-health and capacity gates, so repeated timeouts, transport failures and stream failures can steer later requests to another eligible provider. Auto model selection uses the same availability policy. Healthy weights, V1 routing and the no-replay boundary stay unchanged.
Upstream HTTP errors now carry bounded diagnostics into the correlated attempt warning: an 8 KiB / 100 ms reader emits only recognized codes, types and fixed summaries. Raw provider messages and echoed customer content never enter the diagnostic record. Cancellation during that read preserves the already-known status, retry hint and probe outcome. V2 alternate Auto and sticky/fallback provider decisions also emit correlated INFO records for the route that won the send-time claim.
Validation: format check, Clippy with warnings denied, and the locked all-features test suite (701 passed, 23 intentionally ignored). Added coverage for both provider directions, Auto availability, failure thresholds and recovery, diagnostic privacy/resource bounds, and cancellation after error headers. Independent source review completed. Live providers, authenticated deployed flows and EIF/release validation remain for the release-testing stage.
Fixes #970
Fixes #971