spacedriveapp / spacedriveapp/spacebot

Wire up per-repo worker_model from registry when spawning workers

Open
#431 0 comments 0 reactions 0 assignees View on GitHub

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

  1. In spawn_worker.rs: Pass the repo context (from worktree or project) when creating the worker
  2. In worker.rs: When resolving the model, check if the associated repo has a worker_model override in the registry — if so, use it instead of the global default
  3. Optionally: Add a model or task_type field to SpawnWorkerArgs so the channel can explicitly request a stronger model for fix/review tasks

Affected Files

  • src/tools/spawn_worker.rsSpawnWorkerArgs struct, worker creation
  • src/agent/worker.rs — model resolution in Worker::new()
  • src/llm/routing.rsRoutingConfig::resolve() already supports task_type
  • src/registry/store.rsworker_model field 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.