Claude Code and Codex as Runtimes, and Runtimes Working Together
简体中文 · Status: research and proposal, 2026-11-21; the owner answered every question (section 8) and reviews this before building. Nothing here is built. Section 2 states what exist
简体中文 · Status: research and proposal, 2026-11-21; the owner answered every question (section 8) and reviews this before building. Nothing here is built. Section 2 states what exists; sections 4–6 are proposed. 2026-11-27: the claude-code and codex plugins that R1 and R2 built were folded into the external plugin; section 6f says how to configure them now.
1. Goal
- Claude Code (CC) and Codex become runtime plugins at the same execution boundary as the builtin agent (
Execute(ctx, RunInput, RuntimeHost) (Result, error), architecture section 2). Each declares its capabilities, and the Host adds no CC- or Codex-specific branches. - Runtimes work together on one task. For example, CC develops; Codex runs the tests and reviews; its findings go back to CC to fix; Codex reviews again until it passes. Another pattern sends one question to both and returns a combined answer with each one's own reply.
2. What exists (checked 2026-11-21 against 3f0df00)
- ◆Runtime contract.
pkg/plugin/roles.go:Runtime.Execute. TheRuntimeHostoffersProgress,Checkpoint,Commit,Send,Steeringand theCallercalls (Tools,CallTool,Ask,Skills,PutArtifact, …). A process plugin can be a runtime over JSON-RPC (runtime/execute,pkg/plugin/rpc/methods.go). Manifests declareresumableandsteering. - ◆Children.
delegate(P8) runs sub-agents inside the builtin agent.plugin.ChildOpener(pkg/plugin/workspace.go, built in parallel sub-agents slice 2) opens a child host with the run's identity and scopes in the child's own worktree, andMergeChildapplies the child's changes to the task. A child always runs the same runtime; no Host mechanism runs another runtime as a child. - ◆Loops and checks. Goal mode repeats runs until a check command passes. Verification and review mode are designed; review mode is not built.
- ◆Interactions.
Askis the durable question and approval protocol (AGENTS.md section 2): bound to the run, the interaction id and the authorized principal. - ◆Untrusted answers. A sub-agent's answer reaches its parent wrapped as untrusted (
results.Untrusted,3f0df00)./loginalways runs on the connection's own runtime, which has theloginskill (internal/host/engine/login_commands.go). - ◆Gaps.
Resulthas no usage, so an external runtime's tokens and cost do not reach the budget or themodel_callsaudit. There is no workflow runtime.
3. The two CLIs, headless
| Claude Code | Codex | |
|---|---|---|
| Headless entry | claude -p --input-format stream-json --output-format stream-json --verbose (checked on 2.1.323) | codex app-server: JSON-RPC over stdio, bidirectional (docs); codex exec --json is the older JSONL path |
| One task | a session; each user message on stdin is a turn | a thread; turn/start starts a turn |
| Resume | --resume <session-id> or a fixed --session-id <uuid> | the thread id (thread resume) |
| Approvals | --permission-prompt-tool <mcp tool>: an MCP tool answers each permission request (headless docs) | the server sends item/commandExecution/requestApproval (and file-change approvals); the client answers |
| Sandbox | --permission-mode, --allowedTools/--disallowedTools, --add-dir; the working directory | sandbox (read-only, workspace-write, …) and approvalPolicy per thread |
| Extra tools | --mcp-config with --strict-mcp-config | MCP servers in its config (-c overrides) |
| Events | stream-json messages: assistant text, tool use and results, a final result with usage and cost | item/started, item/completed, deltas, turn/completed with usage |
| Mid-turn input | more stream-json user messages on stdin | interrupting a turn; steering a turn in progress (to verify) |
| Schemas | the stream-json messages are documented; no generated schema | codex app-server can generate JSON Schema for its version, so regenerate after upgrades |
Facts to verify against the installed versions before building: the exact Codex method names and approval payloads (generate the schema), whether Codex runs natively on Windows, the CC message shapes for --include-partial-messages, and what each does with SIGTERM while a prompt waits (CC leaves the prompt unanswered).
4. Adapters
4.1 Form
The adapters are first-party Go builtin plugins, plugins/claude-code and plugins/codex (each with one orchestrator and providers for the process, the event mapping and the bridge). Builtin, because the adapter needs the RuntimeHost directly to answer approvals while the CLI waits. Builtin gives it no extra privilege; its grants are configured like any instance's. Each spawns the vendor CLI as a child process through childenv (no Host secrets in its environment), in the run's workspace. (2026-11-27: both were folded into the external plugin, presets claude and codex; section 6f.)
4.2 Call chain (one run)
Execute(in, host)
├─ workspace: the run's checkout (CallContext.Workspace path); refuse without one
├─ login: the CLI's status (cached a minute); logged out → runtime.login_needed (4.5)
├─ bridge: start an MCP endpoint for this run (4.3); write a per-run MCP config
├─ spawn: claude -p ... --session-id/--resume <id> --mcp-config <cfg> --permission-prompt-tool mcp__orquelo__approve
│ or codex app-server; thread/start{cwd, sandbox, approvalPolicy} or resume the thread
├─ send: in.Text (+ attachments as files in the workspace, + the goal and locale as a short preface)
├─ loop: events → host.Progress; tool events → journal (Commit entries); usage → accumulated
│ approval request → host.Ask(approval) → answer the CLI
│ ask_user (bridge tool) → host.Ask(question) → tool result
│ steering messages (host.Steering) → next stdin message / turn input
├─ end: final text → Result; new files → PutArtifact when asked for
└─ checkpoint: {vendor, session/thread id, turn count} at each turn boundary4.3 The bridge: approvals, questions and Orquelo tools
A per-run MCP server that the CLI connects to. The adapter starts it on a loopback socket with a random token and a deadline. The CLI's MCP config launches orquelo mcp-bridge --run <token>, a small stdio-to-socket relay, so it works the same on all three systems. It offers:
- ◆
approve, CC's permission prompt tool. Each request becomeshost.AskwithKind: approval, showing the tool and a digest of its arguments. The Host binds the answer to the run, the interaction and the approver (AGENTS.md section 2). Codex approvals arrive over app-server and take the same path without the bridge. - ◆
ask_user: the CLI's questions to the person, as durable interactions. A disconnected client does not cancel them. - ◆Orquelo tools: built 2026-11-27 as
orquelo_tools(design); the bridge ispkg/runtimebridge, shared by claude-code, codex and external. Originally not in the first version (the owner's choice, 2026-11-21): the bridge offers onlyapproveandask_user, and the CLIs use their own tools. Later it may addhost.Toolsof the instance'suses, the authorized set (AGENTS.md section 8), never the whole catalog, called throughhost.CallToolso that guards, approvals and the tool ledger apply.
4.4 Mapping and capabilities
| Concern | Mapping |
|---|---|
| Capabilities | resumable: true (resume the session or thread from the checkpoint); steering: true for CC, and for Codex once mid-turn input is verified; no direct_tools |
| Workspace | required; the CLI's cwd is the checkout; CC gets no --add-dir beyond it; Codex sandbox: workspace-write for writers, read-only for reviewers |
| Permissions | the instance's permission_mode/sandbox and allow/deny lists in config; anything outside them asks through 4.3 |
| Cancel | ctx done: CC closes stdin, then SIGTERM (no SIGTERM on Windows: kill after the wait); Codex interrupts the turn, then stops the process; a prompt waiting in the CLI is closed as an interaction first |
| Pause on restart | at the next turn boundary: save the checkpoint and return run.paused; the next Host resumes the session with "continue" |
| Usage | new optional Result.Usage (tokens, cost, model) from the final events, written to model_calls with Purpose: external_runtime. This is a contract change (section 6) |
| Auth | the CLI's own login, made through the unified login (4.5); Orquelo holds no key or token for them |
| Locale | the reply language goes into the preface (task/Context sets it, AGENTS.md section 4); CLI output is not translated |
| Platforms | CC: macOS, Linux, Windows; Codex: macOS, Linux, Windows to verify; manifests declare platforms and refuse unsupported ones at load |
| Failures | CLI missing: the instance is unavailable with a prerequisite reason; not logged in: the run ends with runtime.login_needed (4.5); a crash mid-turn leaves the run for recovery (resume once, then fail and say so); a broken stream line is logged and skipped, then three in a row fail the run |
4.5 Logins (built on the unified login, ADR 0012, S5 and S6)
The adapters add nothing to the login mechanism; they rely on what is built:
- ◆Where the login is. For now Orquelo serves one person (ADR 0012, decision 11): an admin logs in, and the login lands where the CLI keeps it anyway, in the Host user's home (
~/.claude,~/.codex). The adapters run the CLI as that user withHOMEpassed throughchildenv; they never read, copy or pass a token. No API key option, nocredentialslist. - ◆Logging in. An admin sends
/login claudeor/login codexin a direct chat. This is login scenario L2. The genericloginskill checks the status (claude auth status --json, Codex's login status), runs the CLI's login as a background job, and shows its link and code withsign_in_show. A pasted code goes throughsign_in_ask. It closes withcredential_close.claude auth loginis a browser sign-in; whether it can print a link and take a pasted code without a browser, and Codex's device-code login, are to be verified. A note for either goes into theloginskill only if the model cannot manage alone (login design, section 3). A group, or someone who is not an admin, is refused (login.direct_only,login.admins_only). - ◆Not logged in. At the start of a run the adapter checks the CLI's status. The result is cached for a minute and runs no model. If the CLI is logged out, the run ends at once with the stable code
runtime.login_neededand a localized message. An admin is told to send/login <cli>in a direct chat; anyone else is told to ask an admin. The instance staysready, because a login needs no reload. A login that expires mid-run ends that run the same way, and the session is kept for a resume after the next login. - ◆Logging out. "Log me out of codex" runs the CLI's own logout (L7); the next run reports
runtime.login_needed. - ◆Who may use them (the owner's choice, 2026-11-21: through authorization). The login acts for everyone who uses the bot, and runs through
@claudeor@codexspend the admin's subscription with the admin's account. Orquelo's existing authorization therefore decides who reaches them: the instance'sscope(users, conversations, connections) and the approval rules, as for any instance. There is no adapter-specific check. The shipped example scopes them to the admins, and the operator widens it. A route or a workflow role the person may not use is refused before anything starts. - ◆
/loginwhile bound./loginstays on the connection's own runtime even in a conversation bound to@claude(sigils S5 keeps it a Trigger decision), so theloginskill is always the one that runs. - ◆Known limits, inherited. The CLI's token is a file of the Host's OS user, readable by any shell command of that user (login design, section 8). The CLIs run their own tools as that user, so their sandbox (Codex's
sandbox, CC's permission prompts through Orquelo's approvals) is the confinement. Several people need the per-person sandbox homes of login design section 8; the adapter then runs the CLI with that person'sHOME, with no other change. - ◆Place. The CLIs run only on this machine (the owner's answer of 2026-11-21); no remote execution provider is planned.
5. Runtimes working together
5.1 Cross-runtime children (the one Host mechanism)
Extend ChildSpec with Runtime: the id of another runtime instance in the parent's uses. OpenChild then returns a child host, and a new RunChild(ctx, spec, input) (Result, error) has the Host run that runtime's Execute as a child. A child keeps the parent's identity, scopes and authorization, and has its own worktree (isolation: worktree) or the parent's checkout read-only. Its record is keyed (parent run, child key) and is the same after a restart. Its usage settles against the parent's budget. Its approvals are separate interactions, labelled with the child's runtime and task. A child's reply reaches its parent, or the next workflow step, wrapped as untrusted, as sub-agents' answers are (results.Untrusted). Text from Codex is data for Claude Code, never instructions. This is a kernel change; it needs an ADR before it is built (0013; 0011 and 0012 are taken).
delegate gains runtime: <id> (limited to the runtimes in the agent's uses, so the model sees only authorized names). An ad-hoc conversation ("ask Codex to review this") then works through the builtin agent with no new runtime. With read_only: true, which the model sets when the person asks for a delegation that must change nothing, the child runs read-only (context refactor slice 8): the runtime keeps its shell in its own read-only mode (Codex's read-only sandbox, Claude Code's plan mode), a runtime without one is refused, and of the Host's tools the child sees and runs only those marked read-only; any other is refused with reason read_only. An MCP server's own read-only hint is not trusted for this.
5.2 Workflows: a few step kinds
A builtin workflow runtime runs a list of steps from its instance's config, deterministically, budgeted and resumable, rather than leaving the loop to a model. Five step kinds cover both patterns:
| Step | Does |
|---|---|
run | runs a runtime as a child (5.1), named by runtime: or by a role:, with an input template; workspace: task (the task worktree), read-only, or own (its own worktree); optional output_schema its reply must follow |
check | the Host runs a command in the workspace (verification, as goal mode's check): exit code and output tail, never a model's claim |
parallel | several runs at once (listed, or one per runtime of a role list with each), waiting for all up to timeout; one failing does not stop the others |
loop | repeats its steps until its goal is met. It has no round limit: it runs as a goal and ends by goal mode's rules (below); rounds are counted only for the report |
summarize | one model call over the named outputs; its text is the run's reply; attach adds outputs as files; the model is selectable: model: in the config, summary=<model> in a call, the agent's model when neither is given |
The two patterns are configurations of these steps, shipped with Orquelo (orquelo init adds them when the claude and codex instances exist):
1- id: develop
2 plugin: workflow
3 uses: [claude, codex, kimi]
4 config:
5 command: develop # /develop [dev=… review=…] <task>
6 roles: {dev: claude, review: codex} # defaults; a call may name others from uses
7 steps:
8 - loop: {until: "check.passed && review.verdict == 'pass'"} # the goal; no round limit
9 steps:
10 - run: {role: dev, as: dev, workspace: task,
11 input: "{{task}}{{#if review}}\nFix these findings:\n{{review.findings}}\nFailing check:\n{{check.tail}}{{/if}}"}
12 - check: {command: "go test ./...", as: check} # optional: without it, until reads the review alone
13 - run: {role: review, as: review, workspace: read-only,
14 input: "Review this change for: {{task}}\n{{diff}}\nTests: {{check.summary}}",
15 output_schema: findings}
16 - summarize: {model: kimi, input: "Rounds {{rounds}}; changed {{diff.stat}}; open: {{review.findings}}"}
17
18- id: ask-all
19 plugin: workflow
20 uses: [claude, codex, kimi]
21 config:
22 command: ask-all # /ask-all [each=claude,codex] <question>
23 roles: {each: [claude, codex]} # a call may name others from uses
24 steps:
25 - parallel: {timeout: 10m, each: each, as: replies,
26 run: {workspace: read-only, input: "{{task}}"}}
27 - summarize: {model: kimi, attach: [replies],
28 input: "Compare and combine: agreement, disagreement, which is better supported, recommendation."}- ◆Roles (the owner's choice, 2026-11-21). A workflow names its roles and their default runtimes in
roles:. A call may choose others:/develop dev=codex review=claude <task>,/ask-all each=claude,codex <question>. A role takes only a runtime in the workflow'susesthat the person is authorized to use (4.5), and anything else is refused with the list of allowed runtimes before a step starts. The same runtime may take both roles, but a separate reviewer is the point of the loop, so the summary says when they were the same. - ◆The check is optional in
develop(the owner's choice): without acheckstep,untilreadsreview.verdict == 'pass'alone, and the summary says no tests ran. - ◆Calling and progress.
command:registers the/command (5.3). Every step reports progress ("Round 2 · Claude Code is fixing…", "Tests: 1 failed", "Codex review: 2 findings"). - ◆Children and recovery. Each
runis a cross-runtime child keyed by its place in the steps (loop[2].review). The workflow saves its checkpoint after every step, so a restart resumes at the current step without rerunning a finished child, and a Host stop pauses it at the next step boundary. The children's approval cards come to the requester, labelled with the runtime and the step. - ◆Structured replies. A reply that does not fit
output_schemais asked for once more; then the step fails, and the summary says so. Thefindingsschema is{verdict: pass|changes, findings: [{severity, file, line, title, detail}]}. - ◆The loop is a goal (the owner's choice, 2026-11-21).
/develop <task>sets a goal for the session with the task as its text: the built goal mode (internal/host/goals,/goal) owns its state, budget and continuation, and the workflow is the runtime of its rounds. Theuntilcondition is the goal's "met": thecheckpasses (when there is one) and the reviewer's verdict ispass. The reviewer is the separate judge that goal mode already allows. It ends by goal mode's rules, never by a round count: - ◆met:
untilholds; the report says what changed and lists any low findings left; - ◆blocked: no progress: the reviewer returns the same findings, or the check fails with the same output, three rounds in a row; or the developer changes nothing in a round; or a question expires. The report gives the reason and the findings still open;
- ◆exhausted: the goal's budget is used up: working time, tokens (external runtimes report theirs through
Result.Usage) and model calls, with goal mode's defaults and the operator'sgoal_limits;/goal continueextends it; - ◆cancelled:
/goal stop,/cancel,/newor/done./goal showshows the round, the last check and the open findings. Eachrunalso has a timeout, so a step that hangs fails rather than stalling the goal. - ◆Result. The summary is the reply, and fan-out attaches each reply.
develop's changes stay in the task worktree for/doneor/ws restore. - ◆Not in the first version: workflow files written by users (
.orquelo/workflows/at the install levels), conditions beyonduntil, and branching. Only these two scenarios exist so far (AGENTS.md section 11).
5.3 How people call it (the owner's choice, 2026-11-21)
@ switches who you talk to, and / runs a procedure once (sigils):
| Want | Syntax | Behavior |
|---|---|---|
| Talk to Claude Code or Codex | @claude <question>, @codex <question> | the route binds the conversation; follow-ups continue the same session until /exit, another @, /new or route_idle |
| One question to several | /ask-all [each=claude,codex] <question> | runs the ask-all workflow once; the conversation stays where it was |
| Develop, test, review, fix | /develop [dev=… review=…] <task> | runs the develop workflow once; /done and /ws restore afterwards go to the normal runtime |
| Ad hoc | no sigil: "ask Codex to review this" | the default agent delegates (5.1) |
Neither @claude @codex (two routes would leave the binding ambiguous, and the sigil grammar refuses it) nor @develop (binding to a procedure that has ended) is used. A workflow's command is a / directive of kind command that names its target runtime and runs it once without binding. That is a small addition to sigils slice S5.
5.4 Where the orchestration lives
| Option | Fits | Cost |
|---|---|---|
The agent's model orchestrates with delegate(runtime=…) | ad-hoc requests in chat | loops depend on the model; budgets hold, but stopping rules are soft |
A workflow runtime with steps in config | repeatable loops (review, fan-out) | new step kinds are code; new workflows are config |
Recommendation: both, on the same 5.1 mechanism. Fixed patterns go in workflow, and everything else through delegate.
5.5 Owners
| State | Owner |
|---|---|
| CLI process, session/thread id, turn boundary | the adapter (checkpoint) |
| Child record, scopes, budget reservation, approvals | the Host |
| Worktrees, merge of a developer's changes | the workspace provider (localenv) |
| Rounds, verdicts, fan-out results | the workflow runtime (checkpoint) |
| Deliveries of progress and the final report | the Host (Presentation, Delivery) |
6. Contract changes (all proposed)
- ◆
ChildSpec.RuntimeandRunChild(ADR 0013);delegateruntimeparameter. - ◆
Result.Usage(optional; JSON-compatible);model_calls.purpose = external_runtime. - ◆A goal's judge: the workflow reports each round's reviewer verdict and a digest of its findings to the Host (a goal-round report on the runtime host). The Host, which owns goal state, decides
met(check passed, when there is one, and verdictpass) and counts three equal finding digests in a row as no progress, as it already does with a failing check's output (fail_digest). A runtime cannot declare its own goal met. - ◆The
workflowconfig (command,stepsof the five kinds,output_schema: findings) and the route-once/command of sigils S5. - ◆
orquelo mcp-bridge, a hidden CLI subcommand: a relay with a per-run token, refused without one. - ◆New plugins:
claude-code,codex,workflow, each with bilingual display text and documented in theorquelo-docsskills when built. - ◆Budget: the adapters and the workflow are about 2–2.5k lines of production code (estimate); the owner decides the raise.
6a. Built: R1 (2026-11-21)
Folded on 2026-11-27:plugins/claude-codewas deleted and theexternalpresetclauderuns Claude Code (section 6f). This section and 6b record what R1 and R2 built.
- ◆R1a, the @ routes: see sigils section 13.
- ◆R1b,
claude-code(plugins/claude-code), built as sections 4.1–4.5 describe, with these differences: - ◆
commandis a list (an argv prefix), default[claude]. On the owner's machine it is[cl, run, claude]:clsets the proxy and locale, and withrunit does not add--dangerously-skip-permissions. - ◆
permission_modedefaults tobypassPermissions(the owner's decision, 2026-11-21): Claude Code acts without approval cards. An instance that setsdefault,acceptEditsorplangets Claude Code's permission prompts as Orquelo approvals; theconsole-claudeacceptance app setsdefault. - ◆The workspace comes from two new optional interfaces:
plugin.WorkspaceLocator, which localenv implements with the directory its tools use, andplugin.WorkspaceHoston the runtime host. - ◆Usage goes through the optional
plugin.UsageReporterrather than aResult.Usagefield; the Host writes it tomodel_callswith purposeexternal_runtime. - ◆Its own model turns and tool uses go to the run's trace through the optional
plugin.SpanReporter(run traces section 8, S7): names, times and failures, never content. A runtime child's usage and steps nest under its child. - ◆Claude Code's session is a UUID derived from the Orquelo session and the directory, because Claude Code keeps its sessions per working directory; a run in another directory starts a new one. A removal from the Orquelo session starts a new one too (the key includes the content version), and in a session several people share each person has their own, since a CLI session holds its tool output (review #264 B5, 2026-12-05). Whether a session exists is kept in the instance's data directory.
- ◆
envis extra environment for Claude Code only, for exampleHOMEwhere its login is when the Host's ownHOMEdiffers (the acceptance tests give each case its own).serve --preflightwarns about an instance whose command is missing (a builtin's registered check) and still passes;orquelo execrefuses an unavailable runtime at once. - ◆The bridge is
orquelo mcp-bridge, an internal stdio relay to a per-run loopback socket that checks a token. - ◆Claude Code and Codex wait inside their approval and question calls, so their questions are
Question.Hold: the Host does not park the run afterask_grace(which used to answer the CLI with an error, read as a refusal) and waits up to the question's deadline (question_timeout), keeping the run's slot meanwhile (fixed 2026-11-26). A held question lives in that call: when the call ends unanswered, as at a Host restart, the CLI takes it as refused and does not ask again, so the Host closes the question (question.closed, reasoncall_ended) instead of leaving it open for an answer that would be recorded and then ignored (T10, 2026-12-03). - ◆A turn ends at Claude Code's
result; its text is the reply. Messages sent while it runs are passed to Claude Code; one sent too late is requeued by the Host as the next run. - ◆Checked live on 2026-11-21 through the console with
cl run claude: a reply with the[claude]label; a second run remembering the first; a Write permission prompt as an Orquelo approval, with/approvewriting the file and/rejectleaving none; usage rows. Unit tests use a fake Claude Code (plugins/claude-code): the login refusal, a turn with progress and usage, a broken stream, the bridge's token and both decisions. A steering message is passed on once (the Host returns all of a run's messages on each call).
6b. Built: R2 (2026-11-21)
Folded on 2026-11-27:plugins/codexwas deleted and theexternalpresetcodexwithconnect: app-serverruns Codex (section 6f).
- ◆
codex(plugins/codex), built as sections 4.1–4.5 describe, throughcodex app-server(JSON-RPC over stdio, checked on 0.171.0-alpha.13), with these differences: - ◆
commandis a list, default[codex]; on the owner's machine[cl, run, <ChatGPT.app's bundled codex>](cl codexwould add--ask-for-approval never).envas forclaude-code. - ◆
approval(never,on-request,untrusted) is Codex'sapprovalPolicy, defaultnever(the owner's decision, 2026-11-21): Codex works within its sandbox without approval cards, and what the sandbox forbids fails. With a policy that asks,item/commandExecution/requestApprovalanditem/fileChange/requestApprovalbecome Orquelo approvals naming the command (with its directory and Codex's reason) or the files; approve answersaccept, anything elsedecline.item/tool/requestUserInputbecomes questions; other server requests are refused. - ◆
sandboxisworkspace-write(default),read-onlyordanger-full-access(the owner's answer, 2026-11-21). - ◆One Codex thread per Orquelo session and directory, keyed as the Claude Code session above (content version; each person in a shared session); its id is kept in the instance's data directory, and a thread Codex no longer has is started anew. Each run starts one app-server process; a turn ends at
turn/completed, its last agent message is the reply, and the per-call token usage of the turn is summed intomodel_calls. - ◆Steering goes through
turn/steer, each message once. Cancel sendsturn/interrupt, waits briefly, then stops the process (terminate, kill after five seconds). Login iscodex login status(exit 0), cached a minute. - ◆Platforms: macOS and Linux; Windows is not declared until checked.
- ◆Codex reads its own
~/.codex/config.toml, including the MCP servers configured there. - ◆Launch arguments and the proxy (the owner's request, 2026-11-21), for both adapters:
- ◆
argsare extra arguments passed as given: forclaude-codeafter Orquelo's own (for example[--add-dir, /data, --effort, high]), forcodexafterapp-server(for example[-c, model_reasoning_effort="high"]). - ◆Both manifests declare
egress: env(ADR 0011): with an egress provider such asproxy(mihomo), the Host's proxy variables, with the instance's own proxy credentials, are passed to the CLI and its login check, so routes the admin sets forclaudeorcodexapply to their traffic. Without a provider nothing is added. The instance'senvcomes last and wins.clsets its own proxy, so an instance that should follow Orquelo's proxy runs the CLI directly rather than throughcl. - ◆
orquelo execnow gives egress providers a router asservedoes, and keeps installed prerequisites in the configured state directory, not its temporary one, so the proxy's binary is installed once. - ◆Checked live on 2026-11-21:
orquelo execwith theproxyinstance and Codex started directly; Codex completed, and its environment hadHTTPS_PROXYwith thecodexproxy user. - ◆Checked live on 2026-11-21 with
orquelo exec: under the default policy Codex wrote a file in the workspace and replied; withapproval: on-requesta network command came back as an approval question naming the command and Codex's reason. Unit tests use a fake app-server (plugins/codex): the login refusal, a turn with progress and usage, resume, the policy and sandbox passed, both decisions, a failed turn and cancel.
6c. Built: R3 (2026-11-21)
- ◆Cross-runtime children as ADR 0013 decides. Instead of extending
ChildSpec, the optional host interfaceplugin.ChildRunnerhasChildRuntimes(the runtimes in the caller'susesthat are ready and that the person may use) andRunChild(ChildRun{Key, Runtime, Text}). The Host's record is the tablerun_children, keyed(run, key). - ◆The child works in the parent's checkout (the owner's answer, 2026-11-21) with its own permission defaults; a read-only or own-worktree child comes with R4. It has its own session (
<session>/child:<key>), so two children never continue each other's Claude Code session or Codex thread. Its progress and questions carry its runtime ([codex] …), and its question keys are namespaced by the child key. It gets no steering, writes nothing to the conversation's session, and cannot run children. - ◆
delegategainsruntime, listing onlyChildRuntimes. With sub-agents too, a call namesagentorruntime. The reply is[runtime <id> finished]plus the answer wrapped as untrusted. A refused runtime is a tool error ("Not run: …"), and a failed child is reported as failed. Neither fails the run. - ◆Acceptance app
console-delegate(the owner's approval, 2026-11-21): the agent withclaude(asking for approval) andcodexin itsuses. - ◆Unit tests:
internal/host/engine(TestRunChild: the listing, a finished child not run again, a failed one, refusals, no grandchildren, the records) andplugins/agent(TestDelegateRuntime).
6d. Built: R4a, the workflow runtime (2026-11-21)
Replaced on 2026-11-26: the step language below was deleted; workflows are Starlark scripts judged by the Host (workflows in Starlark, ADR 0014). This section and 6e record what R4 built.
- ◆The general step language (the owner's choice, 2026-11-21) is in
plugins/workflow:run,check,parallel,loopandsummarizeas in 5.2. Inputs are templates with{{task}},{{rounds}},{{roles}}(each role's runtimes, saying when one runtime took two roles),{{history}}(a line per round: each run's answer, each check, each review's findings),{{diff}},{{<as>}},{{<as>.<field>}}and{{#if <path>}}…{{/if}}. An unknown name renders empty. - ◆Checked when it loads: every role, runtime and model in the steps is in the instance's
uses(the plugin gets them as the newplugin.Env.Uses), at most one loop at the top holding onlyrun,checkandparallel, and a model for each summary. A wrong workflow is unavailable, with the reason. - ◆
checkand{{diff}}run through the run's shell tool, so the Host runs them under its policy and keeps them in the tool ledger. A check's result is the exit code. - ◆
output_schema: findings: the reply is read with the shared packagepkg/findings, which the Host will also use to judge a round. A reply that is not a review is asked for once more in the same session (the newChildRun.Session), then the step fails. Each role keeps one session across the run's steps. - ◆A call may override roles (
dev=codex,each=claude,codexfor a list role) and the summary model (summary=), only with runtimes the person may use; anything else is refused naming the allowed ones. Members are named only asrole=(the owner's choice, 2026-11-21): the question's first word is never read as a runtime. - ◆A read-only step (2026-11-22):
runtakesworkspace: task(the default, the conversation's checkout) orread-only, so a reviewer cannot change what it reviews. The Host passesChildRun.ReadOnlyto the child asRunInput.ReadOnly, and only to a runtime whose manifest declaresread_only: true; any other is refused (runtime.child_denied).claude-codethen runs inplanmode andcodexin theread-onlysandbox, whatever their configured mode, each in a session of its own (…:read-only). Nothing can let a read-only step write (review #264 B6, 2026-12-05): an ACP agent's every permission request is refused,never_askor not;claude-codegets noallowed_toolsand noapprovepermission prompt, so no one can approve leaving plan mode;codexruns withapprovalPolicy: neverand its approval requests are declined unasked; and a read-only tool the step calls stays read-only in its own nested calls. A step's own worktree is still to come. - ◆In R4a, a loop's steps run once per run. R4b makes them the rounds of a goal and adds the
/command.
6e. Built: R4b, /develop as a goal (2026-11-21)
- ◆The command. A workflow's
commandcomes from its configuration through the optionalplugin.DirectiveProvider, checked as manifest directives are. The/table of a conversation also offers the commands of the other runtimes its connection lists, as long as the person may use them; a name the conversation's own runtime has stays its. Such a command runs once on its runtime, with no pin. - ◆A goal on the workflow. With a loop, the command's target is
goal(plugin.CommandGoal). The Host first asks the workflow to check the text (plugin.CommandChecker), so a role outside itsuses, or not allowed for the person, starts nothing ("Not started: …" names the allowed runtimes). Then it sets the session's goal as/goaldoes, withruntimeset (thegoalstable gainsruntime). Rounds go to that runtime; so do/goal show,stopandcontinue, which follow the conversation's latest goal. Other messages stay where they were. - ◆Judged by the Host's own records. At a round's end the Host reads the round's
check:calls in the tool ledger (their exit codes) and the replies of its reviewer children (ChildRun.Review,run_children.review, read withpkg/findings). The round meets the goal when every check passed and every review passed. The same findings three rounds in a row end itblocked(same_findings), as the same failing check does (same_failure); a failed round ends itblocked; the budget ends itexhausted. The goal-mode rule of two rounds without a tool call does not apply, and there is no "changed nothing" rule (the owner's answer). - ◆Between rounds the workflow keeps the call and the outputs in its data directory, per goal. A round's reply is a short report. When the round ends the goal by the same rules (met, or a third repeat), the workflow runs the steps after the loop at once, so the summary arrives with the Host's notice. An exhausted goal gets the notice alone.
- ◆Unit tests:
internal/host/engine(TestWorkflowGoal: a refused role sets no goal, met in two rounds with the findings reaching the developer, the conversation not pinned;TestWorkflowGoalBlocked: the same findings three times,/goalreaching the goal). - ◆Unit tests:
plugins/workflow(the config checks, a round with the re-ask, overrides, a parallel step with one failure) andpkg/findings.
6f. Folded into external (2026-11-27)
The owner decided on 2026-11-27 that one plugin runs every third-party coding agent: plugins/claude-code and plugins/codex were deleted, and the external plugin (external runtimes over the CLI and ACP) took over what they did. Sections 6a and 6b record what they built.
- ◆Configuration. Instance ids do not change, so
@claude,@codex,@cc,delegateand workflow roles keep working; only theplugin:line changes, and the instance names a preset:
1 - id: claude
2 plugin: external
3 config: {preset: claude, command: [cl, run, claude]}
4 - id: codex
5 plugin: external
6 config: {preset: codex, connect: app-server, command: [cl, run, codex]}- ◆Old configurations are refused, not migrated (the owner's choice). An instance that names
plugin: claude-codeorplugin: codexis refused at preflight withplugin "claude-code" was removed, and external took its place: use plugin: external with config preset: claude (...). The refusal comes from the general manifest fieldreplaces(pkg/pluginManifest.Replaces), so the Host has no case for these two plugins. - ◆Settings that carry over.
commandis the CLI's program in place of the preset's (such as[cl, run, claude]); it replaces the first word of the preset's command lines that start with the CLI, and oflogin_status, but not an ACP adapter such asnpx, and without a preset it is the command line of the way of connecting (cli.command,acp.commandorapp_server.command) when that is not set.permission_mode(Claude Code's name) andsandbox(Codex's name) are aliases ofmode.approvalis Codex's app-server approval policy.allowed_tools,disallowed_tools,model,effort,add_dirs,never_ask,orquelo_tools,args,turn_timeoutandenvkeep their names. - ◆Claude Code over its CLI. The
claudepreset runsclaude -p --input-format stream-json --output-format stream-json --verbosewithcli.input: claude-stream-json: the prompt and the messages sent while it runs go to its stdin, which closes at itsresult.cli.approve(--permission-prompt-tool mcp__orquelo__approve) makes the run'sapprovetool its permission prompt tool, so its permission prompts become Orquelo approvals; it is used unlessnever_ask. The run's MCP server offersask_usereither way, whichcli.ask_allow(--allowedTools mcp__orquelo__ask_user) allows without a prompt:never_askturns off permission prompts, not questions (Feishu #260, 2026-11-29). An ACP agent that shares Orquelo's tools getsask_usertoo. The tool lists go through--allowedToolsand--disallowedTools, the run's MCP server through--mcp-config.--strict-mcp-configis gone: Claude Code now also sees its own MCP servers, as every external CLI does. - ◆Codex over its app-server.
connect: app-serverrunscodex {mcp} app-server(app_server.command;{mcp}is wherecli.mcp's arguments go). Codex's approval requests and questions become Orquelo approvals and questions, and messages sent while it works reach it. The sandbox isworkspace-writeby default, and a read-only step runs inread-only.connect: cli(codex exec --json) andconnect: acp(through annpxadapter) remain for Codex, andconnect: acpfor Claude Code. As the codex plugin declared only macOS and Linux, preflight refusesconnect: app-serveron Windows until it is checked there. - ◆The default now asks. The old plugins acted without asking by default (Claude Code
bypassPermissions, Codex approvalnever: the owner's choice of 2026-11-21). Underexternalthe default follows itsnever_ask, false by default: theclaudepreset asks through approval cards, and Codex over app-server asks on request, only when it wants to leave itsworkspace-writesandbox (approvalempty meansneverwithnever_ask, elseon-request).never_ask: truerestores the old behaviour. - ◆Steering. The
externalmanifest declaressteering, as both old plugins did, so a message sent while a run works joins it: Claude Code over its CLI (cli.input) and Codex over app-server (turn/steer) read it. A connection that cannot take one (agy or TRAE over their CLI, ACP) never reads it, and the Host starts it as the next run, as for every runtime that leaves a message unread. ACP has no way to add a message to a running turn, so an ACP instance can setsteer: interrupt(2026-11-28): a message sent while the agent works cancels its turn (session/cancel), and once that turn has ended it goes, with any others sent meanwhile, as the next prompt in the same session. The agent keeps what it did and read, the step it was in the middle of is cut off, and the run's reply is the last prompt's.steertakes onlyinterrupt, and only withconnect: acp; preflight refuses anything else. Checked with real agy 1.5.18 over ACP: a long essay task, then a correction sent 12 s later; the essay turn was cancelled and agy did the correction in the same run. - ◆Also changed. Tool steps reach run traces with the attribute
external.step(previouslyclaude-code.step). For any CLI that is not logged in, the message tells an admin to send/login <cli>in a direct chat (external.login_admin), which theloginskill handles. - ◆Checked for real (2026-11-27): real Claude Code through the folded
claudepreset withpermission_mode: default, in a scratch Host's console: asked to create a file, itsWritecame back as an Orquelo approval card,/approvesettled it, and the file was written. A config still namingplugin: claude-codewas refused at preflight with the message above. Not checked: Codex over app-server andexec(Codex is not installed on the machine where this was built), and steering into a real Claude Code turn.
7. Slices and acceptance
| Slice | Content | Acceptance (real channel and CLI; blocked without credentials) |
|---|---|---|
| R1 | claude-code adapter: run, progress, approvals through the bridge, resume, cancel | a console task edits a file through CC; an approval card appears and a denial stops the edit; a restart mid-task resumes the session; logged out, the run answers runtime.login_needed, and after an admin's /login claude in a direct chat the next run works |
| R2 | codex adapter over app-server | the same for Codex; a read-only reviewer cannot write |
| R3 | cross-runtime children (ADR 0013), delegate(runtime) | "ask Codex to review" from the agent; the child's approval is labelled; a restart does not rerun a finished child |
| R4 | workflow with the five step kinds; /develop as a goal | a seeded bug: CC fixes it, Codex finds a second issue, CC fixes it, review passes (met); a never-passing task ends blocked on repeated findings, and a small budget ends exhausted; /goal continue resumes |
| R5 | ask-all (parallel, summarize) and /ask-all | one question to CC and Codex; the summary names agreement and difference; a timed-out child is reported |
8. The owner's answers (2026-11-21)
- Auth. Answered: the CLIs' own logins through the unified login (4.5), one person for now.
- Where they run. Answered: only on this machine.
- Who may use them. Answered: through Orquelo's authorization (instance
scopeand approval rules, 4.5); the example scopes them to the admins. - Default posture. Answered: through authorization: CC's permission prompts become Orquelo approvals; a reviewer runs read-only.
- Orquelo tools in the CLIs. Answered: only approvals and questions in the first version (4.3).
- The loop. Answered: it is a goal and ends when the goal is met, blocked by no progress, out of budget or cancelled, with no round limit; the
checkstep is optional; roles can be chosen per call (5.2). - Summaries. Answered: the summary model is selectable (config
model:, a call'ssummary=), the agent's model by default (5.2). - Budget. Answered: raise it as needed for R1–R5 (about 2.5k lines).
9. Sources
- ◆Claude Code headless mode, Agent SDK headless, and
claude --helpof 2.1.323. - ◆Codex App Server, Unlocking the Codex harness, and the app-server transport guides of community SDKs (codex_sdk, codex-codes), which are secondary sources.