Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Added

- **Configurable compaction model.** `modelSystem.compaction` selects the model
used to summarize the conversation during context compaction (both automatic
compaction and `/compact`). It defaults to the main conversation model; set it
to a `ModelRef` object (`{ "backend": "...", "model": "..." }`) to compact with
a different (for example cheaper or longer-context) model. When the configured backend is not ready, compaction
inherits the main model and prints a warning in the compaction notice; if the
chosen model errors mid-compaction, it retries with the main model before
falling back to the deterministic trim, reporting the failure instead of
silently degrading. The configured model is shown in `/route status` and
`/route template`.

## [1.2.0] - 2026-07-08

### Added
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,10 @@ token counts, and reported OpenRouter costs stay visible.
`/route` lets you describe a model stack that blends local and frontier models:
separate orchestrators for low/medium/high planning, coders for
low/medium/high implementation, play and production review models, a security
review model, and one selector model that chooses the route for a task.
review model, a compaction model that summarizes the transcript when context is
compacted, and one selector model that chooses the route for a task. `/route
status` shows the configured stack (including the compaction model) and `/route
template` prints the JSON shape to paste into `agent.config.json`.

```text
/route template
Expand All @@ -879,6 +882,25 @@ For whole-goal decomposition, `/plan route <goal>` uses `modelSystem.planner`
or a planner override to create `.small-harness/plan.json`; `/plan execute`
then runs each ready node with the configured low/medium/high coder model.

Context compaction (summarizing the conversation when the prompt budget fills,
both automatically and via `/compact`) uses the main conversation model by
default. Set `modelSystem.compaction` to a `ModelRef` object (a `{ "backend":
"...", "model": "..." }` pair, the same shape as `planner`/`selector`) to
summarize with a different model, for example a cheaper or longer-context one:

```json
{
"modelSystem": {
"compaction": { "backend": "openrouter", "model": "anthropic/claude-3.5-haiku" }
}
}
```

Prompt-budget sizing still tracks the main model (that is the context being
fit); only the summary call uses the compaction model. If the compaction
backend is not ready (for example a missing API key), compaction falls back to
the main model and prints a warning.

---

## Configuration
Expand Down
3 changes: 3 additions & 0 deletions src/commands/context_cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ pub(super) async fn cmd_compact(args: &str, state: &mut AppState) -> Result<()>
" {GREEN}✓{RESET} {DIM}{}{RESET}",
state.context_guard_notice.as_deref().unwrap_or("")
);
if let Some(warning) = result.warning {
println!(" {YELLOW}!{RESET} {DIM}{warning}{RESET}");
}
println!(" {DIM}session → {}{RESET}", state.session_path.display());
Ok(())
}
Expand Down
6 changes: 6 additions & 0 deletions src/commands/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ fn print_route_status(stack: &ModelSystemConfig) {
}
print_model_ref("planner", stack.planner.as_ref());
print_model_ref("selector", stack.selector.as_ref());
print_model_ref("compaction", stack.compaction.as_ref());
print_tier_set("orchestrator", &stack.orchestrators);
print_tier_set("coder", &stack.coders);
print_review_set("review", &stack.reviewers);
Expand Down Expand Up @@ -215,6 +216,11 @@ fn print_route_template() {
"thinkingDepth": "deep",
"notes": "Chooses the model route for a task."
}},
"compaction": {{
"backend": "openrouter",
"model": "anthropic/claude-3.5-haiku",
"notes": "Summarizes the transcript when context is compacted. Omit to inherit the main model."
}},
"orchestrators": {{
"low": {{ "backend": "ollama", "model": "qwen2.5-coder:7b" }},
"medium": {{ "backend": "openrouter", "model": "qwen/qwen-2.5-coder-32b-instruct" }},
Expand Down
Loading