@selesai/code 0.2.1 → 0.3.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/dist/config.d.ts +4 -15
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -45
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +8 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/diagnostics.d.ts +1 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/model-registry.d.ts +4 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +101 -51
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/package-manager.d.ts +10 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +93 -8
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/package-manager.test.d.ts +2 -0
- package/dist/core/package-manager.test.d.ts.map +1 -0
- package/dist/core/package-manager.test.js +20 -0
- package/dist/core/package-manager.test.js.map +1 -0
- package/dist/core/resource-loader.d.ts +3 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +10 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/defaults/models.json +64 -113
- package/dist/extensions/caveman/caveman-instructions.cjs +39 -0
- package/dist/extensions/caveman/index.js +116 -0
- package/dist/extensions/caveman/package.json +8 -0
- package/dist/extensions/caveman/test/extension.test.js +185 -0
- package/dist/extensions/caveman/test/helpers.test.js +67 -0
- package/dist/extensions/copy-turn.ts +2 -2
- package/dist/extensions/pi-intercom/broker/broker.ts +2 -3
- package/dist/extensions/pi-intercom/broker/paths.ts +10 -5
- package/dist/extensions/pi-intercom/broker/spawn.ts +2 -3
- package/dist/extensions/pi-intercom/config.ts +2 -2
- package/dist/extensions/pi-intercom/index.ts +2 -2
- package/dist/extensions/pi-intercom/package.json +2 -2
- package/dist/extensions/pi-intercom/ui/compose.ts +3 -3
- package/dist/extensions/pi-intercom/ui/inline-message.ts +3 -3
- package/dist/extensions/pi-intercom/ui/session-list.ts +3 -3
- package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +2 -2
- package/dist/extensions/pi-powerline-footer/bash-mode/history.ts +2 -1
- package/dist/extensions/pi-powerline-footer/index.ts +40 -47
- package/dist/extensions/pi-powerline-footer/package.json +2 -2
- package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +10 -10
- package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +1 -1
- package/dist/extensions/pi-powerline-footer/tests/working-vibes.test.ts +2 -2
- package/dist/extensions/pi-powerline-footer/theme.ts +6 -6
- package/dist/extensions/pi-powerline-footer/tps.ts +1 -1
- package/dist/extensions/pi-powerline-footer/types.ts +7 -7
- package/dist/extensions/pi-powerline-footer/welcome.ts +23 -16
- package/dist/extensions/pi-powerline-footer/working-vibes.ts +52 -59
- package/dist/extensions/pi-rewind-hook/index.ts +1 -1
- package/dist/extensions/pi-rewind-hook/package.json +1 -1
- package/dist/extensions/pi-subagents/README.md +224 -52
- package/dist/extensions/pi-subagents/agents/architect.md +188 -0
- package/dist/extensions/pi-subagents/agents/builder.md +120 -0
- package/dist/extensions/pi-subagents/agents/commentator.md +131 -0
- package/dist/extensions/pi-subagents/agents/explorer.md +51 -0
- package/dist/extensions/pi-subagents/agents/recapper.md +21 -0
- package/dist/extensions/pi-subagents/install.mjs +93 -0
- package/dist/extensions/pi-subagents/package.json +4 -5
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +76 -13
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +179 -2
- package/dist/extensions/pi-subagents/src/agents/agent-memory.ts +254 -0
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +11 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +193 -19
- package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +27 -2
- package/dist/extensions/pi-subagents/src/extension/config.ts +27 -4
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +1 -7
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +3 -2
- package/dist/extensions/pi-subagents/src/extension/index.ts +73 -71
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +369 -0
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +54 -10
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +200 -0
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +21 -253
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +519 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +195 -105
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +88 -2
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +67 -10
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +34 -4
- package/dist/extensions/pi-subagents/src/runs/background/completion-batcher.ts +166 -0
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +156 -1
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +515 -0
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +161 -44
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +1 -2
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +3 -2
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +167 -6
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +514 -0
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +28 -1
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +873 -204
- package/dist/extensions/pi-subagents/src/runs/background/wait.ts +353 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +123 -27
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +174 -70
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +569 -81
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +45 -22
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +3 -1
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +2 -2
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +172 -21
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +128 -0
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +89 -0
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +50 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +35 -4
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +63 -45
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +125 -5
- package/dist/extensions/pi-subagents/src/runs/shared/tool-budget.ts +74 -0
- package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +52 -0
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +28 -5
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +16 -1
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +15 -2
- package/dist/extensions/pi-subagents/src/shared/child-transcript.ts +212 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +133 -22
- package/dist/extensions/pi-subagents/src/shared/settings.ts +3 -1
- package/dist/extensions/pi-subagents/src/shared/types.ts +197 -4
- package/dist/extensions/pi-subagents/src/shared/utils.ts +108 -17
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +330 -0
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +135 -4
- package/dist/extensions/pi-subagents/src/tui/render.ts +32 -12
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +2772 -0
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +1107 -0
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +463 -0
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +274 -0
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +1535 -0
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +242 -0
- package/dist/extensions/pi-subagents/test/integration/doctor-executor.test.ts +128 -0
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +252 -0
- package/dist/extensions/pi-subagents/test/integration/foreground-result-size.test.ts +188 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +1306 -0
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +1033 -0
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +397 -0
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +583 -0
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +691 -0
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +892 -0
- package/dist/extensions/pi-subagents/test/integration/session-tokens.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +1824 -0
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +1284 -0
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +127 -0
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +299 -0
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +37 -0
- package/dist/extensions/pi-subagents/test/support/helpers.ts +189 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +335 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +129 -0
- package/dist/extensions/pi-subagents/test/support/real-session-child-cli.mjs +184 -0
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +285 -0
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +15 -0
- package/dist/extensions/pi-subagents/test/support/ts-loader.mjs +108 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +421 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +213 -0
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +343 -0
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +1199 -0
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +556 -0
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +420 -0
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +579 -0
- package/dist/extensions/pi-subagents/test/unit/agent-scope.test.ts +20 -0
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +88 -0
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +86 -0
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +221 -0
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +98 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +285 -0
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +112 -0
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +206 -0
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +159 -0
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +229 -0
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +225 -0
- package/dist/extensions/pi-subagents/test/unit/close-grace-timer.test.ts +101 -0
- package/dist/extensions/pi-subagents/test/unit/completion-batcher.test.ts +228 -0
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +36 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +152 -0
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +72 -0
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +327 -0
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +161 -0
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +159 -0
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +217 -0
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +88 -0
- package/dist/extensions/pi-subagents/test/unit/file-coalescer.test.ts +68 -0
- package/dist/extensions/pi-subagents/test/unit/foreground-tool-call-compaction.test.ts +78 -0
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +415 -0
- package/dist/extensions/pi-subagents/test/unit/get-final-output.test.ts +126 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +271 -0
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +173 -0
- package/dist/extensions/pi-subagents/test/unit/jsonl-writer.test.ts +119 -0
- package/dist/extensions/pi-subagents/test/unit/live-async-resume.test.ts +170 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +346 -0
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +87 -0
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +145 -0
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +162 -0
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +470 -0
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +329 -0
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +319 -0
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +70 -0
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +247 -0
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +803 -0
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +209 -0
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +238 -0
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +118 -0
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +299 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +408 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +134 -0
- package/dist/extensions/pi-subagents/test/unit/recursion-guard.test.ts +257 -0
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +209 -0
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +226 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +294 -0
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +147 -0
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +997 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +478 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +562 -0
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +213 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +438 -0
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +54 -0
- package/dist/extensions/pi-subagents/test/unit/slash-chain-groups.test.ts +464 -0
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +255 -0
- package/dist/extensions/pi-subagents/test/unit/status-format.test.ts +19 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +245 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +517 -0
- package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +72 -0
- package/dist/extensions/pi-subagents/test/unit/tool-budget.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +237 -0
- package/dist/extensions/pi-subagents/test/unit/total-cost.test.ts +60 -0
- package/dist/extensions/pi-subagents/test/unit/ts-loader.test.ts +33 -0
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +202 -0
- package/dist/extensions/pi-subagents/test/unit/types-fork-preamble.test.ts +23 -0
- package/dist/extensions/pi-subagents/test/unit/wait.test.ts +398 -0
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +88 -0
- package/dist/extensions/pi-subagents/test/unit/windows-hide-spawn.test.ts +26 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +134 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +479 -0
- package/dist/extensions/pi-web-agent/package.json +2 -2
- package/dist/extensions/pi-web-agent/src/backends/settings-reader.ts +2 -2
- package/dist/extensions/pi-web-agent/src/changelog-notice.ts +5 -2
- package/dist/extensions/pi-web-agent/src/commands/web-agent-config.ts +1 -1
- package/dist/extensions/pi-web-agent/src/extension.ts +1 -1
- package/dist/extensions/pi-web-agent/src/presentation/config-store.ts +6 -4
- package/dist/extensions/question/helpers.ts +3 -3
- package/dist/extensions/question/index.ts +2 -2
- package/dist/extensions/question/navigation.ts +2 -2
- package/dist/extensions/question/package.json +2 -2
- package/dist/extensions/question/question-list.ts +2 -2
- package/dist/extensions/question/tests/question-list.test.ts +2 -2
- package/dist/extensions/question/tui-adapter.ts +2 -2
- package/dist/extensions/question/types.ts +2 -2
- package/dist/extensions/question/ui-protocol.ts +2 -2
- package/dist/extensions/rtk.ts +2 -2
- package/dist/extensions/tokenin-onboarding.ts +2 -2
- package/dist/extensions/undo.ts +1 -1
- package/dist/extensions/web-agent-onboarding.ts +3 -3
- package/dist/extensions/workflow/adapter.ts +16 -8
- package/dist/extensions/workflow/extension.ts +1 -1
- package/dist/extensions/workflow/package.json +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +2 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +19 -5
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/skills/caveman/SKILL.md +49 -0
- package/dist/skills/handoff-text/SKILL.md +13 -0
- package/dist/utils/thinking-tags.d.ts +7 -0
- package/dist/utils/thinking-tags.d.ts.map +1 -0
- package/dist/utils/thinking-tags.js +63 -0
- package/dist/utils/thinking-tags.js.map +1 -0
- package/docs/docs.json +4 -0
- package/docs/extensions.md +2 -0
- package/docs/settings.md +15 -0
- package/docs/shared-host-extensions.md +109 -0
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { describe, it } from "node:test";
|
|
4
|
+
import {
|
|
5
|
+
getArtifactsDir,
|
|
6
|
+
getProjectArtifactsDir,
|
|
7
|
+
getProjectChainRunsDir,
|
|
8
|
+
getProjectSubagentsDir,
|
|
9
|
+
} from "../../src/shared/artifacts.ts";
|
|
10
|
+
|
|
11
|
+
describe("project-local artifact paths", () => {
|
|
12
|
+
it("places generated subagent files under .pi-subagents for a project cwd", () => {
|
|
13
|
+
const cwd = path.join("tmp", "repo");
|
|
14
|
+
assert.equal(getProjectSubagentsDir(cwd), path.join(cwd, ".pi-subagents"));
|
|
15
|
+
assert.equal(getProjectArtifactsDir(cwd), path.join(cwd, ".pi-subagents", "artifacts"));
|
|
16
|
+
assert.equal(getProjectChainRunsDir(cwd), path.join(cwd, ".pi-subagents", "chain-runs"));
|
|
17
|
+
assert.equal(getArtifactsDir(null, cwd), path.join(cwd, ".pi-subagents", "artifacts"));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("keeps the session artifact fallback when no project cwd is available", () => {
|
|
21
|
+
const sessionFile = path.join("tmp", "sessions", "parent.jsonl");
|
|
22
|
+
assert.equal(getArtifactsDir(sessionFile), path.join("tmp", "sessions", "subagent-artifacts"));
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { describe, it } from "node:test";
|
|
4
|
+
import { buildAsyncRunnerSteps, resolveAsyncRunnerLogPaths } from "../../src/runs/background/async-execution.ts";
|
|
5
|
+
import type { AgentConfig } from "../../src/agents/agents.ts";
|
|
6
|
+
|
|
7
|
+
const agent = (name: string, toolBudget?: AgentConfig["toolBudget"]): AgentConfig => ({
|
|
8
|
+
name,
|
|
9
|
+
description: `${name} agent`,
|
|
10
|
+
systemPromptMode: "replace",
|
|
11
|
+
inheritProjectContext: false,
|
|
12
|
+
inheritSkills: false,
|
|
13
|
+
systemPrompt: "You are a test agent.",
|
|
14
|
+
source: "project",
|
|
15
|
+
filePath: `${name}.md`,
|
|
16
|
+
...(toolBudget ? { toolBudget } : {}),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const ctx = {
|
|
20
|
+
cwd: process.cwd(),
|
|
21
|
+
currentSessionId: "session-1",
|
|
22
|
+
currentModel: undefined,
|
|
23
|
+
currentModelProvider: undefined,
|
|
24
|
+
modelScope: undefined,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
describe("async runner execution", () => {
|
|
28
|
+
it("places detached runner stdio logs in the async run directory", () => {
|
|
29
|
+
const asyncDir = path.join("tmp", "async-run");
|
|
30
|
+
assert.deepEqual(resolveAsyncRunnerLogPaths({ asyncDir }), {
|
|
31
|
+
stdoutPath: path.join(asyncDir, "runner.stdout.log"),
|
|
32
|
+
stderrPath: path.join(asyncDir, "runner.stderr.log"),
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("omits runner log paths when asyncDir is unavailable", () => {
|
|
37
|
+
assert.equal(resolveAsyncRunnerLogPaths({}), undefined);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("resolves async step tool budgets with step over run over agent over config precedence", () => {
|
|
41
|
+
const result = buildAsyncRunnerSteps("run-1", {
|
|
42
|
+
chain: [
|
|
43
|
+
{ agent: "worker", task: "agent beats config" },
|
|
44
|
+
{ agent: "worker", task: "step beats run", toolBudget: { hard: 2, block: ["grep"] } },
|
|
45
|
+
],
|
|
46
|
+
agents: [agent("worker", { hard: 4, block: ["read"] })],
|
|
47
|
+
ctx,
|
|
48
|
+
asyncDir: path.join(process.cwd(), ".tmp-async-test"),
|
|
49
|
+
maxSubagentDepth: 2,
|
|
50
|
+
toolBudget: { hard: 3, block: ["find"] },
|
|
51
|
+
configToolBudget: { hard: 5, block: ["ls"] },
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
assert.ok("steps" in result, "expected successful step build");
|
|
55
|
+
assert.deepEqual(result.steps[0]?.toolBudget, { hard: 3, block: ["find"] });
|
|
56
|
+
assert.deepEqual(result.steps[1]?.toolBudget, { hard: 2, block: ["grep"] });
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("uses agent tool budget before config default when no run override exists", () => {
|
|
60
|
+
const result = buildAsyncRunnerSteps("run-2", {
|
|
61
|
+
chain: [{ agent: "worker", task: "agent beats config" }],
|
|
62
|
+
agents: [agent("worker", { hard: 4, block: ["read"] })],
|
|
63
|
+
ctx,
|
|
64
|
+
asyncDir: path.join(process.cwd(), ".tmp-async-test"),
|
|
65
|
+
maxSubagentDepth: 2,
|
|
66
|
+
configToolBudget: { hard: 5, block: ["ls"] },
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
assert.ok("steps" in result, "expected successful step build");
|
|
70
|
+
assert.deepEqual(result.steps[0]?.toolBudget, { hard: 4, block: ["read"] });
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("uses config default when no step, run, or agent budget exists", () => {
|
|
74
|
+
const result = buildAsyncRunnerSteps("run-3", {
|
|
75
|
+
chain: [{ agent: "worker", task: "config default" }],
|
|
76
|
+
agents: [agent("worker")],
|
|
77
|
+
ctx,
|
|
78
|
+
asyncDir: path.join(process.cwd(), ".tmp-async-test"),
|
|
79
|
+
maxSubagentDepth: 2,
|
|
80
|
+
configToolBudget: { hard: 5, block: ["ls"] },
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
assert.ok("steps" in result, "expected successful step build");
|
|
84
|
+
assert.deepEqual(result.steps[0]?.toolBudget, { hard: 5, block: ["ls"] });
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as os from "node:os";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { describe, it } from "node:test";
|
|
6
|
+
import { consumeSteerRequests } from "../../src/runs/background/control-channel.ts";
|
|
7
|
+
import { createSubagentExecutor } from "../../src/runs/foreground/subagent-executor.ts";
|
|
8
|
+
import { ASYNC_DIR, RESULTS_DIR, type SubagentState } from "../../src/shared/types.ts";
|
|
9
|
+
|
|
10
|
+
function createState(): SubagentState {
|
|
11
|
+
return {
|
|
12
|
+
baseCwd: "",
|
|
13
|
+
currentSessionId: null,
|
|
14
|
+
asyncJobs: new Map(),
|
|
15
|
+
foregroundRuns: new Map(),
|
|
16
|
+
foregroundControls: new Map(),
|
|
17
|
+
lastForegroundControlId: null,
|
|
18
|
+
pendingForegroundControlNotices: new Map(),
|
|
19
|
+
cleanupTimers: new Map(),
|
|
20
|
+
lastUiContext: null,
|
|
21
|
+
poller: null,
|
|
22
|
+
completionSeen: new Map(),
|
|
23
|
+
watcher: null,
|
|
24
|
+
watcherRestartTimer: null,
|
|
25
|
+
resultFileCoalescer: { schedule: () => false, clear: () => {} },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function writeJson(filePath: string, value: object): void {
|
|
30
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
31
|
+
fs.writeFileSync(filePath, JSON.stringify(value, null, 2), "utf-8");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function createRunningAsync(state: SubagentState, runId: string, options: { track?: boolean } = {}): string {
|
|
35
|
+
const asyncDir = path.join(ASYNC_DIR, runId);
|
|
36
|
+
writeJson(path.join(asyncDir, "status.json"), {
|
|
37
|
+
runId,
|
|
38
|
+
mode: "single",
|
|
39
|
+
state: "running",
|
|
40
|
+
pid: 12345,
|
|
41
|
+
cwd: os.tmpdir(),
|
|
42
|
+
startedAt: 100,
|
|
43
|
+
lastUpdate: Date.now(),
|
|
44
|
+
steps: [{ agent: "worker", status: "running", startedAt: 100 }],
|
|
45
|
+
});
|
|
46
|
+
if (options.track !== false) {
|
|
47
|
+
state.asyncJobs.set(runId, {
|
|
48
|
+
asyncId: runId,
|
|
49
|
+
asyncDir,
|
|
50
|
+
status: "running",
|
|
51
|
+
pid: 12345,
|
|
52
|
+
agents: ["worker"],
|
|
53
|
+
updatedAt: 100,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return asyncDir;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function cleanup(runId: string, asyncDir: string): void {
|
|
60
|
+
fs.rmSync(asyncDir, { recursive: true, force: true });
|
|
61
|
+
fs.rmSync(path.join(RESULTS_DIR, `${runId}.json`), { force: true });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function executorWithKill(state: SubagentState, kill: (pid: number, signal?: NodeJS.Signals | 0) => boolean) {
|
|
65
|
+
return createSubagentExecutor({
|
|
66
|
+
pi: { events: { emit() {}, on() { return () => {}; } }, getSessionName() { return "parent"; } } as any,
|
|
67
|
+
state,
|
|
68
|
+
config: { maxSubagentDepth: 2, control: {}, intercomBridge: {} } as any,
|
|
69
|
+
asyncByDefault: false,
|
|
70
|
+
tempArtifactsDir: os.tmpdir(),
|
|
71
|
+
getSubagentSessionRoot: (parentSessionFile) => parentSessionFile ? path.join(path.dirname(parentSessionFile), path.basename(parentSessionFile, ".jsonl")) : os.tmpdir(),
|
|
72
|
+
expandTilde: (value) => value,
|
|
73
|
+
discoverAgents: () => ({ agents: [] }),
|
|
74
|
+
kill,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function ctx() {
|
|
79
|
+
return {
|
|
80
|
+
cwd: os.tmpdir(),
|
|
81
|
+
hasUI: false,
|
|
82
|
+
sessionManager: { getSessionId() { return "session"; }, getSessionFile() { return null; } },
|
|
83
|
+
modelRegistry: { getAvailable() { return []; } },
|
|
84
|
+
} as any;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function text(result: Awaited<ReturnType<ReturnType<typeof executorWithKill>["execute"]>>): string {
|
|
88
|
+
return result.content[0]?.type === "text" ? result.content[0].text : "";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
describe("async interrupt action", () => {
|
|
92
|
+
it("queues steering for a running async child", async () => {
|
|
93
|
+
const state = createState();
|
|
94
|
+
const runId = `steer-disk-${Date.now().toString(36)}`;
|
|
95
|
+
const asyncDir = createRunningAsync(state, runId, { track: false });
|
|
96
|
+
try {
|
|
97
|
+
const result = await executorWithKill(state, () => true)
|
|
98
|
+
.execute("steer", { action: "steer", id: runId, message: "Focus on tests." }, new AbortController().signal, undefined, ctx());
|
|
99
|
+
|
|
100
|
+
assert.equal(result.isError, undefined);
|
|
101
|
+
assert.match(text(result), new RegExp(`Steering queued for async run ${runId}`));
|
|
102
|
+
const requests = consumeSteerRequests(asyncDir);
|
|
103
|
+
assert.equal(requests.length, 1);
|
|
104
|
+
assert.equal(requests[0]?.message, "Focus on tests.");
|
|
105
|
+
assert.equal(requests[0]?.source, "steer-action");
|
|
106
|
+
assert.equal(requests[0]?.targetIndex, undefined);
|
|
107
|
+
} finally {
|
|
108
|
+
cleanup(runId, asyncDir);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("queues steering for a running async child by directory", async () => {
|
|
113
|
+
const state = createState();
|
|
114
|
+
const runId = `steer-dir-${Date.now().toString(36)}`;
|
|
115
|
+
const asyncDir = createRunningAsync(state, runId, { track: false });
|
|
116
|
+
try {
|
|
117
|
+
const result = await executorWithKill(state, () => true)
|
|
118
|
+
.execute("steer", { action: "steer", dir: asyncDir, message: "Focus on validation." }, new AbortController().signal, undefined, ctx());
|
|
119
|
+
|
|
120
|
+
assert.equal(result.isError, undefined);
|
|
121
|
+
assert.match(text(result), new RegExp(`Steering queued for async run ${runId}`));
|
|
122
|
+
const requests = consumeSteerRequests(asyncDir);
|
|
123
|
+
assert.equal(requests.length, 1);
|
|
124
|
+
assert.equal(requests[0]?.message, "Focus on validation.");
|
|
125
|
+
} finally {
|
|
126
|
+
cleanup(runId, asyncDir);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("queues steering for a pending indexed async child", async () => {
|
|
131
|
+
const state = createState();
|
|
132
|
+
const runId = `steer-pending-${Date.now().toString(36)}`;
|
|
133
|
+
const asyncDir = path.join(ASYNC_DIR, runId);
|
|
134
|
+
writeJson(path.join(asyncDir, "status.json"), {
|
|
135
|
+
runId,
|
|
136
|
+
mode: "chain",
|
|
137
|
+
state: "running",
|
|
138
|
+
pid: 12345,
|
|
139
|
+
cwd: os.tmpdir(),
|
|
140
|
+
startedAt: 100,
|
|
141
|
+
lastUpdate: Date.now(),
|
|
142
|
+
steps: [
|
|
143
|
+
{ agent: "done", status: "complete", startedAt: 100 },
|
|
144
|
+
{ agent: "later", status: "pending" },
|
|
145
|
+
],
|
|
146
|
+
});
|
|
147
|
+
try {
|
|
148
|
+
const result = await executorWithKill(state, () => true)
|
|
149
|
+
.execute("steer", { action: "steer", id: runId, index: 1, message: "Use the new API." }, new AbortController().signal, undefined, ctx());
|
|
150
|
+
|
|
151
|
+
assert.equal(result.isError, undefined);
|
|
152
|
+
const requests = consumeSteerRequests(asyncDir);
|
|
153
|
+
assert.equal(requests.length, 1);
|
|
154
|
+
assert.equal(requests[0]?.message, "Use the new API.");
|
|
155
|
+
assert.equal(requests[0]?.targetIndex, 1);
|
|
156
|
+
} finally {
|
|
157
|
+
cleanup(runId, asyncDir);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("interrupts a running async run resolved from disk after in-memory tracking is gone", async () => {
|
|
162
|
+
const state = createState();
|
|
163
|
+
const runId = `interrupt-disk-${Date.now().toString(36)}`;
|
|
164
|
+
const asyncDir = createRunningAsync(state, runId, { track: false });
|
|
165
|
+
try {
|
|
166
|
+
const kills: Array<{ pid: number; signal?: NodeJS.Signals | 0 }> = [];
|
|
167
|
+
const result = await executorWithKill(state, (pid, signal) => {
|
|
168
|
+
kills.push({ pid, signal });
|
|
169
|
+
return true;
|
|
170
|
+
}).execute("interrupt", { action: "interrupt", id: runId }, new AbortController().signal, undefined, ctx());
|
|
171
|
+
|
|
172
|
+
assert.equal(result.isError, undefined);
|
|
173
|
+
assert.match(text(result), new RegExp(`Interrupt requested for async run ${runId}`));
|
|
174
|
+
assert.equal(fs.existsSync(path.join(asyncDir, "control", "interrupt.json")), true);
|
|
175
|
+
assert.deepEqual(kills, [{ pid: 12345, signal: 0 }, { pid: 12345, signal: process.platform === "win32" ? "SIGBREAK" : "SIGUSR2" }]);
|
|
176
|
+
} finally {
|
|
177
|
+
cleanup(runId, asyncDir);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("reports success and writes the portable request when the signal is unavailable", async () => {
|
|
182
|
+
const state = createState();
|
|
183
|
+
const runId = `interrupt-enosys-${Date.now().toString(36)}`;
|
|
184
|
+
const asyncDir = createRunningAsync(state, runId);
|
|
185
|
+
try {
|
|
186
|
+
const result = await executorWithKill(state, (_pid, signal) => {
|
|
187
|
+
if (signal === 0) return true;
|
|
188
|
+
const error = new Error("kill ENOSYS") as NodeJS.ErrnoException;
|
|
189
|
+
error.code = "ENOSYS";
|
|
190
|
+
throw error;
|
|
191
|
+
}).execute("interrupt", { action: "interrupt", id: runId }, new AbortController().signal, undefined, ctx());
|
|
192
|
+
|
|
193
|
+
assert.equal(result.isError, undefined);
|
|
194
|
+
assert.match(text(result), new RegExp(`Interrupt requested for async run ${runId}`));
|
|
195
|
+
assert.equal(fs.existsSync(path.join(asyncDir, "control", "interrupt.json")), true);
|
|
196
|
+
} finally {
|
|
197
|
+
cleanup(runId, asyncDir);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it("does not report success for stale running status with a dead pid", async () => {
|
|
202
|
+
const state = createState();
|
|
203
|
+
const runId = `interrupt-esrch-${Date.now().toString(36)}`;
|
|
204
|
+
const asyncDir = createRunningAsync(state, runId);
|
|
205
|
+
try {
|
|
206
|
+
const result = await executorWithKill(state, () => {
|
|
207
|
+
const error = new Error("missing process") as NodeJS.ErrnoException;
|
|
208
|
+
error.code = "ESRCH";
|
|
209
|
+
throw error;
|
|
210
|
+
}).execute("interrupt", { action: "interrupt", id: runId }, new AbortController().signal, undefined, ctx());
|
|
211
|
+
|
|
212
|
+
assert.equal(result.isError, true);
|
|
213
|
+
assert.match(text(result), /No running async run with an interrupt-capable pid/);
|
|
214
|
+
assert.equal(fs.existsSync(path.join(asyncDir, "control", "interrupt.json")), false);
|
|
215
|
+
const status = JSON.parse(fs.readFileSync(path.join(asyncDir, "status.json"), "utf-8"));
|
|
216
|
+
assert.equal(status.state, "failed");
|
|
217
|
+
} finally {
|
|
218
|
+
cleanup(runId, asyncDir);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { describe, it } from "node:test";
|
|
4
|
+
import type { AgentConfig } from "../../src/agents/agents.ts";
|
|
5
|
+
import { buildAsyncRunnerSteps } from "../../src/runs/background/async-execution.ts";
|
|
6
|
+
|
|
7
|
+
function makeAgent(name: string): AgentConfig {
|
|
8
|
+
return {
|
|
9
|
+
name,
|
|
10
|
+
description: `${name} agent`,
|
|
11
|
+
systemPrompt: "Do work",
|
|
12
|
+
systemPromptMode: "replace",
|
|
13
|
+
inheritProjectContext: false,
|
|
14
|
+
inheritSkills: false,
|
|
15
|
+
source: "project",
|
|
16
|
+
filePath: `/tmp/${name}.md`,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe("async permission forwarding session identity", () => {
|
|
21
|
+
it("uses the parent session id for permission forwarding instead of the async status identity", () => {
|
|
22
|
+
const currentSessionId = path.join("/tmp", "parent-session.jsonl");
|
|
23
|
+
const built = buildAsyncRunnerSteps("run-abc", {
|
|
24
|
+
chain: [{ agent: "worker", task: "Do work" }],
|
|
25
|
+
agents: [makeAgent("worker")],
|
|
26
|
+
ctx: {
|
|
27
|
+
pi: {} as never,
|
|
28
|
+
cwd: "/tmp/project",
|
|
29
|
+
currentSessionId,
|
|
30
|
+
parentSessionId: "session-abc123",
|
|
31
|
+
},
|
|
32
|
+
maxSubagentDepth: 1,
|
|
33
|
+
asyncDir: "/tmp/async-run",
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
assert.ok(!("error" in built));
|
|
37
|
+
const step = built.steps[0];
|
|
38
|
+
assert.ok(step && !("parallel" in step));
|
|
39
|
+
assert.equal(step.parentSessionId, "session-abc123");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("consumes bounded dynamic fanout indexes before later static forked steps", () => {
|
|
43
|
+
const built = buildAsyncRunnerSteps("run-abc", {
|
|
44
|
+
chain: [
|
|
45
|
+
{ agent: "source", task: "produce targets", as: "targets" },
|
|
46
|
+
{
|
|
47
|
+
expand: { from: { output: "targets", path: "/items" }, maxItems: 2 },
|
|
48
|
+
parallel: { agent: "reviewer", task: "Review {item.path}" },
|
|
49
|
+
collect: { as: "reviews" },
|
|
50
|
+
},
|
|
51
|
+
{ agent: "worker", task: "Use reviews" },
|
|
52
|
+
],
|
|
53
|
+
agents: [makeAgent("source"), makeAgent("reviewer"), { ...makeAgent("worker"), model: "anthropic/claude-sonnet-4-5:high", thinking: "high" }],
|
|
54
|
+
ctx: {
|
|
55
|
+
pi: {} as never,
|
|
56
|
+
cwd: "/tmp/project",
|
|
57
|
+
currentSessionId: "/tmp/parent-session.jsonl",
|
|
58
|
+
},
|
|
59
|
+
sessionFilesByFlatIndex: [undefined, "/tmp/dynamic-0.jsonl", "/tmp/dynamic-1.jsonl", "/tmp/static-worker.jsonl"],
|
|
60
|
+
thinkingOverridesByFlatIndex: [undefined, "off", "off", "off"],
|
|
61
|
+
maxSubagentDepth: 1,
|
|
62
|
+
asyncDir: "/tmp/async-run",
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
assert.ok(!("error" in built));
|
|
66
|
+
const dynamic = built.steps[1];
|
|
67
|
+
assert.ok(dynamic && "expand" in dynamic && "collect" in dynamic);
|
|
68
|
+
assert.deepEqual(dynamic.sessionFiles, ["/tmp/dynamic-0.jsonl", "/tmp/dynamic-1.jsonl"]);
|
|
69
|
+
assert.deepEqual(dynamic.thinkingOverrides, ["off", "off"]);
|
|
70
|
+
const staticWorker = built.steps[2];
|
|
71
|
+
assert.ok(staticWorker && !("parallel" in staticWorker));
|
|
72
|
+
assert.equal(staticWorker.sessionFile, "/tmp/static-worker.jsonl");
|
|
73
|
+
assert.equal(staticWorker.model, "anthropic/claude-sonnet-4-5:off");
|
|
74
|
+
assert.equal(staticWorker.thinking, "off");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("applies thinking overrides to async fallback candidates", () => {
|
|
78
|
+
const built = buildAsyncRunnerSteps("run-abc", {
|
|
79
|
+
chain: [{ agent: "worker", task: "Do work" }],
|
|
80
|
+
agents: [{ ...makeAgent("worker"), model: "openai/gpt-5-mini:high", fallbackModels: ["anthropic/claude-sonnet-4:low"], thinking: "high" }],
|
|
81
|
+
ctx: {
|
|
82
|
+
pi: {} as never,
|
|
83
|
+
cwd: "/tmp/project",
|
|
84
|
+
currentSessionId: "/tmp/parent-session.jsonl",
|
|
85
|
+
},
|
|
86
|
+
thinkingOverridesByFlatIndex: ["off"],
|
|
87
|
+
maxSubagentDepth: 1,
|
|
88
|
+
asyncDir: "/tmp/async-run",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
assert.ok(!("error" in built));
|
|
92
|
+
const step = built.steps[0];
|
|
93
|
+
assert.ok(step && !("parallel" in step));
|
|
94
|
+
assert.equal(step.model, "openai/gpt-5-mini:off");
|
|
95
|
+
assert.deepEqual(step.modelCandidates, ["openai/gpt-5-mini:off", "anthropic/claude-sonnet-4:off"]);
|
|
96
|
+
assert.equal(step.thinking, "off");
|
|
97
|
+
});
|
|
98
|
+
});
|