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

Droid: decide whether 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 Droid (Factory) adapter (droid, binary droid) does not forward cfg.Config.Model, and this is currently by design — the package comment states "Droid resolves its model and other defaults from the user's own settings; only the autonomy level is overridden" (droid/droid.go:70-74, :149-169). We need a product/architecture decision on whether AO should override the model for Droid roles.

Findings

  • No interactive --model flag. -m, --model <id> exists only on droid exec; the interactive droid [prompt] mode AO launches changes model via /model or Ctrl+N mid-session (Factory CLI reference — https://docs.factory.ai/reference/cli-reference).
  • Model is settable via the settings file AO already writes and passes: top-level "model": "<id>" in the JSON blob emitted by permissionSettingsArgs (droid/droid.go:180-198) and passed with --settings <path>. Currently that file is written only for non-default permission modes and carries only autonomyLevel (Factory settings docs — https://docs.factory.ai/cli/configuration/settings).
  • Upstream risk: open Factory issues show model-config precedence flakiness (Factory-AI/factory #660, #787), and the docs don't explicitly confirm the top-level model in a --settings file overrides the session.

Options

  1. Honor it: add top-level "model": strings.TrimSpace(cfg.Config.Model) to the settings blob and emit --settings whenever autonomy or model is set. Requires verifying against a live droid that --settings model actually re-pins the session model.
  2. Keep deferring to the user's ~/.factory/settings.json and document that agentConfig.model is intentionally a no-op for Droid.

Suggested fix (only if option 1 chosen)

Extend the settings builder (permissionSettingsArgs) with the top-level model key; always write the settings file when a model is set; add a GetConfigSpec model field; add regression tests. Do not add a --model argv flag — the interactive binary rejects it.

References

  • Reference fix: #2869 (Codex) · Original context: #2769
  • Relevant file: backend/internal/adapters/agent/droid/droid.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 04:07 anmol0b