[codex] Protect long-running agent goal streams#5772
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
b932751 to
8c39f6f
Compare
|
Rebased this stacked PR onto the updated #5767 branch, so it now includes the new |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…t-goal-resilience-pr # Conflicts: # src/app/api/v1/chat/completions/route.ts
…y opt-out The /goal detector's stream-recovery override was fail-open: it could re-enable recovery even when an operator explicitly turned it off via STREAM_RECOVERY_ENABLED or a DB/settings override. Make it fail-closed — the goal-policy heuristic may only fill in recovery when nothing is explicitly configured, and now logs when it does. Also add OMNIROUTE_AGENT_GOAL_POLICY_ENABLED (default true) as a full kill-switch for the heuristic to mitigate client-controlled timeout amplification. Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
…t-goal-resilience-pr Resolve conflicts against release/v3.8.43 (which now contains diegosouzapw#5767): preserve the agentGoalPolicy Math.max readiness-timeout guard and the OMNIROUTE_AGENT_GOAL_* env docs/example blocks, keep release's version of everything already delivered by diegosouzapw#5767. Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
f6100d6
into
diegosouzapw:release/v3.8.43
|
Thanks @nguyenxvotanminh3! Merged into release/v3.8.43 on top of #5767. We hardened it together: goal detection can no longer override an operator's explicit stream-recovery opt-out (fail-closed) and the whole heuristic is now toggleable via |
Summary
/goalrequests from nested chat bodies orx-omniroute-agent-goal: true.env.exampleWhy
Claude/Codex-style agent goal runs can spend a long time planning or waiting for tool-call orchestration before the first stream token. The normal readiness budget and recovery defaults are tuned for ordinary chat, so these long-running runs can look stalled or fail on a truncated opening stream. This keeps the special handling scoped to explicit
/goaltraffic and avoids changing normal chat behavior.Stack note
This PR is stacked on #5767 (
codex/performance-streaming-readiness). Until #5767 lands, GitHub will show that commit in this diff too. The new commit for this PR isProtect long-running agent goal streams.Safety
Validation
git diff --checknode --import tsx/esm --test tests/unit/agent-goal-policy.test.ts tests/integration/stream-recovery-wiring.test.ts tests/unit/runtime-timeouts.test.ts tests/unit/stream-readiness-policy.test.tsnpm run typecheck:corenpx eslint open-sse/utils/agentGoalPolicy.ts open-sse/handlers/chatCore.ts tests/unit/agent-goal-policy.test.ts tests/integration/stream-recovery-wiring.test.ts