[feature] Cross-platform, declarative way to point any AI agent at switchyard-server - #524
Conversation
Add launch subcommands for OpenCode and Hermes alongside the existing Claude Code, Codex, and OpenClaw launchers. OpenCode receives a transient OPENCODE_CONFIG_DIR declaring an @ai-sdk/openai-compatible provider at the local proxy; Hermes is routed via OPENROUTER_BASE_URL/OPENROUTER_API_KEY overrides with --provider custom -m <route>, leaving the user's Hermes config untouched. Also add a routes.toml deployment wired to the providers/models in ~/.hermes/config.yaml (OpenRouter upstream). Signed-off-by: Hyeonggyu Kim <hyeonggyu@live.com>
Expose only :free tier OpenRouter models (nemotron family, gpt-oss, gemma-4-31b, laguna-s-2.1) so proxied coding agents never consume funded quota. Drop the paid qwen/qwen3.8-max default from the config.yaml wiring. Signed-off-by: Hyeonggyu Kim <hyeonggyu@live.com>
…flags Signed-off-by: Hyeonggyu Kim <hyeonggyu@live.com>
… default Signed-off-by: Hyeonggyu Kim <hyeonggyu@live.com>
…unch Signed-off-by: Hyeonggyu Kim <hyeonggyu@live.com>
|
Closing: issue drafts no longer being pursued. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (15)
WalkthroughThe PR adds OpenCode and Hermes launcher support, OpenRouter deployment routes, CLI registration, launcher tests, documentation updates, and proposals for detached server management and declarative agent execution. ChangesLauncher integration
Execution proposals
Estimated code review effort: 4 (Complex) | ~45 minutes Poem
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
Comment Warning |
Problem
Every agent is currently wired to the server by hand. The operator must know each agent's base-URL and model environment variables or manually write per-agent configuration files (e.g., OpenCode, OpenClaw). This manual setup introduces several issues:
/v1path segments, invalid model IDs, missing options likeANTHROPIC_CUSTOM_MODEL_OPTION).execvs. Windows process spawning,PATHEXTscript/binary resolution).Proposed solution
A cross-platform native Rust subcommand (
switchyard agent run) that parses declarative agent specifications, renders environment variables and temporary configurations, and transparently manages agent execution.binary: Executable name or path (resolved across platforms via$PATH).env: Environment variable map supporting{base_url},{base_url_v1}, and{model}placeholders.config_template/config_filename: Optional temporary configuration rendering for config-file agents.std::os::unix::process::CommandExt::execto replace the process image without overhead.Command::spawn, inherits standard I/O (Stdio::inherit()), and forwards child exit codes upon completion.PATHEXTfor.exe,.cmd,.bat).SIGINT,SIGTERM,Ctrl+C) to ensure temporary configuration files are purged on exit.User-facing example
Custom-agent spec (
custom-agent.json):{ "name": "mybot", "binary": "mybot", "env": { "MYBOT_BASE_URL": "{base_url_v1}", "MYBOT_MODEL": "{model}" }, "interactive_default": ["chat"] }Verification
GET /v1/modelson Linux, macOS, and Windows.SIGINT/Ctrl+C).cargo check,cargo test, and multi-target compilation checks.