feat: read .devswarm/config.toml for per-role backend/model routing#293
Closed
feat: read .devswarm/config.toml for per-role backend/model routing#293
Conversation
Add src/config.zig — a minimal TOML parser that reads the config file written by `devswarm init`. Wire it into resolveWithProbe() so that per-role and global provider settings from config.toml take effect at runtime without any MCP param changes. Resolution chain (highest priority first): 1. MCP param override (model: "opus" in tool call) 2. config.toml [agents.<role>].model / .backend / .sandbox / .max_turns 3. Static role spec (roles.zig built-in defaults) 4. Grid tier (grid.zig role→model table) 5. config.toml [provider].claude_default (global default model) 6. Mode default (smart→Sonnet, deep→Opus, etc.) Example .devswarm/config.toml that makes reviewer use Opus on Codex: [agents.reviewer] model = "opus" backend = "codex" All 64 existing tests pass + 4 new config tests + 3 new resolve tests. Generated with AI Co-Authored-By: AI <ai@example.com>
Adds src/notify.zig — a thread-safe notifications/message emitter that writes JSON-RPC notifications to stdout while a long-running tool is executing. MCP clients (Claude Code) display these inline during the "Running…" wait, giving real-time feedback. How it works: JSON-RPC is full-duplex. The server sends notifications (no `id` field) at any point while processing a `tools/call` request. The client shows them as status lines. The final result is correlated by the original id. Changes: - src/notify.zig: mutex-protected send(), supports Content-Length framing - src/main.zig: call notify.init(g_use_headers) after framing detection - src/swarm.zig: emit phase markers — "decomposing", "N agents running", "synthesizing" — so users see swarm progress instead of just "Running…" - src/tools.zig: add optional `title` param to run_swarm; displayed in the phase notification so tool calls show a readable label rather than the full raw prompt blob Generated with AI Co-Authored-By: AI <ai@example.com>
Collaborator
|
Superseded by #339 (rebased with conflict resolution) |
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.
Summary
src/config.zig— minimal TOML parser for.devswarm/config.tomlresolveWithProbe()so per-role and global provider settings take effect at runtimeWhat this enables
Users can now control which model/backend each agent role uses by editing
.devswarm/config.toml:Resolution chain (highest → lowest priority)
model: "opus"in tool call)config.toml [agents.<role>].model/.backend/.sandbox/.max_turnsroles.zigbuilt-in defaults)grid.zigrole→model table)config.toml [provider].claude_default(global model default)smart→Sonnet,deep→Opus, etc.)Test plan
config.zigtests (parse, role overrides, comments, loadDefault)resolve.zigtests (per-role model, primary backend, max_turns from config)