GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: agent steering, a live TUI progress tree, and per-agent model d… · rphang/opencode-workflows@d063028

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • AGENTS.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • docs
    • E2E.md
    • INSTALL.md
    • OPENCODE-API-NOTES.md
    • PARITY.md
    • SCRIPT-API.md
    • assets
      • live-tree-done.png
      • live-tree-narrow.png
      • live-tree-open-agent.png
      • live-tree-running.png
      • live-tree-steer.png
      • live-tree-stop.png
    • design
      • steering-and-live-tree.md
  • package-lock.json
  • package.json
  • scripts
    • build-tui.ts
    • build.ts
  • src
    • engine.ts
    • journal.ts
    • mailbox.ts
    • opencode
      • model.ts
      • runner.ts
      • steer.ts
    • plugin
      • activity.ts
      • commands.ts
      • format.ts
      • host.ts
      • live.ts
      • rpc-def.ts
      • rpc.ts
      • setup.ts
      • tools.ts
    • store.ts
    • tui
      • index.tsx
      • panel.tsx
      • store.ts
    • types.ts
  • tests
    • e2e
      • basic.test.ts
      • harness.test.ts
      • harness.ts
      • steer.test.ts
    • helpers
      • fake-opencode-ctx.ts
      • fake-runner.ts
      • plugin-harness.ts
    • parity
      • coverage.test.ts
      • extensions.test.ts
      • live-tree.test.ts
      • tool-surface.test.ts
      • tui.test.ts
    • unit
      • activity.test.ts
      • engine.test.ts
      • install-docs.test.ts
      • journal.test.ts
      • live.test.ts
      • mailbox.test.ts
      • opencode-runner.test.ts
      • plugin.test.ts
      • runner-steer.test.ts
      • steer.test.ts
  • tsconfig.build.json
  • tsconfig.json
  • tui.tsx

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎AGENTS.md‎

