agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

Crush: decide how to honor role-specific model config on launch

Open illegalcall opened this issue 4 months ago • 2 comments

Context (shared across all harnesses)

AO stores a per-role model in agentConfig.model (backend/internal/domain/agentconfig.go:27). session_manager.effectiveAgentConfig merges the project base config with the role override and Spawn/Restore forward the resolved value into every adapter as cfg.Config.Model (backend/internal/ports/agent.go). Each adapter must opt in to forwarding that value to its CLI. Today only the Claude (claudecode/claudecode.go:172), Codex (#2869), and Kiro (config-file model key) adapters do. Every other adapter silently drops it, so a configured worker/orchestrator falls back to the CLI's global default model.

  • Original report: #2769
  • Reference fix (the pattern to copy): #2869 (Codex) — adds an appendModelFlag helper called in both GetLaunchCommand and GetRestoreCommand, plus a GetConfigSpec model field and regression tests.

Decision needed

The Crush (Charm) adapter (crush, binary crush) does not forward cfg.Config.Model. An override mechanism exists but neither path fits AO's single Model string cleanly, so a decision is needed.

Findings

  • GetLaunchCommand (backend/internal/adapters/agent/crush/crush.go:73-92) emits only --cwd + --yolo; GetRestoreCommand (:125-151) adds --session. hooks.go merges only options.context_paths into .crush.json (mergeCrushContextPath, :146-159). Inherits empty GetConfigSpec.
  • Config route: .crush.json has a top-level models object with large/small keys, each { "model": "<id>", "provider": "<providerID>" } — both fields required. AO's agentConfig.model carries no provider id.
  • Flag route: --model/-m is documented only for the non-interactive crush run; not confirmed on the interactive root command AO launches (UNKNOWN). Sources: https://deepwiki.com/charmbracelet/crush/4.3-model-configuration , https://deepwiki.com/charmbracelet/crush/2.2-cli-usage

Options

  1. Config route: extend the AO-managed .crush.json (mergeCrushContextPath) with models.large (and/or .small) — but this needs a provider value AO doesn't currently model. Would agentConfig need a provider field?
  2. Flag route: first verify crush -m <model> works on the root interactive command (crush --help on the pinned version); if so, a simple flag fix applies.

References

  • Reference fix: #2869 (Codex) · Original context: #2769
  • Relevant file: backend/internal/adapters/agent/crush/crush.go

illegalcall avatar Jul 21 '26 09:07 illegalcall

Thanks for contributing to Agent Orchestrator.

This issue is being picked up by the current external contributor on-call pair:

  • @illegalcall
  • @pulkit7070

If someone is already working on this, please continue as usual. The on-call pair is added for visibility, tracking, and support, not to take over the work. If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @pulkit7070 here.

For faster context or live questions, you can also join the AO Discord.

Join the session here: https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

somewherelostt avatar Jul 21 '26 14:07 somewherelostt

starting this one !

anmol0b avatar Jul 27 '26 03:07 anmol0b