endpoint-inheritance-opt

Endpoint inheritance: opt-in not opt-out; clean way for local to ignore inherited global endpoints

Metadata

Statusdone
Assignedagent-152
Agent identity3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3
Created2026-04-26T20:00:02.844607498+00:00
Started2026-04-26T22:44:12.433650551+00:00
Completed2026-04-26T23:19:55.833064576+00:00
Tagseval-scheduled
Tokens29712809 in / 85737 out

Description

Description

Today, global [[llm_endpoints.endpoints]] entries with is_default = true cascade to every project. Local config can only shadow them by REDECLARING the same endpoint name with is_default = false — an obscure hack the user shouldn't need to know.

The user's recent symptom: global has openrouter as is_default, local wanted nothing routed through openrouter, but had no clean way to express that. Required a redeclare-with-is_default=false override.

Fix

Pick one of these two approaches (vote: A is simpler):

A. Inheritance is opt-in. Local config inherits NOTHING from global [[llm_endpoints.endpoints]] by default. Add an explicit knob: [llm_endpoints] inherit_global = true if the user wants the old behavior.

B. Local list FULLY replaces global. If local has any [[llm_endpoints.endpoints]] entry, global's are ignored entirely. If local has none, global's apply.

Either way, document the behavior prominently in config.toml comments and in docs/AGENT-SERVICE.md.

Add a wg config show --merged command that prints the effective merged config so the user can see what's actually in effect.

Validation

  • Failing tests first: test_local_no_endpoints_does_not_inherit_global (or per chosen approach), test_inherit_global_knob_works, test_config_show_merged_displays_effective
  • Implementation makes tests pass
  • cargo build + cargo test pass with no regressions
  • Manual: in this repo, remove the openrouter shadow override I added; assert global openrouter no longer leaks into local routing

Depends on

Required by

Log