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
7 changes: 5 additions & 2 deletions roles/omp/files/omp-route
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
set -uo pipefail

RESERVE_PCT="${OMP_ROUTE_RESERVE_PCT:-10}"
# Claude Max runs to its limit: no reserve held back on it.
CLAUDE_RESERVE_PCT="${OMP_ROUTE_CLAUDE_RESERVE_PCT:-0}"
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/omp-route/probe.json"
CACHE_TTL="${OMP_ROUTE_CACHE_TTL:-300}"
LAST_RESORT="meta/muse-spark-1.3-contributor"
Expand Down Expand Up @@ -44,8 +46,9 @@ probe() {

# Prints "ok", "skip", or "unknown" for one candidate.
verdict() {
local json="$1" provider="$2" scope="$3"
jq -r --arg p "$provider" --arg s "$scope" --argjson r "$RESERVE_PCT" '
local json="$1" provider="$2" scope="$3" reserve="$RESERVE_PCT"
[[ "$provider" == claude ]] && reserve="$CLAUDE_RESERVE_PCT"
jq -r --arg p "$provider" --arg s "$scope" --argjson r "$reserve" '
[.readings[] | select(.provider == $p)] as $rs
| if ($rs | length) == 0 then "unknown" else
$rs[0] as $x
Expand Down
2 changes: 1 addition & 1 deletion roles/omp/files/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ retry:
fallbackOn: any
fallbackRevertPolicy: cooldown-expiry # drift back to Claude once its window resets
usageAwareFallback: true
usageReservePct: 10
usageReservePct: 0 # no reserve: stay on Claude Max until its window is actually spent
usageReservePolicy: auto # switch at the reserve without prompting
fallbackChains:
default: &chain
Expand Down
Loading