spacedriveapp / spacedriveapp/spacebot
Wire up per-repo worker_model from registry when spawning workers
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.4k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
Summary
The RegistryRepo struct already has a worker_model: Option<String> field (store.rs:27) and the API endpoint /api/registry/overrides allows setting it per repo. However, when spawning a worker, Worker::new() always resolves the model via routing.resolve(ProcessType::Worker, None) — the per-repo override is never applied.
Problem
All workers use the same global model (e.g. claude-haiku-4-5), even when a specific repo would benefit from a stronger model for complex fixes. The infrastructure for per-repo overrides exists but isn't wired up.
Proposed Change
- In
spawn_worker.rs: Pass the repo context (from worktree or project) when creating the worker - In
worker.rs: When resolving the model, check if the associated repo has aworker_modeloverride in the registry — if so, use it instead of the global default - Optionally: Add a
modelortask_typefield toSpawnWorkerArgsso the channel can explicitly request a stronger model for fix/review tasks
Affected Files
src/tools/spawn_worker.rs—SpawnWorkerArgsstruct, worker creationsrc/agent/worker.rs— model resolution inWorker::new()src/llm/routing.rs—RoutingConfig::resolve()already supportstask_typesrc/registry/store.rs—worker_modelfield already exists
Context
Workers frequently fail CI checks, and the fix-worker (also Haiku) often can't resolve the issues. Being able to set worker_model = "anthropic/claude-sonnet-4-6" per repo would allow stronger models for complex projects while keeping Haiku for simple ones.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SpawnWorkerArgs and worker creation in src/tools/spawn_worker.rs, then trace model resolution in src/agent/worker.rs and RoutingConfig::resolve() in src/llm/routing.rs. Use the existing worker_model field in src/registry/store.rs as the registry source. Done means a repo override is used when present and the global worker model remains the fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100