opencode/packages/core/test
Kit Langton 2f0dd2ebc5 fix(core): bound concurrent session resumes after restart
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.
2026-10-25 05:23:11 -07:00
..
codemode fix(codemode): drop the parameter name from rendered signatures (#50435) 2026-09-21 16:44:46 -05:00
config feat(core): merge Console config as a config layer (#57703) 2026-10-25 11:04:41 +01:00
effect feat(core): archive projects whose directories are gone (#54354) 2026-10-10 21:11:05 -04:00
filesystem chore(ci): speed up and stabilize the test workflow (#55866) 2026-10-16 00:35:49 +02:00
fixture perf(core): cache git discovery in Project.resolve by metadata fingerprint (#58616) 2026-10-24 14:34:07 -07:00
fixtures/recordings/session-runner feat(core): let subagents pick a model and expose models tool (#49194) 2026-09-16 01:16:55 -05:00
github-copilot fix(core): accept interleaved Copilot reasoning_opaque values (#54201) 2026-10-09 16:45:57 -05:00
instructions fix(core): drop session ID and order instructions for prompt-cache reuse (#51960) 2026-09-28 19:29:28 -05:00
lib test(core): bound advance by real time instead of steps (#57119) 2026-10-19 16:08:14 +00:00
modal refactor(core): refactor model resolving logic, fix missing variant logic (#48943) 2026-09-14 18:29:34 -05:00
plugin feat(core): merge Console config as a config layer (#57703) 2026-10-25 11:04:41 +01:00
process chore(ci): speed up and stabilize the test workflow (#55866) 2026-10-16 00:35:49 +02:00
pty feat(server): add client MCP websocket endpoint (experimental) (#57505) 2026-10-22 15:56:44 -04:00
shell-scan fix(core): make the portable PowerShell scanner sound against real pwsh (#53404) 2026-10-05 14:07:15 -07:00
skill fix(core): send only changed entries in instruction updates (#57626) 2026-10-20 23:09:10 -05:00
util refactor(core): resolve real git binary once on macOS (#58602) 2026-10-23 21:11:12 -07:00
agent.test.ts feat(core): stop asking for external directory access by default (#53585) 2026-10-06 15:52:23 -04:00
aisdk-native.test.ts fix(core): load and spell reasoning for every native provider package (#55789) 2026-10-15 15:34:08 -05:00
aisdk.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
app.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
browser-idle.test.ts fix(core): keep locations with running sessions or background jobs (#57416) 2026-10-20 11:36:08 -04:00
bus-session-routing.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
bus.test.ts refactor: v2.1 minor breaking changes (#57260) 2026-10-20 00:42:13 -05:00
catalog.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
codemode.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
command.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
credential.test.ts refactor: v2.1 minor breaking changes (#57260) 2026-10-20 00:42:13 -05:00
database-drizzle.test.ts chore(core): redact params in database query errors (#55621) 2026-10-15 01:04:07 -05:00
database-migration.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
database.test.ts fix(core): restrict database files to their owner (#52150) 2026-09-29 14:18:40 -05:00
effect-app-node-platform.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
effect-simplification-types.test.ts chore: enforce effect simplifications (#43979) 2026-08-21 19:48:27 +00:00
environment.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
event-logger.test.ts refactor(core): split provider and model registries (#48901) 2026-09-14 10:34:11 -04:00
file-access-path.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
file-access.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
file-mutation.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
form.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
formatter.test.ts fix(core): merge formatter config across files (#52739) 2026-10-02 17:49:12 +05:30
generate.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
git.test.ts perf(core): cache git discovery in Project.resolve by metadata fingerprint (#58616) 2026-10-24 14:34:07 -07:00
instance-vanilla.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
instruction-discovery.test.ts fix(core): match absolute instruction globs across directories (#58749) 2026-10-24 12:42:49 -05:00
instruction-state.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
integration.test.ts refactor: v2.1 minor breaking changes (#57260) 2026-10-20 00:42:13 -05:00
job.test.ts refactor(core): require job ids from their subject (#52806) 2026-10-02 18:27:13 +00:00
kv.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
location-activity.test.ts feat(core): add experimental.location_idle_timeout (#57476) 2026-10-20 15:27:03 -05:00
location-filesystem.test.ts feat(session-ui): deterministic timeline file link detection and resolution (#53641) 2026-10-09 02:50:00 +00:00
location-layer.test.ts feat(core): add experimental.location_idle_timeout (#57476) 2026-10-20 15:27:03 -05:00
location.test.ts feat(core): archive projects whose directories are gone (#54354) 2026-10-10 21:11:05 -04:00
logging.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
mcp-attach.test.ts feat(core): add MCP transport over incoming client sockets (#57502) 2026-10-22 14:58:39 -04:00
mcp-import-boundary.test.ts perf(core): load MCP client lazily (#42468) 2026-08-13 22:48:09 -04:00
mcp-instructions.test.ts fix(core): send only changed entries in instruction updates (#57626) 2026-10-20 23:09:10 -05:00
mcp-oauth.test.ts fix(core): keep MCP OAuth login waiting after stray callback requests (#58342) 2026-10-22 23:37:08 -05:00
mcp-socket-client.test.ts feat(core): add MCP transport over incoming client sockets (#57502) 2026-10-22 14:58:39 -04:00
mcp.test.ts feat(core): expose MCP server title from serverInfo (#58950) 2026-10-25 11:02:29 +00:00
model-free.test.ts feat(core): add OPENCODE_DISABLE_FREE_MODELS to hide free models (#57478) 2026-10-20 22:18:42 -04:00
model-plugins.test.ts refactor(core): split provider and model registries (#48901) 2026-09-14 10:34:11 -04:00
model-resolver.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
model.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
models.test.ts fix(core): revalidate the models.dev catalog with its ETag (#58813) 2026-10-24 23:34:27 -05:00
network-guard.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
npm-config.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
npm.test.ts chore: enable noUnusedLocals in ai and core (#52858) 2026-10-02 22:45:27 +00:00
oauth-page.test.ts feat(oauth): unify OAuth callback browser pages (#34025) 2026-06-26 00:36:40 -05:00
patch.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
permission.test.ts refactor(core): avoid redundant decode and re-branding in session inbox and projector (#57890) 2026-10-21 15:38:18 -05:00
persistent-pty-daemon.test.ts refactor(core): tighten worktree strategy and pty schemas and decode overlay once (#57950) 2026-10-21 20:57:46 -05:00
plugin-failure.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
plugin.test.ts feat(plugin): expose credential.activate to server plugins (#52797) 2026-10-12 23:29:22 -05:00
preload.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
preload.ts test(core): disable npm audits in the test preload (#47170) 2026-09-03 19:52:18 -05:00
project.test.ts perf(core): cache git discovery in Project.resolve by metadata fingerprint (#58616) 2026-10-24 14:34:07 -07:00
provider.test.ts chore(ci): speed up and stabilize the test workflow (#55866) 2026-10-16 00:35:49 +02:00
reference-instructions.test.ts fix(core): send only changed entries in instruction updates (#57626) 2026-10-20 23:09:10 -05:00
reference.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
repository-cache.test.ts chore(ci): speed up and stabilize the test workflow (#55866) 2026-10-16 00:35:49 +02:00
repository.test.ts fix(core): reject relative path segments in repository hosts (#51577) 2026-09-28 10:14:35 +05:30
ripgrep.test.ts fix(core): exclude hidden glob matches before limiting results 2026-09-09 09:41:07 -04:00
rpc-handler-errors.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-activation.test.ts chore(ci): speed up and stabilize the test workflow (#55866) 2026-10-16 00:35:49 +02:00
session-archive.test.ts feat(core): restore session archiving (#53759) 2026-10-19 03:46:54 +00:00
session-checkpoint-transport.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-compact.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-compaction-transport.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-compaction.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-create.test.ts perf(core): cache git discovery in Project.resolve by metadata fingerprint (#58616) 2026-10-24 14:34:07 -07:00
session-diff.test.ts fix(tui): include provider latency in TPS 2026-09-17 10:40:12 -04:00
session-environment.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-error.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-execution.test.ts fix(core): bound concurrent session resumes after restart 2026-10-25 05:23:11 -07:00
session-generate.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-instructions.test.ts refactor: v2.1 minor breaking changes (#57260) 2026-10-20 00:42:13 -05:00
session-list.test.ts refactor(core): page session lists in core (#56243) 2026-10-16 23:11:22 -05:00
session-log.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-model-request-hooks.test.ts fix(ai): preserve text and reasoning after the finish reason (#58851) 2026-10-24 22:54:39 -05:00
session-model-request.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-model-transport-live.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-model-transport.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-move.test.ts fix(core): treat unreadable config file references as empty (#55959) 2026-10-16 01:12:37 -05:00
session-native-compaction.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-native.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-owned.test.ts fix(tui): include provider latency in TPS 2026-09-17 10:40:12 -04:00
session-projector.test.ts refactor(core): keep Go allowance out of messages and sessions (#58765) 2026-10-24 13:05:02 -05:00
session-prompt.test.ts fix(server): return 404 when a location folder is missing (#52668) 2026-10-02 23:43:56 -05:00
session-remove.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-revert.test.ts fix(tui): include provider latency in TPS 2026-09-17 10:40:12 -04:00
session-run-coordinator.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-runner-message.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-runner-recorded.test.ts feat(core): append model identity to system prompts via plugin (#49129) 2026-09-15 11:46:07 -05:00
session-runner-retry.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-runner-tool-events.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-runner.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-shell.test.ts chore(ci): speed up and stabilize the test workflow (#55866) 2026-10-16 00:35:49 +02:00
session-skill.test.ts feat(core): enforce skill integration policies 2026-10-07 15:39:27 -05:00
session-sql.types.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-stats.test.ts fix(core): match versioned usage event type in stats (#48997) 2026-09-14 20:30:13 +05:30
session-step.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-store.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-system-prompt.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
session-title.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-tool-progress.test.ts fix(tui): include provider latency in TPS 2026-09-17 10:40:12 -04:00
session-usage.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
session-view.test.ts fix: surface session execution errors in desktop and TUI timelines (#53826) 2026-10-09 14:14:44 +10:00
session-wait.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
shared-schema.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
shell-cleanup.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
shell-parse-compatibility.test.ts fix(core): make the portable PowerShell scanner sound against real pwsh (#53404) 2026-10-05 14:07:15 -07:00
shell-parse-parity.test.ts feat(core): make the portable shell scanner authoritative 2026-08-26 16:35:16 -04:00
shell-parse-syntax.test.ts feat(core): make the portable shell scanner authoritative 2026-08-26 16:35:16 -04:00
shell-parse.test.ts feat(sdk): seed host plugins before recovery and harden workerd defaults (#54219) 2026-10-09 17:07:51 -07:00
shell-retention.test.ts feat(sdk): seed host plugins before recovery and harden workerd defaults (#54219) 2026-10-09 17:07:51 -07:00
shell.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
skill-discovery.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
skill.test.ts feat(core): stabilize top-level policies config (#55297) 2026-10-13 22:47:44 -05:00
snapshot.test.ts test: fix Windows flakes in cli standalone, Storybook and snapshot tests (#56181) 2026-10-16 18:24:02 +02:00
sqlite-bundle.test.ts fix(core): default #sqlite resolution to the node driver (#41834) 2026-08-11 17:50:09 -04:00
sqlite-workerd.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
state-group.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
state-replay.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
state.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
subagent-lifetime.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
tool-edit.test.ts fix(core): preserve mixed line endings in edit tool (#53166) 2026-10-12 16:22:58 +02:00
tool-execute.test.ts refactor(core): convert tool schemas once at registration (#58848) 2026-10-24 22:22:35 -05:00
tool-html-markdown-budget.test.ts fix(core): terminate exhausted Markdown code budgets (#47408) 2026-09-09 09:15:11 -04:00
tool-opencode.test.ts feat(core): move worktree tools into core (#53981) 2026-10-08 17:23:43 -04:00
tool-output.test.ts refactor(core): name tool output files in ToolOutput (#52808) 2026-10-02 18:24:57 +00:00
tool-patch.test.ts fix(core): shape compaction and generate requests with built-in context hooks (#48749) 2026-09-12 23:10:09 -05:00
tool-question.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
tool-read-filesystem.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
tool-read.test.ts fix(core): store opaque screenshots as JPEG before PNG (#56990) 2026-10-23 14:43:06 -07:00
tool-registry.test.ts refactor(core): convert tool schemas once at registration (#58848) 2026-10-24 22:22:35 -05:00
tool-schema.test.ts refactor(core): convert tool schemas once at registration (#58848) 2026-10-24 22:22:35 -05:00
tool-search.test.ts fix(core): exclude hidden glob matches before limiting results 2026-09-09 09:41:07 -04:00
tool-shell.test.ts feat(core): enable portable shell scanner on local and dev channels (#53479) 2026-10-05 22:13:16 -07:00
tool-skill.test.ts feat(core): enforce skill integration policies 2026-10-07 15:39:27 -05:00
tool-subagent.test.ts refactor(ai): make Promise the root entry and move Effect to @opencode/ai/effect (#58847) 2026-10-24 22:18:23 -05:00
tool-todo.test.ts feat: restore the todowrite tool behind an experimental flag (#56947) 2026-10-19 16:23:12 -05:00
tool-webfetch.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
tool-websearch.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
tool-write.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
usage-limits.test.ts feat(core): read OpenCode Console usage limits and classify budget refusals (#58694) 2026-10-24 11:13:12 -05:00
v1-migration.test.ts refactor(core): keep Go allowance out of messages and sessions (#58765) 2026-10-24 13:05:02 -05:00
variant.test.ts feat(core): read model reasoning from config (#55853) 2026-10-16 13:36:18 +02:00
vcs-hg.test.ts test(core): expect the vcs provider in info results (#49264) 2026-09-15 23:01:16 -04:00
vcs.test.ts chore(ci): speed up and stabilize the test workflow (#55866) 2026-10-16 00:35:49 +02:00
voice.test.ts feat(core): offer GPT-Live through an OpenCode Console connection without an OpenAI key (#58567) 2026-10-23 22:29:46 -05:00
websearch.test.ts refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
wellknown.test.ts fix(core): broadcast wellknown updates globally and bound HTTP timeouts (#53821) 2026-10-09 15:17:26 -07:00
workspace.test.ts chore: upgrade Effect to rc.118 (#50231) 2026-10-09 01:36:06 -07:00
worktree.test.ts refactor(core): tighten worktree strategy and pty schemas and decode overlay once (#57950) 2026-10-21 20:57:46 -05:00