feat(engine,llm): add codex app-server provider wiring and routing autonomy#53
Conversation
(cherry picked from commit c0110c630859508ce3390cf976cd11e8a06fbb6b)
(cherry picked from commit 1a57a2ca640d65457fa663e9548d41c9be22ab53)
(cherry picked from commit 23f3ce1e2329597b204b530bc23b1f817b5266c2)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fda33cada
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| func (t *stdioTransport) handleUnexpectedProcessTermination(err error) { | ||
| t.rejectAllPending(err) |
There was a problem hiding this comment.
Fail active turns when app-server exits unexpectedly
handleUnexpectedProcessTermination only rejects pending RPC requests, but after turn/start returns both runTurn and Stream are waiting on completion notifications, not a pending request. If the codex child process dies in that window (and RequestTimeout is left at the default 0), nothing wakes those waiters, so Complete/Stream can block until an external context cancellation instead of failing immediately. Propagate unexpected process exit to active turn listeners (or cancel in-flight turn contexts) so calls fail fast.
Useful? React with 👍 / 👎.
| info.Status = asInt(statusVal, 0) | ||
| info.HasStatus = true | ||
| } else if statusVal, ok := root["status"]; ok { | ||
| info.Status = asInt(statusVal, 0) | ||
| info.HasStatus = true |
There was a problem hiding this comment.
Ignore non-numeric status when classifying codex errors
This marks HasStatus=true even when status is a symbolic string (for example turn lifecycle values like "failed"), because asInt falls back to 0. mapCodexError then short-circuits to ErrorFromHTTPStatus(..., 0, ...) and skips the code/message classification path, which can misclassify real request/auth/rate-limit failures as unknown status-0 errors (often retryable). Only set HasStatus when parsing yields a valid HTTP-like numeric status.
Useful? React with 👍 / 👎.
|
Follow-up (clean formatting): addressed Codex review findings in commit 6be757a.
Validation run: go test ./internal/llm/providers/codexappserver -count=1. |
Summary
This PR introduces first-class codex app-server provider support in runtime and preflight, and hardens routing behavior for API-mode agent execution.
Problem
Why This Change
The engine should treat codex app-server as an explicit provider contract, not an implicit special case. This keeps provider behavior deterministic and reviewable.
What Changed
User-Visible Behavior
Risk
Validation
gofmtandgo vet ./...go test ./internal/llm/providers/codexappserver -count=1go test ./internal/providerspec -run TestBuiltinCodexAppServerDefaults -count=1go test ./internal/attractor/engine -run 'TestRunWithConfig_PreflightCodexAppServer|TestCLIOnlyModelOverride|TestAgentLoopProviderOptions' -count=1Out of Scope