mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
After a server restart every suspended session and recovered subagent resumed at once (concurrency unbounded), so ~40 turns hit their first model request together and froze the host. Resumes now go through a Semaphore (Options.maxConcurrentResumes, default 3). The permit is taken on the sweep fiber before the attempt is counted, and held until the resumed turn's first step ends or fails (session.step.ended / session.step.failed, subscribed before the turn starts), the turn ends, or 60 seconds pass. It is never released just because the resume fiber was forked. - Shell notices first, then settled subagent results, then running subagent children through the gate, then suspended sessions most recently updated first (listSuspended now orders by time_updated desc). - countResume and the 'Continuing after restart' synthetic run inside the slot, so queued sessions are not charged an attempt until they start. Ownership (local job, child/parent existence, active execution, claim) is re-checked at admission. - Each session leaves the early-notice set as soon as its own resume is accounted for, so a parent that already resumed and went idle is still woken by a child result while older sessions wait in line. - resumeSuspendedSessions completes once every resume has started rather than right away. Existing tests assert accounting as soon as it returns, and every caller already forks it. Attempt budget and shell recovery are unchanged. |
||
|---|---|---|
| .. | ||
| ai | ||
| app | ||
| cli | ||
| client | ||
| codemode | ||
| console | ||
| containers | ||
| core | ||
| desktop | ||
| effect-drizzle-sqlite | ||
| function | ||
| gui-extensions | ||
| http-recorder | ||
| httpapi-codegen | ||
| identity | ||
| latex | ||
| merman | ||
| plugin | ||
| plugin-browser | ||
| plugins | ||
| posts | ||
| protocol | ||
| schema | ||
| script | ||
| sdk | ||
| server | ||
| session-ui | ||
| simulation | ||
| stats | ||
| storybook | ||
| theme | ||
| tui | ||
| ui | ||
| util | ||
| web | ||