wg-setup-5-smooth

wg setup: 5 smooth routes (openrouter / claude-cli / codex-cli / local / nex) + per-route default configs

Metadata

Statusabandoned ‖ paused
Created2026-04-26T13:00:39.516855229+00:00

Description

Description

wg setup and wg init should offer 5 named, smooth routes — each backed by a complete, working default config. No empty [tiers], no half-set fields, no confusing 'Anthropic vs Claude Code' duplication. The user picks ONE route and gets a config that works end-to-end.

The 5 routes

Route nameExecutorAuthEndpointModels (tiers)
openrouternexOPENROUTER_API_KEY (env or file)openrouter.ai/api/v1fast=anthropic/claude-haiku, std=anthropic/claude-sonnet, premium=anthropic/claude-opus (or user-pickable defaults from openrouter catalog)
claude-cliclaudelocal claude login (no API key)n/afast=claude:haiku, std=claude:sonnet, premium=claude:opus
codex-clicodexlocal codex loginn/afast/std/premium = whatever codex CLI accepts (gpt-5-mini / gpt-5 / o1-pro or current equivalents)
localnexnonehttp://localhost:11434/v1 (ollama default) or user-suppliedfast/std/premium = single locally-available model with a note that user should adjust
nex-customnexuser-supplied (env / file)user-supplied URLuser-supplied model id; setup just collects the inputs and wires them

Spec

  1. src/config/defaults.rs (or similar):

    pub enum SetupRoute { Openrouter, ClaudeCli, CodexCli, Local, NexCustom }
    pub fn config_for_route(route: SetupRoute, params: RouteParams) -> Config;
    

    Each branch returns a complete Config with: agent, coordinator, tiers (all three filled), models.evaluator/assigner, llm_endpoints (when applicable), model_registry (when applicable). Round-trips through TOML. Tested per-route.

  2. wg setup rework:

    • Top-level menu lists exactly the 5 routes above with one-line descriptions, no Anthropic-vs-Claude-Code split.
    • 'Ctrl-C exits without saving' hint at top.
    • After route pick + any required params (api key path, endpoint URL), show diff-style preview vs current global config.
    • Final prompt: [a]ccept / [c]ustomize / [q]uit.
    • wg setup --route <name> [--api-key-file PATH] [--api-key-env VAR] [--url URL] [--model ID] --yes for non-interactive use; errors if required params for the route are missing.
  3. wg init:

    • -x <executor> continues to work but now produces a complete config (populates tiers from executor's default route, e.g. -x claude uses claude-cli route defaults).
    • Add --route <name> as an alternative selector that picks a full route (not just executor).
    • Add --dry-run flag.
    • Print summary on success: 'Wrote .wg/config.toml: route=claude-cli, executor=claude, tiers=haiku/sonnet/opus'.
  4. wg config reset (new command):

    • wg config reset --route <name> resets to that route's defaults.
    • wg config reset with no route uses the current config's executor to pick the closest route.
    • --keep-keys preserves [[llm_endpoints.endpoints]] entries.
    • --dry-run prints diff.
    • --yes skips confirmation.
    • Always backs up to config.toml.bak- first.
  5. wg nex reminder docs: README + AGENT-SERVICE should mention that the nex executor is the native path for OAI-compatible endpoints, and openrouter / local / nex-custom routes all use it under the hood.

Open design questions for the implementer to resolve

  • Does claude executor support being pointed at openrouter, or is openrouter strictly nex-only? (Current global config has both executor=claude AND an openrouter endpoint configured — that combo's behavior should be documented.)
  • For the codex-cli route: confirm what model ids the codex CLI currently accepts and pick sensible tier defaults.
  • For the local route: should we probe http://localhost:11434/v1/models (ollama) at setup time and offer detected models, or just write a placeholder?

These are research-then-decide items; the implementer should investigate and pick reasonable defaults, not block.

Validation

  • Failing tests written first: test_route_openrouter_complete_config, test_route_claude_cli_complete_config, test_route_codex_cli_complete_config, test_route_local_complete_config, test_route_nex_custom_complete_config, test_init_dry_run_no_write, test_setup_non_interactive_route_writes_config, test_config_reset_keep_keys_preserves_endpoints, test_config_reset_creates_backup
  • Implementation makes all tests pass
  • cargo build + cargo test pass with no regressions
  • Manual smoke (in a scratch dir, with backup of ~/.wg/config.toml):
    • wg setup --route claude-cli --yes produces complete config with populated [tiers]
    • wg setup --route openrouter --api-key-env OPENROUTER_API_KEY --yes produces config with nex executor + openrouter endpoint + tiers
    • wg setup --route local --url http://localhost:11434/v1 --model qwen3:4b --yes produces config with nex executor + local endpoint + tiers populated with the chosen model
    • wg setup interactive shows the 5-route menu with clear labels and an escape hint
    • wg init -x claude produces config with populated [tiers] (the bug)
    • wg config reset --route claude-cli --dry-run prints diff; --yes writes defaults; backup file exists

Depends on

Required by

Log