Repository navigation
Releases
0.3.0 - 2026-11-24
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
c...
0.2.1 - 2026-11-21
Release Notes
Added
scripts/install.sh: installsmodel-routerandmron Linux or macOS from
the release download bucket, with SHA-256 verification,--version, and
--to. The R2 downloads workflow copies each release's archives to a
Cloudflare R2 bucket and uploads the installer there, since GitHub release
assets of the private repository need a token.
Security
serve --http: enforce the 64 KiB header cap while reading lines, cap long-lived event streams andwait_runrequests at 24 of the 32 authenticated connection slots so quick calls (cancel_run,run_status) stay runnable, and verify project trust once per call.- Cap config and benchmark reads at 2 MiB and provider model / Codex catalog reads at 16 MiB; harden project trust approvals, OS sandbox path resolution, protected-path validation, pre-ship secret scanning, and terminal escape cleaning on handoff and progress feeds.
Changed
- Replace
fs2with directlibc::flockinsrc/storage.rs, replacectrlc(and its dedicated signal thread and duplicatenixversion) with async-signal-safelibc::sigactionhandlers (SIGINT,SIGTERM,SIGHUP) insrc/main.rs, and trimchronodefault features toclock,serde, andstd. - Pool HTTP clients across providers, task imports, and webhooks; use persistent notification/reaper worker threads; parallelize
doctorharness checks and provider pricing refreshes; index pricing tables by model/family with case-insensitive lookup. - Optimize engine, snapshot, ship, and storage paths: skip fsync on regenerable scratch artifacts, stream patch lines and git status/changed paths with bounded stderr capture, reduce prompt/history allocations, and harden graph/fan-out scheduling and state recovery.
- Improve TUI responsiveness and per-frame efficiency: conditional animation/elapsed timers, adaptive idle event polling (
250 ms), backgrounded saved-run sizing and worktree apply planning, viewport-windowed pickers and diff/file lists, coalesced wrapped textarea spans, and cached output search, diff stats, and completion briefs.
Fixed
- Detect TUI PTY hangup without a controlling terminal via zero-timeout
poll(POLLHUP/POLLERR/POLLNVAL), stopping active runs and restoring terminal modes across normal exit, error paths, and panics. - Fix permanent
StatsCacheloading locks when switching projects, stale one-frame output search status, multi-lineAsk::ApplyWorktreedialog truncation, and overflow-prone UI/duration calculations. - Harden process-group capture, interactive terminal-host teardown, and crash-recovery termination under signal and timeout races.
- Detect TUI terminal hangup on macOS, where
pollreportsPOLLHUPonly whenPOLLINis requested. - On macOS, retry reading a process group member's run marker when
sysctl(KERN_PROCARGS2)fails briefly withEIOorEINVAL, so recovery and teardown no longer skip a leaderless group that is the run's own.
Install model-router 0.2.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Tyru5/model-router/releases/download/v0.2.1/model-router-installer.sh | shInstall prebuilt binaries via Homebrew
brew install model-routerDownload model-router 0.2.1
| 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 |