claw-code/rust/crates/rusty-claude-cli/src
TheArchitectit 7dc422de9c fix(team): inject /setup-saved provider config for sub-agents
Sub-agents failed because the main CLI calls inject_config_as_env_fallbacks()
to set CLAWCUSTOMOPENAI_API_KEY / CLAWCUSTOMOPENAI_BASE_URL (and other
provider env vars) before building its provider client, but the sub-agent
spawn path in the tools crate never did. Custom providers set up via /setup
were invisible to spawned agents, so they fell through to the Anthropic
provider and died with 'missing Anthropic credentials'.

Move inject_config_as_env_fallbacks from main.rs private fn into
runtime/src/config.rs as a pub fn, export it via runtime::lib.rs, and call
it at the top of run_agent_job() before the agent runtime is built.

- runtime::inject_config_as_env_fallbacks(): idempotent (only sets env vars
  that aren't already present), reads provider config saved by /setup,
  maps provider kind -> env var names (including custom-openai ->
  CLAWCUSTOMOPENAI_*), injects api_key/base_url/model.
- main.rs now calls runtime::inject_config_as_env_fallbacks() instead of
  the local private version.
- tools::run_agent_job calls runtime::inject_config_as_env_fallbacks()
  before building the agent runtime so custom/exotic providers work for
  spawned agents too.

Together with the earlier model-resolution and chain-fallback fixes
(d8716efb), sub-agents now: (1) use the session's model by default,
(2) inject the /setup-saved provider credentials, and (3) fall through
to the next configured chain entry on a model-not-found 404.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-17 12:55:49 -05:00
..
tui fix(tui): selectable command palette, top-commands shortcut, capture slash output 2026-06-16 16:19:14 -05:00
agent_view.rs feat(tui): Sprint 6 — Agent View overlay with session monitoring 2026-06-11 19:19:38 -05:00
chat_mode.rs feat(tui): Sprint 5 — chat modes, /diff, /undo, /ls commands 2026-06-11 19:15:02 -05:00
command_palette.rs fix(tui): selectable command palette, top-commands shortcut, capture slash output 2026-06-16 16:19:14 -05:00
init.rs fix: scaffold safe init settings 2026-06-04 15:34:15 +09:00
input.rs feat: agent teams with task claiming, context management, and team monitoring 2026-06-10 16:49:34 -05:00
keybindings.rs fix(tui): selectable command palette, top-commands shortcut, capture slash output 2026-06-16 16:19:14 -05:00
main.rs fix(team): inject /setup-saved provider config for sub-agents 2026-06-17 12:55:49 -05:00
markdown.rs fix(tui): test fix, theme migration, zero hardcoded colors in rendering 2026-06-12 10:25:11 -05:00
render.rs Remove the deprecated Claude subscription login path and restore a green Rust workspace 2026-04-11 17:24:44 +00:00
setup_wizard.rs feat(setup): separate env namespace for custom OpenAI-compat provider 2026-06-16 13:30:15 -05:00
theme.rs feat(tui): Sprint 3 — theme system with 11 built-in themes 2026-06-11 19:08:30 -05:00
tui_error.rs feat(tui): Sprint 0 complete — panic hook, resize, TuiError, unicode-width 2026-06-11 18:42:21 -05:00
tui_update.rs fix(tui): Sprint 1 — ProviderSwap fix, status race, memory bound, token tracking 2026-06-11 18:49:15 -05:00