@bastani/atomic 0.10.9 → 0.10.10-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +211 -155
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +27 -12
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
- package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
- package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
- package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
- package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
- package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
- package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +145 -58
- package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
- package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
- package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
- package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
- package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
- package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
- package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
- package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
- package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
- package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/README.md +85 -114
- package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
- package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
- package/dist/builtin/intercom/group.ts +7 -3
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/README.md +37 -27
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +8 -0
- package/dist/builtin/subagents/README.md +71 -138
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
- package/dist/builtin/web-access/CHANGELOG.md +9 -0
- package/dist/builtin/web-access/README.md +60 -87
- package/dist/builtin/web-access/index.bundle.mjs +387 -351
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +4 -4
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +2 -2
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +2 -2
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +2 -2
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/agent-session-methods.d.ts +4 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/compaction/compactor.d.ts +20 -14
- package/dist/core/compaction/errors.d.ts +120 -0
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/model-resolver.d.ts +2 -2
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.code.js +1 -1
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/api-types.d.ts +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/provider-types.d.ts +18 -6
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-context.js +1 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-config.d.ts +40 -0
- package/dist/core/model-registry.js +1 -1
- package/dist/core/model-resolver-scope.d.ts +4 -4
- package/dist/core/model-runtime.d.ts +1 -1
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/provider-composer-internal.d.ts +11 -2
- package/dist/core/sdk.code.js +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +5 -5
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +1 -1
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +3 -3
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +2 -2
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +3 -3
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +3 -3
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +3 -3
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +3 -3
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +4 -4
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.code.js +1 -1
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.code.js +2 -2
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.code.js +3 -3
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.code.js +1 -1
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +2 -2
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +2 -2
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -7
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive/theme/color-utils.d.ts +5 -5
- package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
- package/dist/modes/rpc/rpc-types.d.ts +29 -2
- package/dist/package-manager-cli.code.js +5 -5
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/5.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +1 -2
- package/dist/startup-stages/9.js +2 -1
- package/dist/utils/native-module.d.ts +44 -0
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks.md +235 -243
- package/docs/build.md +12 -11
- package/docs/codemode.md +60 -51
- package/docs/compaction/reference.md +61 -24
- package/docs/compaction.md +117 -65
- package/docs/computer-use.md +179 -146
- package/docs/containerization.md +79 -33
- package/docs/custom-provider/api-reference.md +148 -11
- package/docs/custom-provider/oauth.md +44 -27
- package/docs/custom-provider/override.md +14 -7
- package/docs/custom-provider/registration.md +75 -65
- package/docs/custom-provider/streaming.md +42 -19
- package/docs/custom-provider.md +25 -61
- package/docs/development.md +47 -43
- package/docs/docs.json +33 -33
- package/docs/environment-variables.md +83 -57
- package/docs/extensions/api-reference.md +323 -734
- package/docs/extensions/authoring.md +186 -269
- package/docs/extensions/events.md +308 -375
- package/docs/extensions/examples.md +122 -74
- package/docs/extensions/ui.md +217 -197
- package/docs/extensions.md +152 -259
- package/docs/getting-started/authentication.md +27 -14
- package/docs/getting-started/first-session.md +25 -26
- package/docs/getting-started/installation.md +62 -84
- package/docs/getting-started/project-instructions.md +39 -14
- package/docs/guides/configuration.md +42 -20
- package/docs/guides/intercom.md +17 -13
- package/docs/guides/non-interactive.md +29 -16
- package/docs/guides/orchestration.md +16 -10
- package/docs/guides/resume-on-any-machine.md +54 -49
- package/docs/guides/subagents.md +22 -14
- package/docs/guides/team-setup.md +37 -26
- package/docs/guides.md +22 -21
- package/docs/herdr.md +21 -16
- package/docs/index.md +16 -17
- package/docs/intercom/operations.md +68 -66
- package/docs/intercom/reference.md +196 -191
- package/docs/intercom.md +103 -92
- package/docs/json.md +71 -71
- package/docs/keybindings.md +63 -50
- package/docs/libraries/agent-core.md +49 -8
- package/docs/libraries/ai.md +21 -12
- package/docs/libraries/codemode.md +28 -6
- package/docs/libraries/schema.md +7 -7
- package/docs/libraries/telemetry.md +7 -7
- package/docs/libraries/tui.md +74 -94
- package/docs/libraries.md +5 -5
- package/docs/llama-cpp.md +38 -33
- package/docs/mcp-servers.md +96 -90
- package/docs/models/reference.md +46 -33
- package/docs/models-configuration.md +12 -6
- package/docs/models.md +93 -88
- package/docs/orchestration/migrating-workflows.md +21 -19
- package/docs/orchestration/patterns.md +35 -20
- package/docs/orchestration.md +22 -21
- package/docs/packages/authoring.md +28 -19
- package/docs/packages/reference.md +75 -16
- package/docs/packages.md +31 -33
- package/docs/programmatic.md +22 -21
- package/docs/prompt-templates.md +63 -41
- package/docs/providers/reference.md +35 -19
- package/docs/providers.md +61 -71
- package/docs/quickstart.md +32 -46
- package/docs/reference/cli.md +249 -252
- package/docs/reference.md +23 -20
- package/docs/rpc/examples.md +74 -17
- package/docs/rpc/extension-ui.md +79 -62
- package/docs/rpc/protocol.md +816 -358
- package/docs/rpc.md +75 -151
- package/docs/sdk/reference.md +175 -45
- package/docs/sdk/structured-decisions.md +92 -62
- package/docs/sdk/web-server.md +79 -46
- package/docs/sdk.md +237 -195
- package/docs/security.md +106 -43
- package/docs/session-format.md +96 -59
- package/docs/sessions.md +149 -113
- package/docs/settings.md +289 -204
- package/docs/shell-aliases.md +15 -6
- package/docs/skills/authoring.md +17 -9
- package/docs/skills/reference.md +23 -21
- package/docs/skills.md +104 -97
- package/docs/storage.md +140 -242
- package/docs/subagents/authoring.md +147 -16
- package/docs/subagents/reference.md +100 -30
- package/docs/subagents.md +220 -252
- package/docs/terminal-setup.md +97 -69
- package/docs/termux.md +51 -85
- package/docs/themes/reference.md +51 -37
- package/docs/themes.md +49 -54
- package/docs/tmux.md +38 -21
- package/docs/tools.md +198 -147
- package/docs/tui/reference.md +64 -32
- package/docs/tui.md +38 -66
- package/docs/usage.md +76 -78
- package/docs/verification.md +25 -25
- package/docs/web-access.md +72 -55
- package/docs/windows.md +53 -58
- package/docs/worktree-snapshots.md +62 -65
- package/package.json +8 -8
- package/schemas/models.schema.json +51 -0
- package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
- package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
- package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
package/docs/subagents.md
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
|
|
2
|
+
title: "Run subagents"
|
|
3
|
+
sidebarTitle: "Subagents guide"
|
|
4
|
+
description: "Launch bundled or custom subagents in the background, isolate edits in Git worktrees, and control running tasks."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Atomic bundles `@bastani/subagents` so the parent chat can delegate bounded work to specialist child agents in separate sessions. Nothing extra needs to be installed.
|
|
7
|
+
Subagents let your main chat delegate bounded work to specialist agents running in separate sessions. No separate package installation is required.
|
|
9
8
|
|
|
10
9
|
When to delegate:
|
|
11
10
|
|
|
12
11
|
- Delegate independent research, analysis, debugging, or parallel implementation work that can overlap with other steps.
|
|
13
|
-
- Keep interactive, exploratory, or immediately blocking tasks in
|
|
14
|
-
- Every subagent runs in the background. Let completion notices
|
|
15
|
-
|
|
16
|
-
See [Background tasks](/background-tasks) for the agent panel, `/tasks`, shell output, cancellation, and completion notices.
|
|
17
|
-
|
|
18
|
-
## Where to go next
|
|
12
|
+
- Keep interactive, exploratory, or immediately blocking tasks in your main chat unless specialist focus or context isolation adds value.
|
|
13
|
+
- Every subagent runs in the background. Let completion notices report back instead of polling, and call `subagent({ action: "wait", id })` only when the next step depends on a subagent's result.
|
|
19
14
|
|
|
20
|
-
- [
|
|
21
|
-
- [Subagent reference](/subagents/reference) covers discovery order, `auto` model selection, fallbacks, reasoning levels, and task projection.
|
|
15
|
+
See [Manage background tasks](/background-tasks) for the agent panel, `/tasks`, shell output, cancellation, and completion notices. For defining custom agents, see [Create custom subagents](/subagents/authoring). For discovery precedence, fallback chains, and configuration keys, see [Subagent reference](/subagents/reference).
|
|
22
16
|
|
|
23
17
|
## Start with natural language
|
|
24
18
|
|
|
@@ -36,305 +30,282 @@ Run a parallel review: one pass for current behavior, one for failure modes, and
|
|
|
36
30
|
Research the upstream library behavior online, then compare it with our local implementation.
|
|
37
31
|
```
|
|
38
32
|
|
|
39
|
-
Atomic chooses the specialist and execution shape (single
|
|
33
|
+
Atomic chooses the specialist and execution shape (single subagent, parallel batch, or forked context). For multi-step coordination, your main session can also launch subagents from [codemode scripts](#from-codemode-scripts).
|
|
40
34
|
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
Run `/agents` (or `/agents <query>`) to inspect project, user, package, and built-in agents:
|
|
35
|
+
## Bundled agents
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
| Agent | Purpose | Default context | Edits files? |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `codebase-locator` | Find relevant files, directories, tests, configs, and docs. | `fresh` | No |
|
|
40
|
+
| `codebase-analyzer` | Explain code behavior and trace data flow with `file:line` references. | `fresh` | No |
|
|
41
|
+
| `codebase-pattern-finder` | Find similar implementations, conventions, and test patterns. | `fresh` | No |
|
|
42
|
+
| `codebase-research-locator` | Find related `research/` and `specs/` documents. | `fresh` | No |
|
|
43
|
+
| `codebase-research-analyzer` | Extract decisions and active constraints from local docs. | `fresh` | No |
|
|
44
|
+
| `codebase-online-researcher` | Research official docs, libraries, and open-source code online. | `fresh` | Research notes only (no `edit`/`write` tools) |
|
|
45
|
+
| `debugger` | Reproduce a failure, prove root cause, apply the minimal fix, and validate it. | `fresh` | Yes |
|
|
46
|
+
| `code-simplifier` | Simplify recent changes while preserving behavior. | `fresh` | Yes |
|
|
47
|
+
| `worker` | Implement an approved task, validate the change, and escalate scope decisions. | `fork` | Yes |
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
All bundled agents use `model: "auto"` with no pinned fallback chain. Pin a role via `subagents.agentOverrides.<name>.model` in `settings.json` or a per-call `model` argument. A concrete `model` runs only that model plus the agent's own `fallbackModels` (see [Fallback models](/subagents/reference#fallback-models)).
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
The `worker` agent also enables `defaultProgress: true` (isolated run-scoped `progress.md`), sets `inheritProjectContext: true`, sets `inheritSkills: false`, and loads the `tdd`, `agent-browser`, and `tmux` skills.
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
### Browse agents with `/agents`
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
- A provider that rejects credentials mid-run is skipped for subsequent fallbacks.
|
|
56
|
-
- If no candidate in the chain has credentials, launch fails immediately and lists each missing provider. See [Fallbacks and credentials](/models#fallbacks-and-credentials).
|
|
55
|
+
Run `/agents` (or `/agents <query>`) in an interactive session to inspect available agents, grouped in precedence order: **Project**, **User**, **Built-in**, and **Package**. Outside interactive mode, run `subagent({ action: "list" })`.
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
- Type to filter by name, description, or source. Select an agent and press `Enter` to view its model, fallbacks, default context, tools, file path, and system prompt.
|
|
58
|
+
- Press `Esc` to return to the list, then back to chat.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
`/agents` is read-only and never launches or edits agents. It applies the same discovery rules as execution, so shadowed or disabled definitions are hidden. Leaving `/agents` open never marks [Herdr](/herdr) as blocked.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
### Review compositions
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Compose specialists from distinct angles and synthesize their findings in your main session:
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
| Angle | Specialist |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| Current behavior and regressions | `codebase-analyzer` with `file:line` citations |
|
|
69
|
+
| Failure modes | `debugger` in inspect-only mode (no edits) |
|
|
70
|
+
| Project conventions | `codebase-pattern-finder` |
|
|
71
|
+
| Prior decisions | `codebase-research-locator` followed by `codebase-research-analyzer` |
|
|
72
|
+
| External API conformance | `codebase-online-researcher` |
|
|
67
73
|
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
subagent({ action: "wait", id: "<taskId>", budgetMs: 120000 })
|
|
71
|
-
subagent({ action: "status", id: "<taskId>" })
|
|
74
|
+
```text
|
|
75
|
+
Review the current diff with fresh-context specialists: analyze correctness, inspect failure modes without editing, and compare the implementation to existing patterns. Synthesize only issues worth fixing now.
|
|
72
76
|
```
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
- **Concurrency.** Multiple single-agent launches in one turn share `concurrency` (or the configured parallel limit). Returning from launch or ending a wait does not free a running slot.
|
|
76
|
-
- **Heartbeats.** Running children send [task heartbeats](/background-tasks#task-heartbeats) every 15 minutes by default, reporting current tool, idle time, turns, tool calls, and tokens. Override with `heartbeatMs` on the call or task entry (`0` disables).
|
|
77
|
-
- **Startup progress and retries.** Before its first turn, `status` reports the exact startup step (`opening its session`, `loading its resources`, `waiting for a resource-admission permit`, `creating its agent session`, `registering on Intercom`, or `dispatching its task`) with elapsed time and a structured `start` field. If startup exceeds `sessionStartTimeoutMs` (default 5 minutes), Atomic marks the attempt `stalled` and retries once after releasing its session.
|
|
78
|
-
- **Stalled startup failures.** If a stalled attempt still holds its session after half the budget (capped at 30 seconds), it fails without retrying. Two stalled attempts fail with `Subagent did not start: its start stalled <step> after <N>s and was retried once; the retry stalled <step> after <M>s`.
|
|
79
|
-
- **Settled output.** `wait` and `status` append up to 16 KB of output, `Full output: <path>` (a private copy; Atomic keeps the 256 most recent copies in a private temp directory and cleans them on exit), and `Requested output:` when an `output` file was specified. With `outputMode: "file-only"`, only the saved-file reference returns inline.
|
|
80
|
-
- **Yielding to user or Intercom.** User steering (`input-needed`) or an inbound Intercom message (`intercom-coordination`) yields active `wait` calls so the parent can respond without cancelling children or queued siblings. You can wait on the task again afterward.
|
|
81
|
-
- **Session close and reopen.** Closing a session stops running children. Reopening it automatically restores unfinished children from their saved sessions.
|
|
82
|
-
|
|
83
|
-
## Supervisor coordination
|
|
84
|
-
|
|
85
|
-
All built-in specialists include `intercom`. `debugger` and `worker` also include `contact_supervisor` for escalating decisions to the parent. Parent tool allowlists, exclusions, `noTools`, and disabled Intercom still apply. A child without `read` or `search` receives a read-only `session_history` tool after compaction so it can recover its own history (see [Agents without read or search](/compaction#agents-without-read-or-search)).
|
|
86
|
-
|
|
87
|
-
- **Supervisor decision waits vs. `intercom` `ask`.** `contact_supervisor({ reason: "need_decision" })` and `interview_request` wait only in the requesting child and resume that same child when the supervisor replies via `intercom({ action: "reply", message: "..." })` (use `pending` and `replyTo` when multiple asks are open). Never relaunch the child to answer it. By contrast, `intercom` `ask` never blocks: it returns at delivery (after any `wait` budget) and delivers late replies as messages.
|
|
88
|
-
- **Non-blocking updates.** `intercom` `send` and `contact_supervisor({ reason: "progress_update" })` return immediately without cancelling or disrupting siblings or worktrees.
|
|
89
|
-
- **Messaging a running child.** Children register on Intercom before their first turn, retrying while starting if the broker is briefly unreachable (supervisor authorization retries up to 30 seconds across broker restarts before starting without it). Address the child with its name or full ID from `intercom list`, and set `delivery` to `"steer"` (default), `"followUp"`, or `"interrupt"` based on urgency. See [Intercom reference](/intercom/reference#the-intercom-tool) for delivery modes and parameters.
|
|
90
|
-
- **Ended and terminal children.** Single-target `intercom` `send` and `ask` calls to completed or failed children return `queued: true` and resume the child (late `ask` replies arrive as messages). Messages to paused or quit children queue until the launching session continues them. Immediate rejection applies only to permanently cancelled (`killed`) children, pattern sends, calls past the resume rate or chain bounds, or an `ask` that hits a still-connected registration marked `replyCapability: "terminal"` before disconnecting. In-flight pending asks fail if the child ends before replying.
|
|
91
|
-
|
|
92
|
-
### Automatic restore on reopen
|
|
93
|
-
|
|
94
|
-
If Atomic exits, crashes, or you switch sessions (`/new`, `/resume`, `/fork`), running children stay resumable and relaunch automatically when you reopen the launching session. They keep their Intercom name, group, model, thinking level, original agent definition, `context: "fork"` bridge instructions, and unread queued steering or follow-up messages (delivered once in order).
|
|
78
|
+
## Context and Git worktrees
|
|
95
79
|
|
|
96
|
-
|
|
80
|
+
### Fresh vs. forked context
|
|
97
81
|
|
|
98
|
-
|
|
82
|
+
- **`context: "fresh"`** starts an isolated child session containing only the agent's prompt and task. Use `fresh` for adversarial reviews and independent research.
|
|
83
|
+
- **`context: "fork"`** branches from your main session's latest settled turn and fails fast if the main session cannot be forked (it never downgrades silently to `fresh`). A forked subagent inherits the main session's model, thinking level, active tool changes, and saved tool outputs without taking ownership of the main session's other subagents or replaying Intercom cards.
|
|
99
84
|
|
|
100
|
-
|
|
85
|
+
<Warning>
|
|
86
|
+
When you omit `context` on a parallel `tasks` batch, adding **any** agent with `defaultContext: fork` (such as `worker`) causes the **entire batch** to run in forked context. Pass `context: "fresh"` explicitly if you want fresh-context siblings alongside `worker`, or launch `worker` in a separate call.
|
|
87
|
+
</Warning>
|
|
101
88
|
|
|
102
|
-
|
|
89
|
+
Use `fork` when a subagent needs the main conversation's decisions and context. A forked subagent sends the exact conversation prefix the main session last sent (system prompt, project context, skills, tools, and messages), followed by its own role, a short handoff note, and its task. When it runs on the main session's same model and thinking level, the first request reads from the main session's prompt cache and pays only for the new suffix. On another model or provider it does not share that cache, and on another thinking level it may share only part of it.
|
|
103
90
|
|
|
104
|
-
|
|
91
|
+
In a fork, `inheritProjectContext` and `inheritSkills` do not hide what the main session already sent; those frontmatter flags apply to fresh subagents. The subagent's own tool allowlist still applies: calling a tool outside its allowed list fails with an error naming the allowed tools. Where the provider supports mid-conversation tool changes, removed or child-only tools are declared after the main conversation; otherwise child-only tools run through `codemode` restricted strictly to the subagent's own tools.
|
|
105
92
|
|
|
106
|
-
|
|
93
|
+
Fresh subagents inherit the main session's model registry, authentication, and workspace discovery settings. A subagent's tool list can narrow permissions, but it cannot re-enable tools or packages excluded by the main session. See [SDK configuration](/sdk) for programmatic child configuration.
|
|
107
94
|
|
|
108
|
-
###
|
|
95
|
+
### Temporary worktrees
|
|
109
96
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- Share findings, divide file ownership or expensive test runs, reuse verified reproductions, and challenge disagreements with evidence. Each child still returns its own complete result.
|
|
113
|
-
- Reserve `contact_supervisor` for supervisor decisions. Ordinary Intercom group boundaries and user approval gates still apply. Peer asks and one blocking supervisor ask can wait concurrently. See `/skill:intercom` for peer patterns.
|
|
97
|
+
Pass `worktree: true` on a parallel `tasks` call to isolate each subagent's edits in its own temporary Git worktree:
|
|
114
98
|
|
|
115
99
|
```typescript
|
|
116
|
-
const peerRules =
|
|
117
|
-
"Your siblings review the same diff. Run intercom list to find them, share every confirmed finding, " +
|
|
118
|
-
"ask them whatever you need, and debate disagreements with evidence. Then return your own structured verdict.";
|
|
119
|
-
|
|
120
100
|
subagent({
|
|
101
|
+
worktree: true,
|
|
121
102
|
tasks: [
|
|
122
|
-
{ agent: "
|
|
123
|
-
{ agent: "
|
|
124
|
-
{ agent: "reviewer", task: `Review test coverage of the auth changes. ${peerRules}` },
|
|
103
|
+
{ agent: "worker", task: "Implement the parser changes." },
|
|
104
|
+
{ agent: "worker", task: "Implement the CLI flag changes." },
|
|
125
105
|
],
|
|
126
|
-
})
|
|
106
|
+
})
|
|
127
107
|
```
|
|
128
108
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
Atomic supports large parallel swarms organized into peer-coordinating teams:
|
|
132
|
-
|
|
133
|
-
- **Parallel limits.** `parallel.maxTasks`, `parallel.concurrency`, and `parallel.runningCapacity` each default to `1000` with no hard upper cap. Raise all three in `config.json` to exceed 1,000, or lower `parallel.concurrency` to throttle. Provider rate limits and host memory remain practical bounds.
|
|
134
|
-
- **Nesting.** Delegation is strictly one level deep. Only the parent launches children.
|
|
135
|
-
- **Teams.** Intercom groups have no member cap. Assign each team its own `group` for internal messaging; members can still reach the parent via `contact_supervisor`.
|
|
109
|
+
Key rules for `worktree: true`:
|
|
136
110
|
|
|
137
|
-
|
|
111
|
+
- **Parallel mode only.** `worktree: true` creates temporary isolated worktrees only for parallel `tasks: [...]` runs (or multiple single-agent calls combined in one assistant message). On a standalone single-agent `{ agent, task }` call, `worktree: true` has no effect and the subagent runs in the main checkout; use `worktree: { branch }` for an isolated single-agent worktree.
|
|
112
|
+
- **Clean tracked working tree required.** Launch fails before starting any subagent if tracked files have staged or unstaged edits (`git status --porcelain --untracked-files=no`). Untracked files do not block launch.
|
|
113
|
+
- **Base branch.** Temporary worktrees branch from `origin/<default-branch>` (fetching if needed) and fall back to `HEAD` only if no origin default branch is found, rather than branching from your current local `HEAD`.
|
|
114
|
+
- **Automatic post-creation setup.** After creating each temporary worktree, Atomic automatically copies `.atomic/settings.local.json` and any untracked `.atomic/settings.json`, configures Git `core.hooksPath` to share `.husky` or `.git/hooks`, symlinks (or creates a junction on Windows for) `node_modules`, copies gitignored files listed in `.worktreeinclude`, and runs `worktreeSetupHook` if configured in `config.json`.
|
|
115
|
+
- **No per-task `cwd` overrides.** All tasks in a `worktree: true` batch must share the same `cwd`; per-task `cwd` overrides that differ from the shared `cwd` are rejected.
|
|
116
|
+
- **Patch capture and cleanup.** Once every subagent in the batch finishes, Atomic saves each subagent's changes as a patch under `worktree-diffs/<run-id>` and removes the temporary worktrees and branches. If capturing a worktree's patch fails, Atomic keeps that worktree on disk and reports it in the diff summary so changes are not lost.
|
|
117
|
+
- **Paused, quit, and cancelled subagents.** Paused, quit, or session-closed subagents keep their temporary worktree only if it has uncommitted changes, untracked files, or new commits. Clean worktrees are removed; `resume` recreates them from base plus the saved patch and writes later patches as `task-<n>-<agent>.<execution>.patch`. Permanently cancelled subagents release their worktrees, and unresumed stopped worktrees with changes remain under `.atomic/worktrees/`.
|
|
118
|
+
- **Waiting on cleanup.** `pause`, `quit`, completion, and failed resume wait for Git cleanup. Pressing `Esc` stops waiting without cancelling cleanup; cleanup taking over 10 seconds warns and continues in the background. Never delete a worktree directory while `worktreeNote` reports pending cleanup or a sibling hold, or after a crash without checking for orphaned Git processes.
|
|
119
|
+
- **Git hook integration.** Git filters and hooks can check `ATOMIC_SUBAGENT_WORKTREE_PHASE=finishing` during teardown. Extension authors can also subscribe to `subagent:finishing`; see [Subagent reference](/subagents/reference#sdk-integration-and-errors).
|
|
138
120
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
## Migration from acceptance gates
|
|
142
|
-
|
|
143
|
-
If older calls or agent definitions still use removed gate fields:
|
|
121
|
+
### Named worktrees
|
|
144
122
|
|
|
145
|
-
|
|
146
|
-
- Remove `completionGuard: false` from agent frontmatter (management edits strip it automatically).
|
|
147
|
-
- Put required commands, tests, or evidence checks directly in the task prompt.
|
|
123
|
+
Run a single subagent or specific parallel tasks on an explicit branch and directory with `worktree: { branch, base?, path? }`. Named worktrees cannot be combined with `worktree: true`. A top-level named `worktree` object applies to every task in `tasks` that does not set its own `worktree`.
|
|
148
124
|
|
|
149
|
-
|
|
125
|
+
```typescript
|
|
126
|
+
subagent({ agent: "worker", task: "Fix the parser", worktree: { branch: "fix/parser" } })
|
|
127
|
+
subagent({
|
|
128
|
+
tasks: [
|
|
129
|
+
{ agent: "worker", task: "Add the API", worktree: { branch: "feat/api", base: "origin/main" } },
|
|
130
|
+
{ agent: "worker", task: "Add the UI", worktree: { branch: "feat/ui", path: "../ui-worktree" } },
|
|
131
|
+
],
|
|
132
|
+
})
|
|
133
|
+
```
|
|
150
134
|
|
|
151
|
-
|
|
152
|
-
| --- | --- | --- |
|
|
153
|
-
| `codebase-locator` | Find relevant files, directories, tests, configs, and docs. | No |
|
|
154
|
-
| `codebase-analyzer` | Explain code behavior and trace data flow with file:line references. | No |
|
|
155
|
-
| `codebase-pattern-finder` | Find similar implementations, conventions, and test patterns. | No |
|
|
156
|
-
| `codebase-research-locator` | Find related `research/` and `specs/` documents. | No |
|
|
157
|
-
| `codebase-research-analyzer` | Extract decisions and active constraints from local docs. | No |
|
|
158
|
-
| `codebase-online-researcher` | Research official docs, libraries, and open-source code online. | Research notes only |
|
|
159
|
-
| `debugger` | Reproduce a failure, prove root cause, apply the minimal fix, and validate it. | Yes |
|
|
160
|
-
| `code-simplifier` | Simplify recent changes while preserving behavior. | Yes |
|
|
161
|
-
| `worker` | Implement an approved task, validate the change, and escalate scope decisions. | Yes |
|
|
135
|
+
How named worktrees differ from temporary worktrees:
|
|
162
136
|
|
|
163
|
-
|
|
137
|
+
- **No clean-tree requirement and no automatic post-setup.** Named worktrees work with dirty local checkouts and do not symlink `node_modules`, copy settings or `.worktreeinclude` files, set `core.hooksPath`, run `worktreeSetupHook`, or save diff patches.
|
|
138
|
+
- **Permanent ownership.** Atomic never deletes a named worktree or its branch. Resuming reuses the worktree or checks the branch back out there if removed.
|
|
139
|
+
- **Branch and path rules.** `path` defaults to `.atomic/worktrees/<branch>` (`/` replaced with `+`); relative paths resolve against the caller's `cwd`, and an existing empty directory at `path` is allowed. New branches use `--no-track` and start from `base` (resolved in the caller's worktree), then the current branch's upstream (`@{upstream}`), then `HEAD`. Branch names are validated with `git check-ref-format --branch` and cannot contain `@{`. Unused existing branches check out as-is, and a branch already checked out at `path` is reused. Launch fails fast if the branch is checked out elsewhere or `path` holds something else.
|
|
140
|
+
- **Subdirectory `cwd`.** If your session runs inside a repository subdirectory, the subagent starts in that same subdirectory inside the worktree (falling back to the worktree root if that subdirectory does not exist on the branch).
|
|
141
|
+
- **Concurrency, locks, and recovery.** Different branches and paths run concurrently. Duplicate `(branch, path)` launches wait and reuse; the same branch at a different path fails after the first finishes. Prefer `worktree: { ... }` over running `git worktree add` in the same turn, which can race with sibling tool calls. External `index.lock` files or initializing worktrees time out after 30 seconds (`another git process seems to be running at <path>`). Interrupted previous checkouts fail immediately (`an interrupted named-worktree checkout left an incomplete worktree at <path>`); on Git 2.30 to 2.32, they report busy after 30 seconds. To recover an incomplete checkout, confirm no Git process is running, save needed files, run `git worktree unlock <path>`, remove the directory, run `git worktree prune`, and clear stale `HEAD.lock` or branch `.lock` files (or run `git worktree remove --force --force <path>`). Never fix a partial checkout by deleting only `index.lock`.
|
|
164
142
|
|
|
165
|
-
##
|
|
143
|
+
## Background launches and waiting
|
|
166
144
|
|
|
167
|
-
|
|
145
|
+
Every `subagent` launch runs in the background without interactive preview prompts and returns immediately with each subagent's `taskId` and `intercomTarget` (for example `subagent-worker-1a2b3c4d-1`). Use `intercomTarget` verbatim when messaging a subagent. Legacy calls that pass `wait` still run in the background, and `wait: { kind: "foreground" }` adds a note pointing to `action: "wait"`.
|
|
168
146
|
|
|
169
|
-
|
|
170
|
-
| --- | --- |
|
|
171
|
-
| Current behavior and regressions | `codebase-analyzer` with file:line citations |
|
|
172
|
-
| Failure modes | `debugger` in inspect-only mode (no edits) |
|
|
173
|
-
| Project conventions | `codebase-pattern-finder` |
|
|
174
|
-
| Prior decisions | `codebase-research-locator` followed by `codebase-research-analyzer` |
|
|
175
|
-
| External API conformance | `codebase-online-researcher` |
|
|
147
|
+
Subagents return their results directly. Atomic does not infer acceptance gates or parse `acceptance-report` blocks, so write required tests, commands, or evidence checks directly in the task prompt.
|
|
176
148
|
|
|
177
|
-
```
|
|
178
|
-
|
|
149
|
+
```ts
|
|
150
|
+
subagent({ agent: "codebase-analyzer", task: "Trace the auth flow with file references." })
|
|
151
|
+
subagent({ action: "wait", id: "<taskId>", budgetMs: 120000 })
|
|
152
|
+
subagent({ action: "status", id: "<taskId>" })
|
|
179
153
|
```
|
|
180
154
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
],
|
|
191
|
-
group: true,
|
|
192
|
-
});
|
|
193
|
-
store("checks", tasks);
|
|
194
|
-
return tasks;
|
|
195
|
-
```
|
|
155
|
+
- **Waiting.** `subagent({ action: "wait", id: taskId, budgetMs? })` observes an existing task launched by this session up to `budgetMs` (default `tasks.wait.agentBudgetMs`, `30000` ms). Ending a wait on budget or pressing `Esc` leaves the subagent running. Wait for completion before depending on its result. See [Choose how long to wait](/background-tasks#choose-how-long-to-wait).
|
|
156
|
+
- **Repeating tasks with `count`.** In parallel `tasks`, set `count` (integer `>= 1`) on a task item to repeat it N times with the same settings. Expanded items count toward `parallel.maxTasks`.
|
|
157
|
+
- **Concurrency.** Multiple single-agent launches in one turn share `concurrency` (or the configured parallel limit). Returning from launch or ending a wait does not free a running slot.
|
|
158
|
+
- **Heartbeats.** Running subagents send [task heartbeats](/background-tasks#task-heartbeats) every 15 minutes by default, reporting current tool, idle time, turns, tool calls, and tokens. Override with `heartbeatMs` on the call or task entry (`0` disables).
|
|
159
|
+
- **Files, progress, and output.** Pass `reads` (single-agent or per-task) to prepend file contents resolved relative to the child's `cwd`. Pass `output` (path or `false`) and `outputMode` (`"inline"` default, or `"file-only"`, which requires an `output` path; duplicate `output` paths in a parallel batch are rejected). Pass `progress: true` to enable an isolated run-scoped `progress.md` under artifact storage (never inside child `cwd` or the repository; omitted inherits the agent's `defaultProgress`, suppressed for read-only tasks unless `progress: true`). Separate `includeProgress: true` adds runtime progress telemetry to the tool result.
|
|
160
|
+
- **Settled output.** `wait` and `status` return up to 16 KB inline, plus `Full output: <path>` (Atomic keeps the 256 most recent copies in a private temp directory and cleans them on exit) and `Requested output:` when `output` was set. With `outputMode: "file-only"`, only the saved-file reference returns inline.
|
|
161
|
+
- **Yielding to user or Intercom.** User steering (`input-needed`) or an inbound Intercom message (`intercom-coordination`) yields active `wait` calls so the main session can respond without cancelling running or queued subagents. Wait again afterward if you still need the result.
|
|
162
|
+
- **Startup progress and retries.** Before a subagent's first turn, `status` reports its exact startup step (`opening its session`, `loading its resources`, `waiting for a resource-admission permit` while waiting for a session slot, `creating its agent session`, `registering on Intercom`, or `dispatching its task`) with elapsed time. If startup exceeds `sessionStartTimeoutMs` (default 5 minutes), Atomic marks the attempt stalled and retries once after releasing its session. If a stalled attempt still holds its session after half the budget (capped at 30 seconds), it fails without retrying. Two stalled attempts fail with `Subagent did not start: its start stalled <step> after <N>s and was retried once; the retry stalled <step> after <M>s`.
|
|
163
|
+
- **Session close and reopen.** Closing a session stops running subagents. Reopening it automatically restores running subagents from their saved sessions.
|
|
196
164
|
|
|
197
|
-
|
|
165
|
+
### Task inspection
|
|
198
166
|
|
|
199
|
-
|
|
200
|
-
- **`status`.** Returns `children` launched by this session (pass `id` for one child) with state and any `resumeCall`. Use `status` after reopening a parent to rediscover children instead of relaunching.
|
|
201
|
-
- **`wait`.** Takes a task `id` and optional `budgetMs` (default 30 seconds, even if the owner waits indefinitely; `0` checks immediately). Script timeouts cancel `wait`, not the child. Returns `outcome: "settled"` (with `childId`, `result.status`, output excerpt, `outputPath`, and `resumeCall`) or `running`.
|
|
202
|
-
- **`pause`, `quit`, and `resume`.** `pause` and `quit` accept `id` or `all: true`. `resume` takes `id` and optional `message` and returns the new task ID in `children`. Always pass `id` rather than the legacy `runId` alias.
|
|
203
|
-
- **Temporary worktrees.** `status` can show `finishing` while `wait` still returns `running`. Check `worktreeNote` or `worktreeNotes` before removing any worktree directory.
|
|
167
|
+
Use `/tasks` (or `/tasks <id>`) or the agent panel below the prompt (`↓` on an empty prompt) to inspect running, waiting, and finished subagents and their nested shells.
|
|
204
168
|
|
|
205
|
-
|
|
169
|
+
- **Switch to a subagent.** Select a subagent row and press `Enter` (or click it) to view its live transcript and message it on the same chat screen. Press `←` on an empty prompt or select `main` in the panel to return without interrupting the subagent.
|
|
170
|
+
- **Pause or stop.** While viewing a working subagent, press `Esc` (or `Ctrl+C` on an empty prompt) to pause its active turn without affecting main chat. In `/tasks` or the agent panel, press `x` twice within 3 seconds to stop a running task resumably (red `◯` stopped mark), or `x` once to dismiss a finished row.
|
|
171
|
+
- **Subagent shells and hints.** A subagent's running shells nest underneath it in the agent panel. On a subagent's page in `/tasks`, backgrounded shell blocks show a clickable `· /tasks to manage` hint that opens that subagent's own task list. While viewing a released subagent waiting on a shell, the newest waited shell shows a clickable `· alt+w opens it` hint.
|
|
172
|
+
- **Questions in subagents.** A subagent's `ask_user_question` or extension dialog waits inside that subagent's transcript (**Needs input**) without blocking the main chat. SDK hosts without a task inspector route `humanInput` by `sessionId` ([Human input without a terminal](/sdk#human-input-without-a-terminal)).
|
|
173
|
+
- **Launch cards and status history.** Each subagent renders `Agent(<agent> · <short task title>)` with state, active elapsed time, and tokens (`Ctrl+O` expands prompt, tool calls, and result). Live progress, `/tasks`, and `status` show the resolved model and clamped reasoning effort. Atomic keeps live status for the 256 most recently finished runs plus all active runs; older subagents remain resumable via `subagent({ action: "resume", id })`.
|
|
206
174
|
|
|
207
|
-
|
|
208
|
-
- **Launch cards.** Each child renders `Agent(<agent> · <short task title>)` with state, elapsed time (dispatch to finish, stop, or release, excluding queue and cleanup time), and tokens. Press `Ctrl+O` to expand prompt, tool calls, and result; collapsed cards release those fields from memory. Parallel launches show one card per child and fail only if zero children start.
|
|
209
|
-
- **Model metadata.** Live progress, `/tasks`, and run status show each step's resolved model and capability-clamped reasoning effort (including fast model IDs like `openai-codex/gpt-5.6-sol-fast · thinking medium`). Compact launch cards and completion notices omit the model line to save space while persisting metadata in saved details.
|
|
210
|
-
- **Status history.** Atomic retains in-process status for the 256 most recent finished runs, and always keeps active runs. Older children remain resumable via `subagent({ action: "resume", id })`.
|
|
211
|
-
- **Cancelling a parent turn.** Pressing `Esc` in the parent ends `action: "wait"`, not the child. In an SDK session without a task host, cancelling the waiting `subagent` call stops children permanently and returns labelled partial findings (`progress.md`, last assistant text, or artifact paths).
|
|
175
|
+
See [Manage background tasks](/background-tasks), [Viewing a subagent](/background-tasks#viewing-a-subagent), and [Shells started by subagents](/background-tasks#shells-started-by-subagents) for the full panel layout, key bindings, command-routing table, and `/tasks` controls.
|
|
212
176
|
|
|
213
177
|
### Run control
|
|
214
178
|
|
|
215
|
-
Control
|
|
179
|
+
Control subagents with `pause`, `quit`, and `resume`. The `id` parameter accepts a child ID (`<runId>:<index>`), task ID, Intercom name, or single-child run ID:
|
|
216
180
|
|
|
217
181
|
```ts
|
|
218
182
|
subagent({ action: "pause", id: "<child-id>" }) // Stop now; hold queued messages for resume
|
|
219
|
-
subagent({ action: "pause", all: true }) // Pause all running
|
|
183
|
+
subagent({ action: "pause", all: true }) // Pause all running subagents of this session
|
|
220
184
|
subagent({ action: "quit", id: "<child-id>" }) // Graceful stop; stays resumable
|
|
221
|
-
subagent({ action: "quit", all: true }) // Covers running and already-paused
|
|
185
|
+
subagent({ action: "quit", all: true }) // Covers running and already-paused subagents
|
|
222
186
|
subagent({ action: "resume", id: "<child-id>", message: "Focus on the failing test first." })
|
|
223
187
|
```
|
|
224
188
|
|
|
225
|
-
- **`pause`.** Stops the active turn and keeps queued steering or follow-up messages to deliver once in order before `resume`'s `message`. Intercom messages to a paused
|
|
226
|
-
- **`quit`.** Stops the
|
|
227
|
-
- **Awaiting resume.** Paused and quit
|
|
228
|
-
- **Queued parallel
|
|
229
|
-
- **`resume`.** Continues the
|
|
230
|
-
- **Resumable vs. terminal.** Paused, quit, interrupted, completed, failed, and session-closed
|
|
189
|
+
- **`pause`.** Stops the active turn and keeps queued steering or follow-up messages to deliver once in order before `resume`'s `message`. Intercom messages to a paused subagent do not resume it; they wait with no time limit and reach it after `resume`'s `message`.
|
|
190
|
+
- **`quit`.** Stops the subagent gracefully, including paused subagents, while keeping it resumable.
|
|
191
|
+
- **Awaiting resume.** Paused and quit subagents report `paused · awaiting resume` or `quit · awaiting resume` with `Stop reason: pause` or `quit` and the exact `subagent({ action: "resume", id: "<child-id>" })` call. `status` lists them under **Awaiting resume** across restarts without auto-relaunching. Completed and failed notices state that execution ended and also provide the `resume` call and Intercom name.
|
|
192
|
+
- **Queued parallel subagents.** You can `pause` or `quit` a subagent still waiting for a concurrency slot. `resume` starts it with its original task, optional `message`, model, thinking level, worktree, and fork copy, and re-enters the concurrency queue. If its original model or fork copy no longer exists, `resume` reports it as gone instead of substituting silently.
|
|
193
|
+
- **`resume`.** Continues the subagent's saved session under the same child ID, Intercom name, and group with fresh supervisor authorization (`all: true` is not supported). For paused, quit, or interrupted subagents, `message` runs before continuing. For completed or failed subagents, `message` starts a fresh turn. Omitting `message` prompts the subagent to continue or stop if done.
|
|
194
|
+
- **Resumable vs. terminal.** Paused, quit, interrupted, completed, failed, and session-closed subagents are resumable. **Killed** (explicit cancellation) and **Gone** (unrestorable after restart) subagents are terminal and reject `resume`. Running subagents also reject `resume` (`<agent> (<child-id>, <intercom-name>) is already running as task <task-id>; pause or quit it first.`); use Intercom to message a running subagent. Failed resumes preserve `worktree: true` checkouts.
|
|
231
195
|
- **Interrupting control calls.** Pressing `Esc` stops waiting on `pause`, `quit`, or `resume`. Stops already requested still complete, while unstarted resumes cancel cleanly.
|
|
232
|
-
- **SDK without task host.** `pause`, `quit`, and `resume` work identically; resumed children run in the background and deliver completion notices.
|
|
233
196
|
- **Removed actions.** `kill` and `interrupt` were removed. Calls fail and direct you to `{ action: "quit", id }`:
|
|
234
197
|
|
|
235
198
|
```text
|
|
236
199
|
The subagent action "kill" was removed. Use { action: "quit", id } to stop a child gracefully; it stays resumable with { action: "resume", id, message? }.
|
|
237
200
|
```
|
|
238
201
|
|
|
239
|
-
#### Messages that resume a finished
|
|
240
|
-
|
|
241
|
-
Any session allowed to message a child under ordinary Intercom group and reach rules can bring it back. A single-target `send` or `ask` to a child that completed or failed returns at once with `queued: true`. The launching session resumes the child with its own model, tools, and agent definition, delivers the message first, and adds a prompt naming who sent it. An `ask` receives its reply later as a message.
|
|
202
|
+
#### Messages that resume a finished subagent
|
|
242
203
|
|
|
243
|
-
A
|
|
204
|
+
Any session allowed to message a subagent under ordinary Intercom group and reach rules can wake it. A single-target `intercom` `send` or `ask` to a completed or failed subagent returns immediately with `queued: true`, and the launching session resumes the subagent to handle the message (an `ask` receives its reply later as a message). Calling `subagent({ action: "resume", id: "<intercom-name>", message })` for a subagent launched by another session sends `message` through that same wake queue.
|
|
244
205
|
|
|
245
|
-
|
|
206
|
+
Messages to a paused or quit subagent wait in a durable queue without resuming it until the launching session continues it. The launching session always keeps ownership of the resumed subagent, its `/tasks` row, and its controls. Message-triggered resumes are bounded to 6 resumes in 10 minutes and chain depth 4. See [Messages that resume a finished subagent](/intercom/reference#messages-that-resume-a-finished-subagent) and [Subagents with no live session](/intercom/reference#subagents-with-no-live-session) for full queue limits and refusal rules.
|
|
246
207
|
|
|
247
|
-
|
|
248
|
-
- **Ownership and bounds.** The launching session always keeps the resumed child, its completion notice, its `/tasks` and agent-panel row, and `pause` or `quit` control. Its transcript records which session's message resumed it. Messages resume a child at most 6 times in 10 minutes, and agents waking each other stop after 4 consecutive resumes.
|
|
249
|
-
- **Inactive children that cannot resume.** When a send or ask cannot resume a child (because it was permanently cancelled, it was a pattern send, resume bounds refused it, or the sender runs an older Atomic), Intercom returns an error naming its `resume` call while the parent stays connected, waiting up to 20 seconds if the parent is closing. See [Subagents with no live session](/intercom/reference#subagents-with-no-live-session).
|
|
208
|
+
### Released subagents
|
|
250
209
|
|
|
251
|
-
|
|
210
|
+
A background subagent that waits more than 1 minute on a `detachable: true` tool call, a budgetless shell `wait`, an `intercom` `ask`, or a blocking `contact_supervisor` (`need_decision` or `interview_request`) is **released**. The waited operation keeps running while the subagent releases its session resources and wakes automatically when the result arrives.
|
|
252
211
|
|
|
253
|
-
|
|
212
|
+
- **What you see.** Your main chat shows a dim notice that does not trigger a model turn (`◌ <name> is waiting on <tool> (<call id>)`). `/tasks`, the agent panel, and the launch card list it under **Waiting** with `◌` and `waiting on <tool>`. `subagent({ action: "status" })` reports `released · waiting on <tool> (<call id>)`.
|
|
213
|
+
- **Late results and continuation notes.** If something else wakes the subagent first, the waited call returns as still running; when its result (or a subagent background shell) arrives later, a notice card delivers it once inside the subagent's chat. Whenever Atomic continues a subagent automatically, the subagent receives a short continuation note (`Continuing after Atomic restarted`, `Continuing where it left off`, or `Woken: what it waited for arrived`).
|
|
214
|
+
- **Inspecting, waking, or holding.** Viewing a released subagent displays its saved transcript without waking it; press `Alt+W` (`app.tasks.openWaited`) or click `· alt+w opens it` to open its newest waited shell in `/tasks`. Sending a message in its view, sending an Intercom `send`/`ask`, or calling `resume` wakes it immediately. Pressing `x` twice or calling `pause` or `quit` stops auto-wake and holds arriving results until you `resume`.
|
|
215
|
+
- **Active waits and crash recovery.** Any parent `action: "wait"` yields and reports the subagent released. Queued steering, follow-up, and Intercom messages persist before wake so nothing is lost on crash. Open Intercom asks stay open across local and [multi-node Intercom routing](/intercom/operations#running-intercom-across-machines). On reopen after restart, detachable tool calls restart with the same call IDs and arguments (mark only idempotent tools `detachable: true`); local Intercom asks time out while multi-node database asks stay alive. At most `parallel.runningCapacity` released subagents wake concurrently.
|
|
254
216
|
|
|
255
|
-
|
|
256
|
-
- **Late results.** If something else wakes the child first, the waited call returns as still running. When its result arrives later, or when a background shell the child launched finishes while released, the child receives a notice card in its own chat naming the tool, outcome, and output. The child reads each result once, and the notice starts its turn when nothing else does.
|
|
257
|
-
- **Continuation notes.** When Atomic continues a subagent automatically (after a restart, a `resume` without a message, or an arriving wake result), the child receives a short note in its chat (`Continuing after Atomic restarted`, `Continuing where it left off`, or `Woken: what it waited for arrived`). A `resume` with a message delivers both the message and the note in one turn.
|
|
258
|
-
- **Inspecting a released child.** Viewing the child on the chat screen shows its saved transcript without waking it, ending with the `◌` notice and any running shells. On the main screen, the newest waited shell shows a clickable `· alt+w opens it` hint, and `Alt+W` (`app.tasks.openWaited`) opens that shell in `/tasks` (`←` goes back).
|
|
259
|
-
- **Waking or holding.** Sending a message while viewing the child, sending an Intercom `send` or `ask`, or calling `resume` wakes it immediately. Pressing `x` twice or calling `pause` or `quit` stops auto-wake and holds arriving results until you `resume`.
|
|
260
|
-
- **Active waits and queued messages.** Any parent `action: "wait"` yields and reports the child released. Queued steering or follow-up messages, turn-starting Intercom or extension messages, and background notices accepted during release are persisted and delivered once on wake (`excludeFromContext: true` keeps cards only; `deliverAs: "nextTurn"` is not covered). Open Intercom asks to a released child stay open across local and [multi-node Intercom routing](/intercom/operations#running-intercom-across-machines).
|
|
261
|
-
- **Crash recovery and restarts.** Incoming wake results persist before reopening the child so a crash or failed wake keeps them for `resume`. If the launching session temporarily disconnects, Intercom holds messages for up to 20 seconds before returning retryable `recipient_owner_suspended`. On reopen after restart, detachable tool calls restart with the same call IDs and arguments (mark only idempotent tools `detachable: true`), while open local Intercom asks time out and multi-node DB asks stay alive.
|
|
262
|
-
- **Capacity and shell ownership.** A child that had already finished is not relaunched merely because an ask it sent was interrupted by a restart; it is notified the next time it runs. At most `parallel.runningCapacity` released children wake concurrently. A released child's background shells wake only that child, never the parent.
|
|
217
|
+
For the typed `ReleasedChildError` codes reported when tracking or waking a released subagent fails, see [SDK integration and errors](/subagents/reference#sdk-integration-and-errors).
|
|
263
218
|
|
|
264
|
-
|
|
219
|
+
### Automatic restore and session storage
|
|
265
220
|
|
|
266
|
-
|
|
267
|
-
| --- | --- | --- |
|
|
268
|
-
| `child-record-missing` | Current session has no record of this child. | Wake from the launching session. |
|
|
269
|
-
| `child-record-unreadable` | Child's latest record lives in a session not open here. | Open the launching session and retry. |
|
|
270
|
-
| `child-unrestorable` | Saved session or agent definition is missing or invalid. | Fix the reported cause and `resume`, or launch a new child. |
|
|
271
|
-
| `record-append-failed` | Could not persist child state to session storage (retryable). | Check session storage before relying on restart recovery. |
|
|
272
|
-
| `hold-failed` | Intercom broker could not reserve the released child (retryable; verified against restored reservations on reconnect, up to 5 seconds delay). | Confirm Intercom connectivity; until held, sends fail as not found. |
|
|
273
|
-
| `completion-not-held` | A child's shell finished after the child resumed or ended. | None. The notice waits for the child's next run. |
|
|
274
|
-
| `wake-failed` | Wake failed for another reason (retryable). | Results are preserved; call `resume` to retry. |
|
|
221
|
+
If Atomic exits, crashes, or you switch sessions (`/new`, `/resume`, `/fork`), running subagents stay resumable and relaunch automatically when you reopen the launching session. They keep their Intercom name, group, model, thinking level, original agent definition, forked context instructions, and unread queued steering or follow-up messages (delivered once in order).
|
|
275
222
|
|
|
276
|
-
|
|
223
|
+
Inbound Intercom messages wait while a subagent restores (see [Connection states and recovery](/intercom/operations#connection-states-and-recovery)). Finished, paused, quit, and permanently cancelled subagents do not auto-relaunch, and session forks (`/fork`, `--fork`) never relaunch the original session's subagents. If a subagent cannot be restored (for example, its session or agent definition is missing), Atomic posts one recovery notice with its IDs, worktree or branch, `git` inspection commands, and relaunch call, then marks it gone.
|
|
277
224
|
|
|
278
|
-
|
|
225
|
+
A subagent stores its session in the launching session's storage backend: SQLite by default, or your configured libSQL or PostgreSQL database. Subagents resume, wake, and export wherever their launching session opens, including another machine sharing the same database.
|
|
279
226
|
|
|
280
|
-
- **
|
|
281
|
-
- **
|
|
282
|
-
- **
|
|
283
|
-
- **
|
|
227
|
+
- **JSONL and custom directories.** A JSONL-backed session keeps each subagent's session file beside its own. Setting `sessionDir` (or `defaultSessionDir` in `config.json`) stores fresh subagents as JSONL files in that directory. Older sessions under `~/.atomic/agent/subagent-sessions/` remain readable in `/tasks` and restorable.
|
|
228
|
+
- **Unsaved sessions.** A session started with `--no-session` or in-memory storage keeps subagent sessions in memory; a finished subagent's history moves to a temporary file that Atomic deletes on exit.
|
|
229
|
+
- **Session list visibility.** Fresh subagent sessions are marked internal so `/resume`, `atomic -r`, `-c`, and `history://sessions` omit them, while `context: "fork"` sessions appear as forks of the main session. Each result names its session file or `history://sessions/<id>`.
|
|
230
|
+
- **Worktree snapshots.** In a blob-capable store, subagents record [worktree snapshots](/worktree-snapshots) of checkouts they modify. Reopening the main session restores each shared checkout from the newest capture among the main session and its finished subagents, while named worktrees and restored active subagents continue from their own snapshots.
|
|
284
231
|
|
|
285
|
-
|
|
232
|
+
## Coordination and swarms
|
|
286
233
|
|
|
287
|
-
|
|
234
|
+
### Supervisor coordination
|
|
288
235
|
|
|
289
|
-
|
|
290
|
-
- When pinning a model, call `subagent({ action: "models" })` first and use only a returned `fullId` and supported thinking level. Never invent model IDs or inspect credentials.
|
|
291
|
-
- When the session has an active `enabledModels` / `--models` / `/scoped-models` scope, `subagent({ action: "models" })` returns only models matching that scope, and subagent launches and fallbacks enforce the same allowlist (skipping disallowed fallback candidates and rejecting disallowed explicit models). When unset or empty, all available models remain allowed.
|
|
292
|
-
- Children inherit the parent's Intercom group unless `group` is passed on the call or task (`contact_supervisor` still crosses group boundaries).
|
|
236
|
+
By default (`intercomBridge.mode: "always"` in `config.json`), Atomic injects **both** `intercom` and `contact_supervisor` into **every** subagent whose launching session has Intercom active. Tool frontmatter declarations alone control Intercom tool availability only when `intercomBridge.mode` is `"off"` (or `"fork-only"` for fresh subagents). Main-session tool allowlists, exclusions, `noTools`, and disabled Intercom still apply. A subagent without `read` or `search` receives a read-only `session_history` tool after compaction so it can recover its own history (see [Agents without read or search](/compaction#agents-without-read-or-search)).
|
|
293
237
|
|
|
294
|
-
|
|
238
|
+
- **Supervisor decision waits vs. `intercom` `ask`.** `contact_supervisor({ reason: "need_decision", message })` and `interview_request` wait inside the requesting subagent and continue that same subagent when you reply via `intercom({ action: "reply", message: "..." })` (use `pending` and `replyTo` when multiple asks are open). Never relaunch the subagent to answer it. By contrast, `intercom` `ask` never blocks: it returns at delivery (after any `wait` budget) and delivers late replies as messages.
|
|
239
|
+
- **Non-blocking updates.** `intercom` `send` and `contact_supervisor({ reason: "progress_update", message })` return immediately without cancelling or disrupting siblings or worktrees.
|
|
240
|
+
- **Messaging a running subagent.** Subagents register on Intercom before their first turn, retrying while starting if the broker is briefly unreachable (supervisor authorization retries up to 30 seconds across broker restarts before starting without it). Address the subagent by its name or full ID from `intercom list`, and set `delivery` to `"steer"` (default), `"followUp"`, or `"interrupt"`. See [Intercom reference](/intercom/reference#the-intercom-tool).
|
|
241
|
+
- **Embedded SDK sessions without background task management.** When an embedded SDK session launches a single subagent directly without background task management, `subagent` waits for completion; a blocking `contact_supervisor` request ends that subagent and returns its question, attachments, identity, and `[TASK_CONTEXT]` so the caller can launch a fresh subagent (`subagent({ agent: "worker", task: "[TASK_CONTEXT] ... Continue with this supervisor answer: ..." })`). Cancelling that waiting call stops the subagent permanently and returns labelled partial findings (`progress.md`, last assistant text, or artifact paths).
|
|
295
242
|
|
|
296
|
-
###
|
|
243
|
+
### Peer coordination
|
|
297
244
|
|
|
298
|
-
-
|
|
299
|
-
- `context: "fork"` branches from the parent's settled entry and fails fast if the parent cannot be forked (it never downgrades to fresh). It inherits model, thinking level, tool changes, `atomic.appendEntry` data since the last clear, and referenced saved tool outputs without taking ownership of the parent's subagents or replaying parent Intercom cards.
|
|
245
|
+
Peer-to-peer coordination is the default. Siblings in a parallel batch, or sharing an explicit `group`, discover each other with `intercom({ action: "list" })` and communicate directly with `send` and `ask` instead of routing through the supervisor.
|
|
300
246
|
|
|
301
|
-
|
|
247
|
+
- Share findings, divide file ownership or expensive test runs, reuse verified reproductions, and challenge disagreements with evidence. Each subagent still returns its own complete result.
|
|
248
|
+
- Reserve `contact_supervisor` for supervisor decisions. Ordinary Intercom group boundaries and user approval gates still apply. Peer asks and one blocking supervisor ask can wait concurrently. See `/skill:intercom` for peer patterns.
|
|
302
249
|
|
|
303
|
-
|
|
250
|
+
```typescript
|
|
251
|
+
const peerRules =
|
|
252
|
+
"Your siblings review the same diff. Run intercom list to find them, share every confirmed finding, " +
|
|
253
|
+
"ask them whatever you need, and debate disagreements with evidence. Then return your own structured verdict.";
|
|
304
254
|
|
|
305
|
-
|
|
255
|
+
subagent({
|
|
256
|
+
tasks: [
|
|
257
|
+
{ agent: "reviewer", task: `Review correctness of the auth changes. ${peerRules}` },
|
|
258
|
+
{ agent: "reviewer", task: `Review security of the auth changes. ${peerRules}` },
|
|
259
|
+
{ agent: "reviewer", task: `Review test coverage of the auth changes. ${peerRules}` },
|
|
260
|
+
],
|
|
261
|
+
});
|
|
262
|
+
```
|
|
306
263
|
|
|
307
|
-
###
|
|
264
|
+
### Scaling a swarm
|
|
308
265
|
|
|
309
|
-
|
|
266
|
+
Atomic supports large parallel swarms organized into peer-coordinating teams:
|
|
310
267
|
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
- **Integration hook.** Subscribe to `atomic.events.on("subagent:finishing", ({ runId, index, taskId, cwd, status }) => ...)` before launch, or check `ATOMIC_SUBAGENT_WORKTREE_PHASE=finishing` in Git filters, so external helpers do not block cleanup while waiting for the terminal report.
|
|
268
|
+
- **Parallel limits.** `parallel.maxTasks`, `parallel.concurrency`, and `parallel.runningCapacity` each default to `1000` with no hard upper cap. Raise all three in `config.json` to exceed 1,000, or lower `parallel.concurrency` to throttle. Provider rate limits and host memory remain practical bounds.
|
|
269
|
+
- **Nesting.** Delegation is strictly one level deep. Only the main session launches subagents.
|
|
270
|
+
- **Teams.** Intercom groups have no member cap. Assign each team its own `group` for internal messaging; members can still reach the supervisor via `contact_supervisor`.
|
|
315
271
|
|
|
316
|
-
###
|
|
272
|
+
### From codemode scripts
|
|
317
273
|
|
|
318
|
-
|
|
274
|
+
When both `codemode` and `subagent` are active, `tools.subagent()` launches the same background subagents and resolves at launch, not completion. Launched subagents belong to the main session and continue even if the script returns, throws, or times out. Separate `tools.subagent()` calls in a script are not merged into a burst; pass `tasks: [...]` for a parallel batch. Subagents cannot launch nested subagents from codemode.
|
|
319
275
|
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
subagent({
|
|
276
|
+
```js
|
|
277
|
+
const { tasks } = await tools.subagent({
|
|
323
278
|
tasks: [
|
|
324
|
-
{ agent: "worker", task: "
|
|
325
|
-
{ agent: "worker", task: "
|
|
279
|
+
{ agent: "worker", task: "Check the examples" },
|
|
280
|
+
{ agent: "worker", task: "Check the links" },
|
|
326
281
|
],
|
|
327
|
-
|
|
282
|
+
group: true,
|
|
283
|
+
});
|
|
284
|
+
store("checks", tasks);
|
|
285
|
+
return tasks;
|
|
328
286
|
```
|
|
329
287
|
|
|
330
|
-
|
|
331
|
-
- **Ownership.** Atomic never deletes a named worktree or its branch, saves no patch, and does not copy or link `node_modules`. Resuming reuses the worktree or checks the branch back out there if removed. Prefer `worktree: { ... }` over running `git worktree add` in the same turn, which races with sibling tool calls.
|
|
332
|
-
- **Concurrency and locks.** Different branches and paths run concurrently. Duplicate `(branch, path)` launches wait and reuse; the same branch at a different path fails after the first finishes. External `index.lock` files or initializing worktrees time out after 30 seconds (`another git process seems to be running at <path>`). Interrupted previous checkouts fail immediately (`an interrupted named-worktree checkout left an incomplete worktree at <path>`); on Git 2.30 to 2.32, they report busy after the 30-second wait instead.
|
|
333
|
-
- **Recovery.** Confirm no Git process is running, save needed files, run `git worktree unlock <path>`, remove the directory, run `git worktree prune`, and clear any stale `HEAD.lock` or branch `.lock` files (or run `git worktree remove --force --force <path>`). Never fix a partial checkout by deleting only `index.lock`, and never have Git checkout hooks synchronously spawn another named worktree for the same branch and path.
|
|
288
|
+
Single `{ agent, task }` and parallel `{ tasks }` calls both return `{ action: "launch", tasks }`. Each slot has `agent`, `state` (`"admitted"`, `"queued"`, or `"refused"` with `reason`), `taskId`, `childId`, and `intercomTarget` when available. Do not retry already-started siblings if one slot is refused.
|
|
334
289
|
|
|
335
|
-
|
|
290
|
+
- **`list`, `get`, and `models`.** Inspect executable `agents`, matching `definitions`, or the model catalog (`fullId`, `isCurrent`, `availableThinkingLevels`). Creating, updating, or deleting agent definitions requires a direct tool call.
|
|
291
|
+
- **`status`.** Returns `children` launched by this session (pass `id` for one subagent) with state and any `resumeCall`. Use `status` after reopening a session to rediscover subagents instead of relaunching.
|
|
292
|
+
- **`wait`.** Takes a task `id` and optional `budgetMs` (default 30 seconds, even if the host waits indefinitely; `0` checks immediately). Script timeouts cancel `wait`, not the subagent. Returns `outcome: "settled"` (with `childId`, `result.status`, output excerpt, `outputPath`, and `resumeCall`), `"running"`, or `"stopped-waiting"` (when the script's signal aborts).
|
|
293
|
+
- **`pause`, `quit`, and `resume`.** `pause` and `quit` accept `id` or `all: true`. `resume` takes `id` and optional `message` and returns the new task ID in `children`. Always pass `id` rather than the legacy `runId` alias.
|
|
294
|
+
- **Temporary worktrees.** `status` can show `finishing` while `wait` still returns `running`. Check `worktreeNote` or `worktreeNotes` before removing any worktree directory.
|
|
336
295
|
|
|
337
|
-
|
|
296
|
+
## Models, scope, and configuration
|
|
297
|
+
|
|
298
|
+
### Model selection and `enabledModels` scope
|
|
299
|
+
|
|
300
|
+
All built-in subagents default to `model: "auto"`, which runs your default model (last chosen with `/model`) at its default thinking level, or the launching session's model when no default is set. Per-call `model` overrides the default, and custom agents without `model` or `fallbackModels` inherit the launching session's model and thinking level. See [Automatic model selection](/subagents/reference#automatic-model-selection).
|
|
301
|
+
|
|
302
|
+
- **Model catalog.** Call `subagent({ action: "models" })` before pinning a model and use only a returned `fullId` and supported thinking level. Omit per-call `model` unless the user requested a specific model or you have a clear task-specific reason.
|
|
303
|
+
- **Credentials.** Providers without configured credentials are skipped before launch and recorded in model attempts. A provider that rejects credentials mid-run is skipped for subsequent fallbacks. If no candidate has credentials, launch fails immediately and lists each missing provider (see [Fallbacks and credentials](/models#fallbacks-and-credentials)).
|
|
304
|
+
- **`enabledModels` / `--models` / `/scoped-models` scope.** Subagents enforce the main session's active model scope using the exact same matching rules (`minimatch` `*`/`?`/`[...]` globs, literal bracketed IDs, fuzzy substring matches, and case-insensitive `:thinking` suffixes). `subagent({ action: "models" })` returns only scoped models, fallbacks skip disallowed candidates, and explicit disallowed models fail before launch. If `enabledModels` is set to patterns matching zero available models, **all** subagent launches are refused; only an unset or empty `enabledModels` allows all models.
|
|
305
|
+
|
|
306
|
+
### Subagent `config.json` and call options
|
|
307
|
+
|
|
308
|
+
Configure subagent runtime defaults in `~/.atomic/agent/extensions/subagent/config.json` (Atomic falls back to `~/.pi/agent/extensions/subagent/config.json` when the Atomic file is absent):
|
|
338
309
|
|
|
339
310
|
```json
|
|
340
311
|
{
|
|
@@ -343,25 +314,24 @@ Configure parallel limits and restart recovery in `~/.atomic/agent/extensions/su
|
|
|
343
314
|
"concurrency": 2000,
|
|
344
315
|
"runningCapacity": 2000
|
|
345
316
|
},
|
|
346
|
-
"resumeInFlight": "ask"
|
|
317
|
+
"resumeInFlight": "ask",
|
|
318
|
+
"sessionStartTimeoutMs": 300000,
|
|
319
|
+
"intercomBridge": {
|
|
320
|
+
"mode": "always"
|
|
321
|
+
}
|
|
347
322
|
}
|
|
348
323
|
```
|
|
349
324
|
|
|
350
|
-
- **`parallel.maxTasks`, `concurrency`, and `runningCapacity`.** All default to `1000` with no hard cap. Per-call `concurrency` overrides `parallel.concurrency`. `runningCapacity` takes effect when the first
|
|
351
|
-
- **`resumeInFlight`.** Controls paused or quit
|
|
352
|
-
- **
|
|
353
|
-
-
|
|
354
|
-
- **`
|
|
355
|
-
- **`
|
|
356
|
-
- **`progress: boolean`.** Creates a run-scoped `progress.md` in isolated subagent artifact storage (never inside child `cwd` or the repository; cleaned up on exit when `artifacts: false`; shared across parallel tasks). Omitting it inherits the agent's `defaultProgress` (suppressed for read-only tasks unless `progress: true`). This is separate from `includeProgress: true`, which adds runtime progress telemetry to the tool result.
|
|
357
|
-
|
|
358
|
-
```ts
|
|
359
|
-
subagent({ agent: "worker", task: "Implement the approved fix.", progress: true })
|
|
360
|
-
```
|
|
325
|
+
- **`parallel.maxTasks`, `concurrency`, and `runningCapacity`.** All default to `1000` with no hard cap. Per-call `concurrency` overrides `parallel.concurrency`. `runningCapacity` takes effect when the first subagent starts, so restart Atomic after changing it.
|
|
326
|
+
- **`resumeInFlight`.** Controls paused or quit subagents awaiting resume on startup or `/resume` (not `/reload`, `/new`, or `/fork`): `"never"` (default, stay in **Awaiting resume**), `"ask"` (one confirmation prompt; falls back to `"never"` without a UI), or `"auto"` (resumes automatically).
|
|
327
|
+
- **Additional keys.** `config.json` also supports `defaultSessionDir`, `control` (attention and long-running notice thresholds), `worktreeSetupHook` and `worktreeSetupHookTimeoutMs` (default `30000` ms), and `intercomBridge` (`mode`: `"off" | "fork-only" | "always"`, `instructionFile`). Invalid `resumeInFlight` or `sessionStartTimeoutMs` values drop only that field and log an error while the rest of the file loads; invalid JSON falls back to `{}`. See [Subagent config.json reference](/subagents/reference#subagent-config-json-reference) for every key.
|
|
328
|
+
- **Multiple `subagent` calls in one assistant message.** Separate single-agent `subagent` calls emitted in one assistant message combine into one parallel run while returning each call's own results and errors. Shared options (`concurrency`, `worktree: true`, `context`, `control`, `sessionDir`, `maxOutput`, `artifacts`, `includeProgress`, `agentScope`) must match across those calls; `cwd` (must match for `worktree: true`), `group`, and named `worktree: { ... }` stay per call. Prefer one explicit `{ tasks: [...] }` call when planning parallel work.
|
|
329
|
+
- **`group`.** A named string joins that Intercom group; boolean `true` or the case-insensitive string `"true"` or `"auto"` creates one shared UUID group for a parallel set. Precedence is explicit `group`, then launching session group, then config, then `"default"`.
|
|
330
|
+
- **`cwd` validation.** A missing or non-directory `cwd` fails before starting the subagent.
|
|
361
331
|
|
|
362
332
|
### Subagent start timeouts
|
|
363
333
|
|
|
364
|
-
|
|
334
|
+
Subagents have a 5-minute startup budget covering session open, resource load, agent session creation (including slot wait), and task dispatch. Queue wait under `parallel.runningCapacity` does not count. Override the budget in `~/.atomic/agent/extensions/subagent/config.json` (milliseconds, `1` to `2147483647`):
|
|
365
335
|
|
|
366
336
|
```json
|
|
367
337
|
{ "sessionStartTimeoutMs": 600000 }
|
|
@@ -371,38 +341,36 @@ Exceeding the budget fails with `SessionStartTimeoutError` (shown in `status` an
|
|
|
371
341
|
|
|
372
342
|
| `phase` | Blocked on | Action |
|
|
373
343
|
| --- | --- | --- |
|
|
374
|
-
| `admission` | Waiting for a
|
|
344
|
+
| `admission` | Waiting for a session slot. | Free concurrent capacity and retry. |
|
|
375
345
|
| `setup` | Opening session, loading resources, or extension startup. | Check session storage or extensions, or raise `sessionStartTimeoutMs`, then retry. |
|
|
376
346
|
| `dispatch` | Session started, but `input` or `before_agent_start` blocked dispatch. | Inspect extension handlers and retry. |
|
|
377
|
-
| `event-loop` | The main thread was saturated during startup. | Reduce
|
|
347
|
+
| `event-loop` | The main thread was saturated during startup. | Reduce concurrent load and retry. |
|
|
378
348
|
|
|
379
|
-
|
|
349
|
+
For SDK error rehydration (`isSessionStartTimeoutError`, `rehydrateSessionStartError`), see [Session start errors](/sdk/reference#session-start-errors).
|
|
380
350
|
|
|
381
|
-
|
|
382
|
-
import { isSessionStartTimeoutError, rehydrateSessionStartError } from "@bastani/atomic";
|
|
351
|
+
## Delegation boundaries and migration
|
|
383
352
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
353
|
+
Delegation is fixed at one level: subagents cannot launch, `pause`, `resume`, or `quit` other subagents, and restricted subagents cannot `create`, `update`, or `delete` agent definitions. Subagents can still run background shells (nested under the subagent in the agent panel) and inspect status with `list`, `get`, `status`, and `wait`. Subagent prompts omit parent orchestration artifacts and prior control traffic.
|
|
354
|
+
|
|
355
|
+
If older calls or agent definitions still pass removed acceptance-gate fields:
|
|
356
|
+
|
|
357
|
+
- Remove `acceptance` from `subagent()` calls and task entries.
|
|
358
|
+
- Remove `completionGuard: false` from agent frontmatter (tool updates strip it automatically).
|
|
359
|
+
- Put required commands, tests, or evidence checks directly in the task prompt.
|
|
360
|
+
|
|
361
|
+
<div id="custom-agents" />
|
|
391
362
|
|
|
392
|
-
|
|
363
|
+
<div id="fallback-models" />
|
|
393
364
|
|
|
394
|
-
|
|
365
|
+
<div id="reasoning-levels" />
|
|
395
366
|
|
|
396
|
-
<
|
|
397
|
-
<a id="fallback-models" />
|
|
398
|
-
<a id="reasoning-levels" />
|
|
399
|
-
<a id="owner-bound-task-projection" />
|
|
367
|
+
<div id="owner-bound-task-projection" />
|
|
400
368
|
|
|
401
369
|
## Related docs
|
|
402
370
|
|
|
403
|
-
- [
|
|
371
|
+
- [Create custom subagents](/subagents/authoring#custom-agents) explains how to define, scope, and override agents.
|
|
404
372
|
- [Subagent reference](/subagents/reference) covers [agent discovery](/subagents/reference#agent-discovery), [fallback models](/subagents/reference#fallback-models), [reasoning levels](/subagents/reference#reasoning-levels), and [owner-bound task projection](/subagents/reference#owner-bound-task-projection).
|
|
405
|
-
- [
|
|
406
|
-
- [Intercom](/intercom) covers cross-session messaging and supervisor escalation.
|
|
373
|
+
- [Orchestrate with codemode and subagents](/orchestration) shows multi-step work with codemode and subagents.
|
|
374
|
+
- [Coordinate sessions with Intercom](/intercom) covers cross-session messaging and supervisor escalation.
|
|
407
375
|
- [Skills](/skills) covers reusable instructions invoked with `/skill:<name>`.
|
|
408
376
|
- [Settings](/settings) covers user and project configuration.
|