Support multiple coding agents per loop (claude, codex, opencode) - #1
Open
afalko wants to merge 2 commits into
Open
Support multiple coding agents per loop (claude, codex, opencode)#1afalko wants to merge 2 commits into
afalko wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
claude,codex,opencode(binary + each agent's hands-off flag).[agents.<name>]overrides a preset or defines a brand-new custom agent.WorkbenchConfig::resolve_agentprecedence: per-loopagent_args→[agents.*]→ workbench default-agent fields → preset.Back-compat
claude_binary/claude_args(workbench + per-loop) are renamed toagent_binary/agent_argswith serde aliases, so existing configs keep parsing. Daemon migration v3 rewrites the keys on disk on first load.Other
orchestrator:claude_invocation→agent_invocationvia the resolver.add-loop --agent <name>; emitsagent/agent_args; updatedaboutstring.repo_loadertemplate + README document agents.Testing
cargo clippy --all-targets -- -D warningsclean.demo-codex(codex launched and responded to the pasted prompt) anddemo-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