Skip to content

Add a config-level default agent model #40

Description

@FreshlyBrewedCode

What to build

The agent model has a four-level precedence chain with no config rung. Today it resolves as
per-call option → schedule override → workflow default → a DEFAULT_MODEL constant hardcoded in
runtime/run.ts. A project cannot set its own default model anywhere.

That constant is also already stale: it reads opencode-go/deepseek-v4.1-flash, while AGENTS.md
says the preferred model for real agent tests is opencode-go/big-pickle. A provider-qualified
model id living in the runtime is the wrong home for a value that is plainly project policy —
factory.config.ts already owns repo, identity, concurrency, retention and schedules.

Add an agent.model default to FactoryConfig, so the chain becomes run request → schedule →
workflow → config → built-in fallback. This mirrors the precedence rule epic #19 already
established for everything a schedule can override.

Keep a built-in fallback for the config-less paths: factory run without a project config, and a
daemon started with no config, both still have to pick something.

Acceptance criteria

  • factory.config.ts accepts an agent.model default, validated at load like the rest of the config
  • Precedence resolves as run request > schedule > workflow > config > built-in fallback, with a test covering each rung
  • The runtime constant is no longer the only place a default model is expressed
  • The built-in fallback is current rather than stale, and agrees with what AGENTS.md recommends
  • Runs started without any config still work
  • bun run check passes

Blocked by

None (can start immediately).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskA single self-contained piece of work that ships as one PR

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions