@nandoblanco/opencode-relay-orchestration 0.3.0 → 1.0.0
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 +5 -0
- package/README.md +6 -4
- package/package.json +1 -1
- package/src/planner.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0 (2026-11-27)
|
|
4
|
+
|
|
5
|
+
- Fail fast in `/relay` (`src/planner.ts`) before creating a draft record, switching models, or prompting when required worker roles (`builder`, `reviewer`) are not configured, pointing the user to `/relay-configure`.
|
|
6
|
+
- Documented the no-default-models behavior, up-front `builder`/`reviewer` check, and optional `planner`/`explorer` fallbacks in `README.md`.
|
|
7
|
+
|
|
3
8
|
## 0.3.0 (2026-11-26)
|
|
4
9
|
|
|
5
10
|
- Add `brainstormFirst` configuration option (default `true`) to `src/config.ts`, `src/rpc.ts`, `src/server.ts`, and `src/planner.ts`. When enabled, `/relay` leads with an explicit two-phase prompt (**Phase 1: Brainstorm first**, blocking `relay_plan_add` / `relay_plan_submit` until the planner explores read-only, presents 2-3 approaches with tradeoffs, risks, and non-goals, and aligns via `question`; **Phase 2: Draft and submit** only after the user confirms direction, or `relay_plan_cancel` if abandoned). Expose the toggle in `/relay-configure` (10 batched questions: 4 jobs + 6 settings), `relay_config_set`, `validateConfig`, and `configSummary` (`brainstorm on|off`).
|
package/README.md
CHANGED
|
@@ -102,6 +102,8 @@ npm run build
|
|
|
102
102
|
|
|
103
103
|
### Interactive Setup (`/relay-configure`)
|
|
104
104
|
|
|
105
|
+
Relay ships with no hardcoded default models. Configure at least `builder` and `reviewer` before running `/relay` (either with `/relay-configure` or static `options.roles` in `opencode.jsonc`). Leaving `planner` unset runs planning on your current session model; leaving `explorer` unset omits `relay_explore`.
|
|
106
|
+
|
|
105
107
|
Run `/relay-configure` inside an OpenCode session. Relay queries your currently enabled models and presents one batched `question` prompt containing 10 questions (4 role assignments + 6 settings):
|
|
106
108
|
|
|
107
109
|
1. **Roles**: `planner`, `builder`, `reviewer` (image-capable models only), and `explorer`, each offering top 3 recommended candidates plus write-in support and optional variants.
|
|
@@ -111,7 +113,7 @@ Confirmed settings are validated by `validateSettings()` and persisted to plugin
|
|
|
111
113
|
|
|
112
114
|
### Orchestration Workflow (`/relay <task>`)
|
|
113
115
|
|
|
114
|
-
1. **Brainstorm first (`/relay <task>`)**: Relay creates a `draft` record bound to the current session, temporarily switches the session model to
|
|
116
|
+
1. **Brainstorm first (`/relay <task>`)**: Relay first verifies that `builder` and `reviewer` models are configured; if either is missing, `/relay` fails fast before creating a draft record, switching models, or starting a model turn and directs you to `/relay-configure`. Otherwise it creates a `draft` record bound to the current session, temporarily switches the session model to `roles.planner` when configured (keeping the current session model if `planner` is unset, and restoring the previous model on submission, cancellation, or closure), and enters **Phase 1: Brainstorm first** (when `brainstormFirst` is `true`, the default). The planner explores read-only (including via `relay_explore`), surfaces assumptions, presents 2-3 approaches with tradeoffs, risks, and non-goals, and aligns with you via `question` before calling any plan tools (with a fast-track option to draft immediately, or `relay_plan_cancel` if you decide not to build).
|
|
115
117
|
2. **Draft plan**: Once you confirm direction (or immediately when `brainstormFirst` is `false` and requirements are clear), the planner adds tasks (strings or `{ title, allowedPaths }`) and verification checks with `relay_plan_add`.
|
|
116
118
|
3. **Approve plan**: Calling `relay_plan_submit` opens OpenCode's native `relay.approve` permission prompt pinned to the exact `planRevision`. Unneeded drafts can be closed with `relay_plan_cancel`, and pending requests can be withdrawn via `/relay-withdraw` or the GUI.
|
|
117
119
|
4. **Build, verify, review**:
|
|
@@ -133,7 +135,7 @@ Confirmed settings are validated by `validateSettings()` and persisted to plugin
|
|
|
133
135
|
|
|
134
136
|
| Command | Description |
|
|
135
137
|
| :--- | :--- |
|
|
136
|
-
| `/relay <task>` |
|
|
138
|
+
| `/relay <task>` | Verify `builder` and `reviewer` models are configured (failing fast to `/relay-configure` if missing), create a `draft` Relay record, switch to `roles.planner` when set, brainstorm first (when `brainstormFirst` is enabled), and draft/submit a plan for human approval |
|
|
137
139
|
| `/relay-configure` | Discover enabled OpenCode models and image capabilities, run the 10-question batched setup prompt, and save validated settings via `relay_config_set` |
|
|
138
140
|
|
|
139
141
|
### TUI & Desktop Panel Commands (Zero-Token)
|
|
@@ -178,7 +180,7 @@ Confirmed settings are validated by `validateSettings()` and persisted to plugin
|
|
|
178
180
|
|
|
179
181
|
`src/planner.ts` registers `/relay`, `/relay-configure`, and the six planner tools (`relay_plan_add`, `relay_plan_submit`, `relay_plan_cancel`, `relay_status`, `relay_explore`, `relay_config_set`):
|
|
180
182
|
|
|
181
|
-
- When `/relay <task>` runs, Relay creates a `draft` record bound to `input.sessionID`, records the session's starting token totals (`tokensAtStart`), switches the session model to `roles.planner
|
|
183
|
+
- When `/relay <task>` runs, Relay first checks effective configuration for `models.builder` and `models.reviewer` and fails fast with a `/relay-configure` message if either is missing (before creating a draft record, switching models, or prompting). When configured, it creates a `draft` record bound to `input.sessionID`, records the session's starting token totals (`tokensAtStart`), switches the session model to `roles.planner` if configured (otherwise keeping the current session model), and restores `previousModel` (recording `tokensAtEnd`) when the plan is submitted, cancelled, or closed.
|
|
182
184
|
- When `brainstormFirst !== false`, the prompt enforces **Phase 1: Brainstorm first** (prohibiting `relay_plan_add` and `relay_plan_submit` until read-only exploration, 2-3 approaches with tradeoffs/risks/non-goals, and `question` alignment complete) followed by **Phase 2: Draft and submit plan**. When `brainstormFirst === false`, the planner clarifies only when requirements are ambiguous, conflicting, or high-risk.
|
|
183
185
|
- `relay_explore` launches a read-only child session using `roles.explorer` with `edit`, `write`, `shell`, `subagent`, `question`, `relay.*`, and all planner/worker tools denied.
|
|
184
186
|
|
|
@@ -283,7 +285,7 @@ Configure defaults under `"options"` in `~/.config/opencode/opencode.jsonc`, or
|
|
|
283
285
|
|
|
284
286
|
| Option | Env Variable | Default | Description |
|
|
285
287
|
| :--- | :--- | :--- | :--- |
|
|
286
|
-
| `roles.<role>` | *(none)* | *(unset)* | `{ providerID, id, variant? }` assignment
|
|
288
|
+
| `roles.<role>` | *(none)* | *(unset)* | `{ providerID, id, variant? }` assignment. No default models are shipped: `builder` and `reviewer` (must support `image` input) are required before `/relay` starts; `planner` is optional (uses the current session model if unset) and `explorer` is optional (omits `relay_explore` if unset) |
|
|
287
289
|
| `limits.maxRunningTasks` | *(none)* | `1` | Maximum concurrent tasks (`1` to `4` via `/relay-configure`) |
|
|
288
290
|
| `limits.maxFixCycles` | *(none)* | `2` | Maximum builder fix retries per task after reviewer `changes` verdicts (`0` to `5` via `/relay-configure`) |
|
|
289
291
|
| `widths` | *(none)* | `[1280, 390]` | `1` to `4` integer viewport widths (`320` to `3840`) required for Playwright UI checks and reviewer visual checks |
|
package/package.json
CHANGED
package/src/planner.ts
CHANGED
|
@@ -55,8 +55,11 @@ export async function registerPlanner(ctx: Plugin.Context, planner: Planner) {
|
|
|
55
55
|
if ((await planner.store.list()).some(record => record.sessionID === input.sessionID && !['completed', 'cancelled'].includes(record.phase))) throw new Tool.Error({ message: 'This session already owns an active Relay record. Finish or cancel it before running /relay again.' })
|
|
56
56
|
const title = planner.cleanTitle(input.prompt.text, 500)
|
|
57
57
|
if (!title) throw new Tool.Error({ message: 'Use /relay <task> with a nonempty task description.' })
|
|
58
|
+
const base = effectiveConfig(ctx.options)
|
|
59
|
+
const configured = planner.config ? await planner.config() : { ...base, models: { ...base.models, ...(planner.model ? { planner: planner.model } : {}), ...(planner.explorer ? { explorer: planner.explorer } : {}) } }
|
|
60
|
+
const missing = (['builder', 'reviewer'] as const).filter(role => !configured.models[role])
|
|
61
|
+
if (missing.length) throw new Tool.Error({ message: `Relay models are not configured for: ${missing.join(', ')}. Run /relay-configure before running /relay.` })
|
|
58
62
|
const session = await ctx.session.get({ sessionID: input.sessionID })
|
|
59
|
-
const configured = planner.config ? await planner.config() : { ...effectiveConfig(ctx.options), models: { ...(planner.model ? { planner: planner.model } : {}), ...(planner.explorer ? { explorer: planner.explorer } : {}) } }
|
|
60
63
|
const plannerModel = configured ? configured.models.planner : planner.model
|
|
61
64
|
let model = session.model
|
|
62
65
|
let switched = false
|