Copy file name to clipboardExpand all lines: AGENTS.md
+14-3Lines changed: 14 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ the repo).
1717
- Do not add dependencies without discussing it first. Dependencies: `@opencode/codemode`,
1818
`@opencode/plugin` (use **`import type` only** from it — the runtime does not need it),
1919
`acorn`, `ajv`, `effect`, all pinned to opencode 2.0.15 (`effect` must stay the exact version
20-
`@opencode/codemode` depends on, so both share one copy).
20+
`@opencode/codemode` depends on, so both share one copy). The TUI build adds devDependencies only
21+
(`@opentui/core`, `@opentui/solid` 0.5.10 and `solid-js` 1.9.15, opencode 2.0.15's catalog, with an
22+
npm `overrides` for `solid-js` like opencode's own); the TUI provides them at runtime.
2123
- The engine (`src/engine.ts` and friends) is host-agnostic. Everything opencode-specific lives in
2224
`src/opencode/`. Engine tests use the fake runner in `tests/helpers/`.
25+
- The TUI companion (live progress tree) lives in `src/tui/`: `store.ts` is pure and unit-tested; the
26+
`.tsx` files only render. The server entry (`src/index.ts`) must never import it. `dist/tui.js` is
27+
built by `scripts/build-tui.ts` with the host modules external.
2328
- Every PARITY ID needs a test in `tests/parity/` whose name starts with the ID.
2429
- Plain TypeScript, ESM. Bun loads `.ts` directly in development; `npm run build` produces the
2530
published `dist/` bundle.
@@ -43,10 +48,14 @@ repo (`.sandbox/` is git-ignored):
4348

4449
```sh
4550
export XDG_DATA_HOME=$PWD/.sandbox/data XDG_CONFIG_HOME=$PWD/.sandbox/config \
46-
XDG_STATE_HOME=$PWD/.sandbox/state XDG_CACHE_HOME=$PWD/.sandbox/cache
51+
XDG_STATE_HOME=$PWD/.sandbox/state XDG_CACHE_HOME=$PWD/.sandbox/cache \
52+
OPENCODE_TEST_HOME=$PWD/.sandbox # else opencode also loads this repo's AGENTS.md
4753
npx opencode2 run --standalone --auto --format json -m openai/gpt-5.4-mini "..."
4854
```
4955

56+
Do not edit `src/` while a live run is in progress: opencode reloads the plugin when its source
57+
files change.
58+
5059
The automated suite does this for you: `OPENCODE_E2E=1 npx bun test tests/e2e --timeout 600000`
5160
with `OPENAI_API_KEY` set (see `docs/E2E.md`). Child sessions default to a free `opencode/*`
5261
model. Plugin logs: `.sandbox/data/opencode/log/opencode.log`. Plugin `console` output is not
@@ -63,8 +72,10 @@ messages; assistant messages are `{type:"assistant", content:[{type:"text", text
6372

6473
## Docs map
6574

66-
- `docs/PARITY.md` — behavior spec, one ID per behavior, each with a parity test.
75+
- `docs/PARITY.md` — behavior spec, one ID per behavior, each with a parity test (`P` = Claude Code
76+
parity, `X` = extensions marked `EXT`).
6777
- `docs/E2E.md` — live test harness, known gotchas, the demo script.
6878
- `docs/OPENCODE-API-NOTES.md` — observed opencode 2.0.15 plugin API behavior.
79+
- `docs/design/` — approved designs for features beyond Claude Code (steering, live progress tree).
6980
- `docs/notes/` — maintainer notes and drafts (not published anywhere).
7081
- `docs/assets/` — images used by the README.
Collapse file

‎CHANGELOG.md‎

Copy file name to clipboardExpand all lines: CHANGELOG.md
+84Lines changed: 84 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,90 @@ may contain breaking changes.
88

99
## [Unreleased]
1010

11+
### Added
12+
13+
- **Steering a running agent** (an extension beyond Claude Code; PARITY X01–X09). Send an instruction
14+
to a running workflow agent without restarting it: `/workflows msg <runId> <target> <text>` (user),
15+
or `workflow_control` with `action: "message"` (the parent model, when you ask). Targets: an agent
16+
index (`3`/`#3`), an exact label, `@phase` or `*`. The agent reads the message at its next step
17+
boundary, and its `agent()` result is its reply after the message; a message that arrives as the
18+
agent finishes is still answered. `msg!` / `urgent: true` also interrupts the current step (its
19+
tokens are lost). Messages to a queued agent are held and added to its first prompt. Messages are
20+
journaled; a steered agent is never reused on resume, so it and every later agent run again.
21+
`/workflows <runId>`, `agents/<i>.json` and the task notification (`<steering>`) show them.
22+
- **Live progress tree in the TUI** (an extension; PARITY X10–X16). `ctrl+x o` (or `/wf`) opens a
23+
panel with the session's runs → phases (model label, counts, tokens, elapsed) → agents (status,
24+
tokens, elapsed, the model it runs on, and what each running agent is doing right now). Enter
25+
opens an agent's child session, `x` stops an agent or the run after a confirmation, `p`
26+
pauses/resumes, `m`/`M` sends a message (steering), `a` switches between this session's runs and the whole project. The prompt
27+
footer shows `wf <name> <done>/<total> · <tokens> · $<cost>`. A finished run sends a desktop
28+
notification when the terminal is unfocused (with `attention.notifications` in `cli.json`), or a
29+
toast. The package gains a `./tui` export (`dist/tui.js`, precompiled; no new runtime
30+
dependencies) and the repo a root `tui.tsx` for directory installs.
31+
- **`dynamic-workflows` RPC** (X12, X13): `list`, `status` and `control` over opencode's server API
32+
(`POST /api/rpc/dynamic-workflows/<method>`), and `delta` (at most 4 per second) / `finished`
33+
events on `/api/event`. The TUI uses it; scripts and other clients can too.
34+
- **Phase model labels** (X10): the `model` of a `meta.phases` entry is now shown next to the phase
35+
in `/workflows`, `/workflows <runId>`, `workflow_control` status/list, run.json and the tree, as
36+
Claude Code shows it. It is a label only: agents still take their model from `agent(…, {model})`.
37+
- **Live agent activity** (X11): `/workflows <runId>` shows, for each running agent, its last tool
38+
call or the last words it wrote and its live tokens/cost. `workflow_control status` shows the tool calls but only `writing…` / `thinking…` for text, so the
39+
model never gets a partial result (P77). Display only: recorded usage and `budget.spent()` are
40+
unchanged.
41+
- **The model each agent actually runs on** (X18, X19). Each agent records its model as
42+
`provider/model#variant` (the variant only when set; opencode's `default` variant counts as none):
43+
the child session's model as opencode reports it, else the requested one (`opts.model`, else the
44+
parent session's model, plus the `effort` variant). It is saved in `agents/<i>.json` (`model`) as
45+
soon as the child session exists and on the journal result line, and a cached agent keeps it on
46+
resume (older journals take it from the old run's agent record). If opencode runs the agent on
47+
another model than requested, the agent gets the warning
48+
`model: requested X but the agent runs on Y`. Shown as a `model:` line per agent in
49+
`/workflows <runId>` and `workflow_control` status, in the RPC agent views and on the tree's agent
50+
rows (shortened when the panel is narrow: provider first, then variant). A phase without a
51+
`meta.phases[].model` label shows the model its agents share (`agentModel` in run.json).
52+
- **Read-only RPC switch** (X17): `OPENCODE_WORKFLOW_RPC_CONTROL=0` or the plugin option
53+
`rpcControl: false` keeps the tree live but refuses its stop, pause and message actions.
54+
- Docs: the design (`docs/design/steering-and-live-tree.md`), PARITY rows X01–X19, the TUI live
55+
check in `docs/E2E.md`, opencode API notes on steering, RPC and the TUI, and README sections with
56+
new screenshots (live tree, message dialog, narrow panel, stop, finished run).
57+
58+
### Changed
59+
60+
- `/workflows`: phase lines show how many agents are running, and the run line shows the cost.
61+
- Both subagent preambles (P78) now say that `<orchestrator-message>` blocks may arrive while the agent
62+
works. Resume keys are unchanged.
63+
- `journal.jsonl` can contain `{"type":"message"}` lines, and a result line can carry `steered: true`
64+
and `model`. Readers that only know `result` lines (0.1.0) skip them. Agent keys, and so resume,
65+
are unchanged.
66+
- `/workflows <runId>`: the `now:` line of a running agent no longer ends with `· model: …`; the new
67+
per-agent `model:` line replaces it.
68+
- run.json records the project directory (`directory`) that started the run. The RPC only serves
69+
runs of its own project, so runs from 0.1.0 (without it) do not appear in the tree; `/workflows`
70+
still lists them.
71+
72+
### Fixed
73+
74+
- `meta.phases[].model` was validated and then dropped: the phase label a script declared never
75+
appeared anywhere (X10).
76+
- Pre-release fixes to the new features, from a review and a live verification:
77+
- A steering message that missed the agent's turn could start a turn after the agent's result was
78+
read; nobody read that turn and its tokens were not counted. Messages are now sent with
79+
`resume:false`, and the plugin itself starts the turn that reads a late message (X03).
80+
- A message whose delivery id was unknown was reported `undelivered` after a 2 s wait, with a
81+
warning, even when it had been delivered (X03).
82+
- After the server plugin restarted (reload, idle eviction), the tree ignored every update of a new
83+
run until you switched sessions; a slow resync could also show a finished run as running again
84+
(X13, X15).
85+
- The RPC could read and control runs of other projects in the same opencode process (X12).
86+
- Tree rows and the footer lost their middle when too long (cost, elapsed time, progress); they are
87+
now shortened from the least useful part (X14, X15).
88+
- `<orchestrator-message>` escaping missed look-alike characters and other tags (X09); control
89+
characters are stripped from the tree's text (X11); RPC and tool string inputs are size-bounded;
90+
a failed setup no longer leaves the RPC registered; a notification fires once per run (X16).
91+
- The urgent (`msg!`) reply said the message would be read at the next step boundary (X08).
92+
- A `workflow` call reaching a plugin instance that opencode had just reloaded started a run that
93+
nothing could control; it is now refused (P06).
94+
1195
## [0.1.0] - 2026-09-23
1296

1397
First public release. Requires **opencode 2.0.15** exactly (other versions are untested).
Collapse file

‎CONTRIBUTING.md‎

Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-2Lines changed: 7 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ While experimenting, use an isolated opencode data and config dir (see "Live ope
3535
- `src/engine.ts` and its siblings are **host-agnostic**: no opencode imports. Engine tests use the
3636
fake runner in `tests/helpers/`.
3737
- Everything opencode-specific lives in `src/opencode/` and `src/plugin/`.
38+
- The TUI companion (the live progress tree) lives in `src/tui/`. Keep logic in the pure `store.ts`
39+
(tested in `tests/parity/tui.test.ts`); the Solid `.tsx` files only render and dispatch. Check the
40+
view by hand with the "TUI live check" in [`docs/E2E.md`](docs/E2E.md). `npm run build` also
41+
writes `dist/tui.js`.
3842
- Import from `@opencode/plugin` with **`import type` only**; the runtime does not need it.
3943
- Plain TypeScript, ESM. opencode's Bun runtime loads `.ts` directly; `npm run build` produces the
4044
published `dist/` bundle.
@@ -68,8 +72,9 @@ The live suite runs only on manual dispatch and weekly (`.github/workflows/e2e.y
6872

6973
## Parity rule
7074

71-
Every row of `docs/PARITY.md` has an ID (`P01`, `P02`, ...), and **every ID must have at least one
72-
test in `tests/parity/` whose name starts with that ID**, for example
75+
Every row of `docs/PARITY.md` has an ID (`P01`, `P02`, ..., and `X01`, ... for extensions beyond Claude
76+
Code, status `EXT`), and **every ID must have at least one test in `tests/parity/` whose name starts
77+
with that ID**, for example
7378
`test("P03 a syntax error returns async_launched with error", ...)`. A test may list several IDs up
7479
front (`"P41 P44 ..."`). `tests/parity/coverage.test.ts` enforces this in both directions.
7580

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.