Repository navigation
fix: expose safe composer prediction diagnostics - #437
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related: #418
What Problem This Solves
An enabled composer can quickly return
{"text":null}when inference is skipped, a provider request fails, or output is rejected. These distinct outcomes were indistinguishable in browser developer tools and had no safe terminal log. Increasing the timeout cannot diagnose a response that finishes in about one second.Why This Change Was Made
The admin HTTP plugin now records a fixed reason at the inference/admission boundary. The authenticated Web BFF adds its elapsed time and reports the same diagnostic fields in one terminal log. Numeric
providerStatusis included only for an unsuccessful provider HTTP response; raw provider bodies and exception messages remain excluded.The BFF keeps the final transcript/Space ACL recheck before publishing or logging the outcome. A single terminal latch prevents timeout, disconnect, and late completion from producing contradictory or duplicate records. Incoming diagnostic strings are allowlisted; arbitrary fields never reach the log. Existing prediction text remains usable during rolling Gateway updates, with an explicit
diagnostics_unavailablereason when the producer does not supply a recognized code.User Impact
In browser developer tools, open Network before sending a new chat message, filter
composer-predictions, select Payloadaction: "predict", then inspect Response. A skipped prediction can now report:{"text":null,"reason":"model_busy","elapsedMs":1180}This is an example, not a diagnosis of the reported deployment.
model_busydescribes the Gateway's ordinary-call tracking, not measured GPU utilization. Provider failures instead show a code such asprovider_http_errorand a numericproviderStatus.The deployment needs the updated Web ingress and Gateway. No new configuration or environment variable is required. Browser presentation, server/account defaults, model selection, private-address/DNS pinning, no-retry policy, ordinary-call priority, timeout budgets, and context/output limits stay the same. Logs contain no conversation text, user/session identifiers, destination URLs, credentials, or raw errors.
Evidence
--mode uncommitted --engine codex): exit 0, no accepted/actionable P0 findings. TruffleHog passed. The sparse review copy's full-index patch and all five changed file hashes match the implementation checkout.text:nullis not claimed to be fixed or attributed to a specific provider failure; this patch exposes the missing diagnostic facts.Production delta: +190/-56 lines (net +134), justified by observable fixed outcomes, the HTTP diagnostic contract, and safe single-terminal logging. Tests: +338/-41 (net +297); docs: +38. Three additive HTTP diagnostic fields (
reason,elapsedMs, optionalproviderStatus); zero new config/env/dependency/storage/version surfaces. Codex review isolation flags were checked directly in siblingcodex-rs/exec/src/cli.rs:36.Named follow-ups, not asserted causes of the incident:
src/agents/embedded-agent-runner/run/attempt.model-diagnostic-events.ts:525,src/hooks/fire-and-forget.ts:154). Investigate the authoritative lifecycle owner before changing admission semantics; this patch only reports the current tracking decision.openai-completionsfor a base-URL-only provider (src/agents/embedded-agent-runner/model.configured-overrides.ts:81); Composer currently requires an explicit supported adapter. Verify intent and the actualunsupported_apidiagnostic before changing that policy.