Repository navigation
Release Notes
Added
-
TUI tour: on the first launch, a panel above the status line walks from
the Harnesses page through stages, the task, and starting a run to its
completion, naming the next key for each step and run state.F1shows or
hides it;<config dir>/tour.jsonrecords it finished or hidden so it
does not reopen. Earlier users (recent projects, notour.json) get a
one-time status line aboutF1instead. Seedocs/tui.md#tour. -
Delegation: a stage with
[workflows.stages.delegation]gives its agent
the router's MCP tools (delegate_task,task_status,task_wait,
task_send,task_cancel,task_apply,run_*,schedule_*) through
mr __mcp-bridgeand a per-turn Unix socket and token. Tasks run on named
[delegates.*]or allowlisted harness/model/provider targets, in their own
OS sandbox (sharedread-only orworktree), never above the parent's
privilege ceiling. Finished tasks wake the parent with a follow-up turn.
Worktree tasks return sealed patches the parent applies withtask_apply.
Parents: Claude Code, Codex, OpenCode, and custom adapters with
mcp_config_args; interactive stages too. Delegates need
model-router trust. Seedocs/delegation.md. -
Agent-launched runs (
run_launch) are driven by the TUI orserve; the
CLI leaves them pending formodel-router resume. -
Schedules:
schedule_taskwrites.model-router/schedules.json; a
schedule fires only aftermr schedules approve ID.mr schedules list|approve|pause|enable|delete|tick;servefires due schedules and
acceptsPOST /schedules/<id>/trigger.approve --digest D(and the TUI
confirm dialog) refuse a schedule changed after it was shown;list --json
includesdigest. -
Reports, previews, history, and the Runs page show tasks, wake turns, and
their cost. -
Global and project config layering: loading
<project>/.model-router.toml
layers<config dir>/config.toml's[providers.*],[adapters.*],
[delegates.*], and[pricing.*]underneath project entries (project keys
win on collision). Global entries stay trusted while project-defined and
shadowing entries requiremodel-router trust; saving a project config omits
unmodified global entries, and saving the globalconfig.tomlkeeps them. -
Built-in pricing table entries for
gpt-6,gpt-6-astra, andgpt-6.2-sol
insrc/cost/prices.toml. -
Prompt
context_files(Vec<String>on workflows and stages, up to 32
repo-relative paths or globs and 32 KiB total, symlink-safe, UTF-8 text only,
never reading.gitor.model-router) and tunable handoff budgets
(handoff_budget_bytesdefault14000,handoff_each_bytesdefault5000,
validated in1024..=200000), shown inpreviewandhandoffs. -
Transient stage retries (
[workflows.retry]and[workflows.stages.retry]
withmax_attempts0..=5,base_delay_seconds1..=600,
max_delay_secondsfrom the base to3600) that
retry unattended transient provider or network errors (HTTP
429/502/503/504/529, rate limits, overloaded, connection reset/timeout) on
the same harness and model with interruptible capped exponential backoff.
Fan-out candidates retry in a fresh worktree; a stageretryon a
delegating stage is a config error. Policy checks cover edits left by failed
attempts, and a retried run writes onerun_endmetric. -
Trust-gated lifecycle hooks (
[workflows.hooks]and
[workflows.stages.hooks]withbefore_stage,after_stage,before_ship,
on_failure), executed as argument vectors in their own process group with
MODEL_ROUTER_HOOKand stage context environment variables, and included in
project trust and run approval digests.timeout_secondsis1..=3600.
Stage hooks run once around a fan-out round (candidates start from the
filesbefore_stageprepared), and edits fromafter_stage
andon_failurehooks are captured in the stage's changes. -
Declarative diff policies (
[[workflows.policies]]with
action = "block" | "advise", non-backtrackingpattern,paths,
message) that block prohibited added lines at stage end, fan-out candidate
post-processing and selection,apply, andship(failing closed), or
inject path/diff advisories into review prompts. Whole added lines are
scanned; candidates are scanned as text diffs (binary-looking files read as
text, non-ASCII and quoted paths decoded). -
Conditional stage execution (
when_changedrepo-relative globs on stages,
up to 32, skipping unmatched stages in Git repositories; a fan-out judge with
candidates waiting never skips) and multi-review quorum gating
(review_quorumon workflows). -
Live mid-stream budget enforcement for unattended streaming stages with
on_exceed = "stop", terminating the harness process group as soon as
streamed usage exceeds stage or run USD/token caps. Caps count every live
worker (parallel stages, fan-out candidates, delegating parents and their
tasks), an exceeded run cap stops workers in every stage, a stopped worker
keeps the usage it streamed, and a run whose recorded spend is over a stop
cap when its last stage finishes ends Blocked. -
model-router schedules addCLI (--workflow,--task/--task-file,
--every/--at/--cron/--webhook,--tz, trust-gated--approve), plus
5-field cron expressions (cron; day-of-month OR day-of-week when both are
set) and timezone support (tz:"local","UTC", or"±HH:MM") across
the CLI andschedule_taskMCP tool. Atz-onlyschedule_taskedit
updates anatorcrontrigger and is refused foreveryand webhooks. -
model-router doctorchecks for[harness_versions]pins (--strictfails
on drift),[providers.*]API key variable presence, and offline harness
auth-readiness hints without reading secret contents or making network
requests;command.jsonrecords detectedharness_version. -
model-router cost --all-projectsto aggregate cost history across recent
projects, and--metrics-file <PATH>/MODEL_ROUTER_METRICS_FILEfor
lock-serialized append-only JSONL operational event export (run_start,
run_end,attempt_start,attempt_end) with no task text, prompts, or
secrets. -
model-router serve: addfork_run,apply_run(default
check_only: true),get_handoffs,get_cost,get_stats, and
list_schedulestools over both MCP and HTTP; add unauthenticated
GET /healthliveness endpoint onserve --http; advertise MCPresources
onserve --mcpand servemodel-router://runs/<run_id>/reviewand
.../diffviaresources/listand bounded, symlink-saferesources/read. -
TUI Workflow settings editor (
W/Space w W), expanded Stage editor (e:
billing, stagebudget,require_router_checks,sandbox_writable,
sandbox_network,sandbox_fallback,delegation), and Runs page parity:
fork from a stage checkpoint (K), preview and confirm ad-hoc ship (S),
inspect handoff budgets and truncation warnings (H), view status
transitions timeline (l), raise token budget caps (B), inspect delegated
tasks and their handoffs/sealed patches or cancel a single task (g), and
manage/approve project schedules (u).
Changed
- The repository is public under the MIT license. Install with the
model-router-installer.shattached to each GitHub release, or
cargo install --git https://github.com/Tyru5/model-router --locked.
The landing page links the source, releases, changelog, and issues. model-router doctor --jsonprints an object,
{"harnesses": [...], "providers": [{name, api_key_env, status}]}, instead
of a bare array of harness reports.- Built-in starter workflow and stage/workflow presets now leave stage
model
blank ("") wheregpt-6-astrawas previously hardcoded, so stages inherit
each harness's native default model out of the box.
Removed
- The R2 download mirror:
scripts/install.sh, the R2 downloads
workflow, andhttps://model-router.tiru5.me/install.sh. GitHub release
assets no longer need a token, so the release installer replaces them.
Security
- Sandboxed stages can no longer make the router run commands outside the
sandbox through Git. Aworkspace-writestage could write.git/config
(an fsmonitor or filter command), add a hook, or swap in its own.git,
and the router's unsandboxedgit add -Aafter the stage would run it.
Git config,config.worktree, and hooks are now read-only in every
sandbox mode, the.gitdirectory (or a linked worktree's.gitfile and
commondir) cannot be replaced, a stage refuses to start when a Git config
file or include target it could write would be read, aworkspace-write
stage refuses to start while its Git config or hooks entry is a symbolic
link it could replace, and the router's own Git commands disable fsmonitor
and hooks. - Ship's Git commands pass
-c core.fsmonitor=false -c core.hooksPath=/dev/nulllike the router's other Git commands, andgh
gets the same throughGIT_CONFIG_PARAMETERS, so the Git commands it runs
do too. A stage could write the hooks directory a repo's
core.hooksPathnames (husky's.husky/_, say), and ship then ran those
hooks outside the sandbox while planning. Your own hooks,pre-push
included, no longer run on ship.
Fixed
- Handoff repair saves the run before its follow-up starts, so
run.jsonno
longer names the finished harness's process group while the follow-up
runs (a crash then could leave a stale group recorded). - Budgets now count fan-out candidate spend.
cost::stage_totalssummed only
a stage's own attempts, so run and stage caps never saw candidate spend, and
model-router costleft candidates out of its history. A repair rewind past
a fan-out stage also dropped the round's candidates fromrun.json, and
their spend with them; they are now kept as the stage'sdiscarded
candidates and count in budgets,report, andcost. - Follow-up turns that resume a harness session (handoff repair, delegation
wake turns, delegated task follow-ups) count only their own spend, in the
live budget monitor and in recorded usage. Codex reports the session's
token totals and Claude Code 2.1.277+ (by detected version) its session
cost, which the router added to what the session had already spent. cost --since, the MCPget_costtool, and schedule--everyrefuse
non-ASCII and out-of-range durations (7日,99999999999999999w,
100000000d) instead of panicking.--everytakes at most 10 years, and a
hand-edited interval past the date range has no due time.- Ctrl+C ends commands that do not watch for cancellation (
trust,apply,
ship,doctor, and others) instead of being ignored. Onceshipis
confirmed, Ctrl+C ends only its Git orghcommand, and it reports what
was already done; a confirmedapplyfinishes and ignores Ctrl+C. Ctrl+C at arunorresumeprompt saves
and stops at once instead of cancelling the next stage. everyandcronschedules fire once after downtime, at the latest
missed occurrence, instead of once per missed occurrence. A cron schedule
finds it by searching back from now in widening windows.serve: aconfirm_stageorretry_stagethat fails to load a run no
longer leaves the run tied to the caller's project, which made later calls
for it fail with "belongs to project". A webhook trigger whose run fails to
start answers500with that error instead of a 409.- A stage
sandbox = "by-role"looser than the workflow'ssandbox_default
needsmodel-router trust, like any other sandbox downgrade. - Delegation run tools:
run_listwithstatusreportshas_morefor the
filtered list,run_readpages a log with invalid UTF-8 without skipping
bytes, and a run record with no stages is an error instead of a panic. - TUI: a delegated task's handoff and patch open files in the task's
worktree (or its run's checkout), not the focused run's. While a folder
loads, the folder picker ignores moves and Enter, and←goes up from the
folder being loaded. Output search no longer caches matches from stale
lines, which could misplace highlights or panic. schedules tickcounts a failed occurrence once.
Install model-router 0.3.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Tyru5/model-router/releases/download/v0.3.0/model-router-installer.sh | shInstall prebuilt binaries via Homebrew
brew install model-routerDownload model-router 0.3.0
| File | Platform | Checksum |
|---|---|---|
| model-router-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| model-router-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| model-router-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| model-router-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |