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
Should a provider session open that never answers get an automatic deadline?
#15932
If a provider never answers while its session is opening, the run stays on "Working" forever. There's no error, and nothing settles it. Since #14201, Stop shows up while a run is starting, so a user who notices can get out. A user who doesn't notice, or isn't watching, comes back to a thread that's still spinning.
Evidence from main
I reproduced it on main (14fe0158ed, October 7) with a fake Grok CLI. It forwards to the repo's ACP mock agent (apps/server/scripts/acp-mock-agent.ts) but never answers session/new. After sending a message, the run stays starting until someone presses Stop. On October 3 the same setup was still starting after 7 minutes 46 seconds. In the server, ProviderTurnStartService waits on providerSessions.open with no deadline. #14183 settles the run only when the open fails with an error, and the outbox lease is deliberately never reclaimed (FoundationPersistence.test.ts).
fix(server): a stuck provider call no longer freezes its thread until restart #14208: added a 5-minute deadline on session open, thread load and turn handoff, failed on the first timeout, and added a 15-minute backstop on every outbox effect. Julius closed it. The maintainer direction covers settling terminal startup failures, but not those deadline, retry and scope choices, which need agreement first.
Proposal
#15931 adds one deadline, around providerSessions.open only, and nothing else. When it fires, the run fails through the path #14183 already uses, with the message "The provider didn't finish starting within 2 minutes." Thread load, turn start, compaction, other outbox effects, the lease and retry counts are all unchanged.
What the deadline covers depends on the adapter. For Codex, Claude, Cursor and Pi, openSession only starts the process or builds runtime state, and the slow work happens later in ensureThread or startTurn. For Grok and other ACP providers, it includes initialize, authentication, MCP setup and session load or resume. For ACP registry providers and Antigravity, it also includes installing the provider the first time it's used, which today gets up to 20 minutes. A test with a valid download that takes 130 seconds shows a 2-minute deadline cancels that install. OpenCode's slow /compact runs later through startTurn, so the deadline doesn't touch it.
Questions for maintainers
Do you want an automatic deadline at all, or is Stop enough?
Is 2 minutes right?
Retries: the PR keeps today's behavior, so a timed-out open is retried like any other failed open. The effect worker allows up to 5 attempts, so a provider that never answers could take about 10 minutes to fail. fix(server): a stuck provider call no longer freezes its thread until restart #14208 failed on the first timeout instead. Which do you prefer?
Should a timeout keep the existing "Provider session failed to open" error, or get its own state?
Should first-run installation count toward the deadline? If not, the deadline could start after install, or apply only to the handshake.
Related: #15571 (merged) closes the provider session when its open is interrupted, and that includes this deadline. With it, a timed-out attempt's provider process exits, so retries don't pile up processes. An earlier version of this post said #15931 depended on #15923, which #15571 replaced.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The problem
If a provider never answers while its session is opening, the run stays on "Working" forever. There's no error, and nothing settles it. Since #14201, Stop shows up while a run is starting, so a user who notices can get out. A user who doesn't notice, or isn't watching, comes back to a thread that's still spinning.
Evidence from main
I reproduced it on
main(14fe0158ed, October 7) with a fake Grok CLI. It forwards to the repo's ACP mock agent (apps/server/scripts/acp-mock-agent.ts) but never answerssession/new. After sending a message, the run staysstartinguntil someone presses Stop. On October 3 the same setup was stillstartingafter 7 minutes 46 seconds. In the server,ProviderTurnStartServicewaits onproviderSessions.openwith no deadline. #14183 settles the run only when the open fails with an error, and the outbox lease is deliberately never reclaimed (FoundationPersistence.test.ts).History
startingforever afterprovider-turn.startexhausts its retries — no Stop button, settle refused, only Delete clears it (Pi provider, desktop) #13392: a run stuck while starting, with no Stop button.Proposal
#15931 adds one deadline, around
providerSessions.openonly, and nothing else. When it fires, the run fails through the path #14183 already uses, with the message "The provider didn't finish starting within 2 minutes." Thread load, turn start, compaction, other outbox effects, the lease and retry counts are all unchanged.What the deadline covers depends on the adapter. For Codex, Claude, Cursor and Pi,
openSessiononly starts the process or builds runtime state, and the slow work happens later inensureThreadorstartTurn. For Grok and other ACP providers, it includes initialize, authentication, MCP setup and session load or resume. For ACP registry providers and Antigravity, it also includes installing the provider the first time it's used, which today gets up to 20 minutes. A test with a valid download that takes 130 seconds shows a 2-minute deadline cancels that install. OpenCode's slow/compactruns later throughstartTurn, so the deadline doesn't touch it.Questions for maintainers
Related: #15571 (merged) closes the provider session when its open is interrupted, and that includes this deadline. With it, a timed-out attempt's provider process exits, so retries don't pile up processes. An earlier version of this post said #15931 depended on #15923, which #15571 replaced.
All reactions