Commit graph

2 commits

Author SHA1 Message Date
Pascal André
7f0dec7722
feat(opencode): require OpenCode 2.3.0 and adapt subagent, Code Mode and shell results (#1491)
OpenCode 2.3 runs every subagent in the background: the call returns at once
(`metadata.status: "running"`) and the child reports to its parent through
synthetic `<subagent sessionID state …>` messages, one per idle period,
tagged `running` while background work remains. Runtime contracts on
`latest` failed for every PR since 2.3.0 because two native fixtures assumed
a foreground subagent, and the subagent card showed the model-facing "working
in the background" instruction instead of the child's result.

OpenCode 2.3.0 becomes the minimum and recommended runtime, so CodeNomad
maintains a single subagent delivery model. Daemons below it are refused with
`native_contract`. The client, schema and plugin pins move to 2.3.0 with the
`effect` 4.1.0 they require; the lockfile is regenerated with the CI's npm so
root overrides hold. Docs, the architecture skill, README, CONTRIBUTING and
the install, OpenCode, server and troubleshooting help in ten languages state
the new minimum.

- Native fixtures (missions-trajectory, subagent-nesting) require the launch
  acknowledgement, an intermediate running report (metadata still
  `completed`), the final report and lasting quiescence without late wakes.
  Wayfinder and compare read briefs, run outputs and the judge artifact from
  the final report.
- The subagent card shows the latest report delivered to that call (after its
  execution start, before the next continuation of the same child; a call
  continued before any report joins the next reporting period) with a
  running/completed/error indicator. One reference-only index per session
  revision serves every card; report bodies stay in the message store.
- Code Mode's compact JSON object/array results are displayed indented within
  size and depth bounds, keeping Warnings/Logs; copy keeps the native text.
- An interrupted shell call shows its output so far as output and only the
  notice under the error label, through an optional `getErrorText` hook.

Five independent review passes closed listing-order, continuation, JSON depth,
fixture timing, cache staleness, execution-start boundary, joined-period,
retention and lockfile-override findings and ended with zero findings. CI on
the exact head: 26 jobs passed, including runtime contracts at minimum and
latest (2.3.0), OpenCode compatibility and native pruning on Windows, Ubuntu
and macOS, four browser shards and all desktop builds. Locally: 30/30 native
fixtures against an isolated 2.3.0 CLI, the full server suite under Node 24,
and the pruning fixtures on the rebuilt bundle bytes; new unit and browser
tests each fail without their change.
2026-11-13 17:38:29 +01:00
Pascal André
fb44655cdd
fix(missions): enable General delegation with project depth overrides (#1217)
Setting a project subagent depth did not enable nested delegation for
OpenCode's General agent, whose built-in permission still denies the
subagent tool. Treat a project depth override as the user's explicit
request to enable delegation up to that depth.

Saving any override, including 0 and 1, writes one CodeNomad-marked allow
rule in the project's existing General config block. Keep OpenCode's
depth semantics: 0 disables delegation and 1 prevents further nesting.
The Inherit button and an empty field remove the override and marked
rules, preserving unmarked user permissions and pre-existing containers.
Explain the project rule's precedence and display OpenCode's resolved
General permission state. If a legacy config cannot safely accept the
rule, save the depth and explicitly warn that General's permission needs
manual adjustment.

Use OpenCode's winning agents/mode/agent block rather than creating a
native block that shadows legacy prompts, limits or edit/shell denials.
Keep JSONC comments and formatting, follow the winning block when config
changes and record ownership of created containers for safe removal.
No checkbox or admission/freshness/frontmatter-scanning machinery is
needed. The documentation and help in ten locales explain the behavior
and cite upstream anomalyco/opencode#60961.

Validation covers native and legacy blocks, precedence, idempotence,
marked-rule migration/removal, pre-existing empty containers, partial
permissions and the explicit warning. Server, browser, i18n, help and
typechecks pass. An isolated OpenCode 2.2.5 run verifies depth 2 nesting,
depth 1 and 0 limits, preservation of legacy General settings and
restoration after Inherit. Six review rounds resolved all actionable
findings; the rebased patches are unchanged and the complete CI is green
at d7cf2d35, including desktop builds.
2026-11-01 07:10:26 +01:00