Repository navigation
Commit bc843bb
test(opencode): add headless E2E + background-abort-mix coverage for nested subagents
Issue 8 (nested-headless.test.ts): a full headless end-to-end against the
REAL server prompt loop (the entrypoint `opencode run`/`opencode serve` reach
over the instance HTTP API, not the in-process `SessionPrompt.loop` seam the
T7 suite drives). Drives `sdk.session.prompt` over the wire against a
deterministic TestLLMServer and reads back the persisted session tree plus the
per-level request bodies. Covers a depth-3 spawn chain (tree nests, results
bubble up, level-at-maxDepth loses task+workflow at the wire), the typed
SubagentResumeError surfacing for an ancestor resume instead of hanging, and
the SubagentTreeLimitError once the lifetime cap is exhausted.
Issue 9 (nested-background-abort.test.ts): the abort cascade is covered for
pure-foreground chains and a pure-background release race, but not the MIX.
Drives a parent with background AND foreground children live at once across
levels through the real prompt loop with experimental background subagents on,
aborts the parent, and verifies every child of both modes terminates with no
orphaned background job, the release-race fix (5582da5) stays closed, and
cancel never blocks on the foreground hang (no permit/budget wait).
task.ts: the three no-unsafe-type-assertion oxlint warnings are false
positives — the casts narrow the intentionally loose `ctx.extra:
{ [key: string]: unknown }` tool bag and are load-bearing (removing any one
breaks the typecheck). Suppressed with targeted oxlint-disable-next-line
directives plus a rationale; no logic change.
Co-Authored-By: Claude Fable 5 <[email protected]>1 parent 11c850a commit bc843bb
3 files changed
Lines changed: 867 additions & 2 deletions
File tree
- packages/opencode
- src/tool
- test/session
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
| |||
286 | 292 | | |
287 | 293 | | |
288 | 294 | | |
289 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
290 | 298 | | |
291 | 299 | | |
292 | 300 | | |
| |||
0 commit comments