Skip to content

Support multiple coding agents per loop (claude, codex, opencode) - #1

Open
afalko wants to merge 2 commits into
mainfrom
multi-agent-support
Open

Support multiple coding agents per loop (claude, codex, opencode)#1
afalko wants to merge 2 commits into
mainfrom
multi-agent-support

Conversation

@afalko

@afalko afalko commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

Loops were hardcoded to launch claude. This generalizes the pane launch command so each loop can run Claude Code, Codex, or opencode, selected per-loop. The paste/dispatch layer was already agent-agnostic, so the change is confined to config + invocation.

Config

[workbench]
default_agent = "claude"                              # agent a loop uses if it sets none
agent_args    = ["--dangerously-skip-permissions"]    # default-agent args (alias: claude_args)

[agents.codex]                                        # optional override; built-in presets exist
binary = "codex"
args   = ["--dangerously-bypass-approvals-and-sandbox"]

[[loops]]
name  = "demo-codex"
agent = "codex"                                       # claude | codex | opencode | custom
  • Built-in presets for claude, codex, opencode (binary + each agent's hands-off flag).
  • [agents.<name>] overrides a preset or defines a brand-new custom agent.
  • WorkbenchConfig::resolve_agent precedence: per-loop agent_args[agents.*] → workbench default-agent fields → preset.
  • Agent names are validated (safe identifier + must resolve to a known agent).

Back-compat

claude_binary/claude_args (workbench + per-loop) are renamed to agent_binary/agent_args with serde aliases, so existing configs keep parsing. Daemon migration v3 rewrites the keys on disk on first load.

Other

  • orchestrator: claude_invocationagent_invocation via the resolver.
  • CLI: add-loop --agent <name>; emits agent/agent_args; updated about string.
  • repo_loader template + README document agents.

Testing

  • 144 lib tests pass (added agent-resolution, legacy-alias, migration-v3, and validation cases); cargo clippy --all-targets -- -D warnings clean.
  • Verified live: restarted the daemon into this build (migrated the config to v3), created demo-codex (codex launched and responded to the pasted prompt) and demo-opencode (invocation built correctly; opencode not installed locally so the pane reported command-not-found). Demo loops were torn down afterward.

🤖 Generated with Claude Code

afalko and others added 2 commits August 24, 2026 22:20
Loops were hardcoded to launch `claude`. Generalize the pane launch
command so each loop can run Claude Code, Codex, or opencode — the
paste/dispatch layer was already agent-agnostic, so this is confined to
config + invocation.

- config: add `workbench.default_agent`, per-loop `agent`, and optional
  `[agents.<name>]` override tables (binary/args). Built-in presets ship
  for claude, codex, and opencode, each with its hands-off flag
  (`--dangerously-skip-permissions`,
  `--dangerously-bypass-approvals-and-sandbox`, none). Add
  `WorkbenchConfig::resolve_agent` with precedence: per-loop args →
  `[agents.*]` → workbench default-agent fields → preset. Validate agent
  names (safe identifier + must resolve to a known agent).
- rename `claude_binary`/`claude_args` → `agent_binary`/`agent_args`
  (workbench + per-loop), with serde aliases for back-compat; daemon
  migration v3 rewrites the keys on disk on first load.
- orchestrator: `claude_invocation` → `agent_invocation` via the resolver.
- cli: `add-loop --agent <name>`; emit `agent`/`agent_args`; update the
  binary's about string.
- repo_loader + README: generated template and docs cover agents.

144 lib tests pass (added agent-resolution, alias, migration-v3, and
validation cases); clippy --all-targets -D warnings is clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
add-loop resolved the loop's workdir and README against the config
file's parent directory (`cfg_path.parent()`), which assumed
workbench.toml lives inside the loops repo. With the canonical config at
`~/.config/loopctl/workbench.toml` and a separate `claude_loops_dir`,
the loop dir + README block were created in the wrong place, so the
daemon's `up` failed with "workdir does not exist".

Load the config and resolve both paths against `claude_loops_dir`
(expanded), matching where the daemon looks them up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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