Skip to content

Add Codex and OpenCode subagents with a model picker, and fix show_visual cards - #114

Merged
m4rocks merged 8 commits into
mainfrom
quick-otter
Nov 17, 2026
Merged

m4rocks merged 8 commits into
mainfrom
quick-otter

Conversation

@m4rocks

@m4rocks m4rocks commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Claude Code can only hand tasks to Claude subagents. This adds Codex and OpenCode subagents: in Settings → Custom subagents, each model switched on becomes an agent type such as Claudiu:codex-gpt-6-1-sol or Claudiu:opencode-openai-gpt-6-1-sol that runs the task in that agent.

Claude ── Agent(Claudiu:codex-gpt-6-1-sol) ──▶ mod's turn.step hook (Claude never runs)
                                                  └─ claudiu --acp  (stdin: task as JSON)
                                                       ├─ npx codex-acp@2.6.0   (your codex login)
                                                       └─ opencode acp          (your OpenCode install)
                                                  ◀─ JSON lines: the agent's text and steps, then the report
          ◀── SubagentHandback(the agent's last message)
  • The mod registers the agent types from CLAUDIU_SUBAGENTS. Interactive Claude Code ignores claude --agents (only -p reads it), so an earlier build of this branch gave sessions no Codex types at all.
  • Each agent has a "Choose models…" picker over Settings, with a search; the page lists only the models switched on. The list comes from the agent's own model picker, is kept, and is refreshed when the page opens. OpenCode's lookup session is deleted afterwards.
  • Read-only by default. Codex runs in its read-only sandbox. OpenCode has none, so read-only allows only read, glob, grep and list, repeated under the build agent because a project's opencode.json would otherwise override it. With Allow edits on, Claudiu accepts every request the agent makes, network included, outside Claude Code's permission rules.
  • A long model name is cut short so its switch stays in the row.
  • show_visual's instruction names the replies that get a card. In a 24-run eval, 10 of 12 prompts that call for a card drew one, up from 4 of 12; none of 12 plain prompts did, before or after.
  • Cards no longer fade and double as they scroll past the top edge: a slot was keyed by the first card row on screen, which changed with every line, so Rune faded a new copy in over the old one.

Evidence

  • cargo test: 494 passed, 0 failed. claude plugin test mod: 18 pass, 0 fail.
  • New tests that fail without their fix: a card scrolled past the top line by line has nothing fading, moving or doubled (it failed on slot-c1-1 fading in at 0.155 opacity); a long model name keeps its switch inside its row on the page and in the picker.
  • A real interactive Claude Code 2.1.326 session listed only the built-in agent types when given --agents or --settings with agents; claude -p with the same arguments listed the custom ones.
  • Real OpenCode runs: read-only left the folder unchanged, even with a project opencode.json allowing everything; with edits on, the file appeared. Without opencode on PATH the report reads "OpenCode failed: opencode was not found on PATH…". A model lookup returned 107 models and left no session in OpenCode's history. Killing the helper left no process behind.

Not checked: that Claude lists the Claudiu: types in a real session after this change (the mod tests cover registration), interrupting from Claude Code's UI, and macOS.

Risk

Everything is off until an agent is switched on. With Allow edits on, the agent can change files and use the network outside Claude Code's permission rules. To undo, revert the merge commit; saved settings keep loading because the stored shape is unchanged.

Refs #110
Refs #115

Claude Code could only hand tasks to Claude subagents. With Codex turned on in Settings → Custom subagents, each listed model becomes an agent type (`Claudiu:codex-gpt-6-1-sol`, or `Claudiu:codex` on Codex's default model) that runs the task in OpenAI Codex.

The mod answers each turn of such an agent itself, so Claude never runs for it. It starts `claudiu --acp`, a hidden helper mode that speaks the Agent Client Protocol to `npx codex-acp@2.6.0`, streams Codex's messages and steps as thinking lines, and hands back Codex's last message with SubagentHandback. Codex runs read-only unless Allow edits is on.

Refs #110
A hand-back refused twice now ends the turn with the report as text. The helper no longer waits for codex-acp's stderr after a run that answered, names the last action read-only refused, and the Allow edits text says that every Codex request is accepted, network access included. If the mod ever loses track of a Codex agent, the Claude stand-in says so instead of attempting the task.

Refs #110
Settings → Custom subagents now asks codex-acp which models the account offers and shows a switch for each, instead of a field of typed names. The list is kept and refreshed in the background each time the page opens with Codex on; a model no longer offered stays listed while it is switched on. There is no default-model type any more.

Claudiu defines the agent types itself with `claude --agents`, so they are named `codex-gpt-6-1-sol` rather than `Claudiu:codex-gpt-6-1-sol`, and the mod only reads the list. Codex's messages and steps are now the subagent's saved text, so they can be read in its view during and after the run; Claude still gets only the report.

Refs #110
Settings opened straight onto Custom subagents never asked codex-acp for its models, because the page loaded before the dialog existed. A model lookup now also gives up after 60 seconds instead of leaving the page loading for good.

Refs #110
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
claudiu Ready Ready Preview Nov 17, 2026 9:05am UTC

…cture

The instruction now names the replies that get a card (a table, a comparison, three or more items with details, steps, an architecture, a before/after, a status board, numbers worth a chart) and says to keep the typed reply to a few lines. In a 24-run eval, 10 of 12 prompts that call for a card drew one, up from 4 of 12, and none of the 12 plain prompts did, before or after.
Settings → Custom subagents has an OpenCode section next to Codex. Each model switched on becomes an agent type that runs the task in the user's own `opencode acp`. Read-only OpenCode may only read, glob, grep and list, and the denial is repeated under the build agent, because a project's opencode.json would otherwise override it. The session opened to list the models is deleted afterwards.

Both agents now choose models in a picker over Settings, with a search; the page lists only the models switched on. A long model name is cut short so its switch stays in the row.

The mod registers the agent types again, as `Claudiu:codex-…` and `Claudiu:opencode-…`. Interactive Claude Code ignores `claude --agents` (only `-p` reads it), so sessions started from Claudiu never had the Codex types.

Refs #110
Refs #115
A card's slot was keyed by the first card row on screen, so each line it scrolled under the top edge gave it a new key. Rune then faded a new copy in over the old one fading out, which drew two overlapping copies of the card. The slot is now keyed by the card and which of its pieces on screen it is.
@m4rocks m4rocks changed the title Run Codex as Claude Code subagents from Settings → Custom subagents Add Codex and OpenCode subagents with a model picker, and fix show_visual cards Nov 17, 2026
@m4rocks
m4rocks merged commit 2a57544 into main Nov 17, 2026
5 checks passed
@m4rocks
m4rocks deleted the quick-otter branch November 24, 2026 22:38

This branch was successfully deployed

1 active deployment
Preview — 043f160a Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant