GeezerVison is showing github.com — fix(core): #1014 runner policy — step.ts failover gates (retry/outputStarted) and credential-switch proximity order · Issue #1379 · developing-today-forks/opencode
fix(core): #1014 runner policy — step.ts failover gates (retry/outputStarted) and credential-switch proximity order #1379Labels expediteImportant - do this very soon, before anything not expeditedpriority/highImportant and time-sensitive DescriptionFollow-up implementation issue for #1014 (routed by triage task 6187, 2026-11-02; the umbrella #1014 stays open and tracks the full set — this issue owns only the runner-policy items below, ported from it, not a re-file of the umbrella).
Items (from #1014 gap analysis comment 6562786500, items 2–3, and PR #1364 "Still owed")
- step.ts failover gates: in
packages/core/src/session/runner/step.ts, route-failure failover is gated on retry?.retry and !outputStarted (verified on main 52ac2c2 at ~527–541: failover requires routing && !recorded.outputStarted && routeFailure, and retry?.retry === true). A quota failure after output started, or one the retry hook declines, never cascades even with eligible candidates remaining.
- Credential-switch proximity deviation: step.ts ~552–569 caps the credential switch at one per provider per assistant message (
credentialSwitchUsed, defined ~194), so a second quota failure on the switched credential falls to a different target instead of the next credential on the same provider. Drew's order is: credential → leaf → sibling plan → next route.
Acceptance
Activitydezren39 commented on Nov 2, 2026 Picked up by the OpenChamber scheduled lane as queue task 6191. Fresh GitHub check: #1379 is open; #1364 is merged and is scope context only; no open PR for #1379 was found. Next: reproduce the two step.ts policy gaps and implement the scoped runner-policy tests.
dezren39 commented on Nov 2, 2026 PR #1392 opened (head 5571ec0) and queue task 6191 parked pending review.
The implementation was already drafted in the laptop worktree (fleet/task-6191); this shift finished it: merged current main into the branch (conflicts with PR #1384's step.ts changes resolved — #1384's outer failover wrapper retained, the ungated inner condition and proximity credential walk kept; the test file was reconstructed as main's version plus this task's 3 new tests), updated the session-runner scenario that pinned the old one-switch cap to the new proximity walk, and verified: session-step 34/34, session-runner 241/241, model-resolver + model-route + session-runner-model 181/181, typecheck clean, pre-push pass. Codex review requested on the PR; task resumes on review landing.
dezren39 commented on Nov 2, 2026 Update from queue task 6191: PR #1392 was behind main and Codex had one unresolved P2 on head 5571ec0 (credentialFallback could cycle between credentials whose short cooldowns expire mid-chain). Fixed on the laptop worktree: merged current main (incl. PR #1393) and added a chain-local attempted-credential set in model-resolver.ts (commit 3e0f57d); the finding thread is answered with the disposition. Tests: model-resolver + session-step 108 pass, session-runner + session-step-failure + model-route 358 pass, tsgo clean. PR is MERGEABLE/CLEAN, 0 behind; @codex review requested on the new head. Task 6191 parked pending that re-review.
chatgpt-codex-connector commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026 Merged: PR #1392 landed with merge commit abe4e5b (2026-11-02T14:57:54Z), closing this issue. Codex review clean on head 3e0f57d (codex-review-state:v1: completed 2026-11-02T14:25:44Z, has_unresolved_findings=false; receipt: no major issues); CodeRabbit check passed with no actionable comments. The earlier Codex P2 on credentialFallback cycling was fixed in 3e0f57d (chain-local attempted set) and its thread answered. At merge the branch was 2 commits behind main — only the PR #1378 deps merge (bun.lock + packages/util/package.json), disjoint from this PR's files — and MERGEABLE/CLEAN was verified twice. Tests recorded on the queue checkpoint: session-step 34/34, session-runner 241/241, model-resolver/model-route batches, tsgo and pre-push pass. Queue task 6191 completed as fixed_merged.
MetadataMetadataexpediteImportant - do this very soon, before anything not expeditedpriority/highImportant and time-sensitive DevelopmentNo branches or pull requestsIssue actions
|