Repository navigation
feat: a routing page built around keys, with rules edited in order and a dry run that says which route it used - #47
Merged
Merged
Conversation
…d a dry run that says which route it used The old page repeated the default route in a card and in the list, showed the synthesised default rule and __all__ group as if they were in the file (with delete and locate buttons that could never work), and appended every new rule after the catch-all, where its forward or deny is never chosen. Rules could not be edited or reordered, and the dry run silently evaluated the first key. The page now follows the upstream page: - Two tabs, routes and groups. Lists are read-only; everything is done in dialogs from the row menu, the context menu or a double click, and every save is one config version. - Routes: the default route leads the list and names the keys that follow it. Each row spells out the rules that decide where requests go, and flags a missing catch-all or rules shadowed by one. Row menu: edit, dry run, duplicate, set as default (confirming which keys move), locate, delete (choosing where its keys go, the default route by default). - Route dialog: name, which keys use the route (the same field a key's route is stored in), and the rules in order. Drag or use the row menu to reorder; new rules go before the catch-all; shadowed rules can be lifted in one click. - Rule dialog: conditions with a control per kind (model with suggestions and a count of matching known models, comparisons, yes/no, formats, assistant request classes, keys, chosen upstream), then forward / deny / continue, then rewrite and guard add-ons. A condition on assistant requests that are not routed says so and can route them in the same save. - Groups: the built-in all-upstreams group is listed as such and cannot be edited; select groups can switch their preferred upstream from the row menu; a group still referenced cannot be deleted. The group dialog sets strategy, members and their order, the preferred member and stickiness. - Dry run is a dialog: pick a key (or run a route, or the unsaved draft from the route dialog), it recomputes as the request changes and lists every rule with why it did or did not decide. The built-in group is labelled as all upstreams in request details too. The routing section of Config.tsx and the old Routes/DryRun components are gone. Pins ThinkWatch-Core v0.8.0, which adds the route and group endpoints this page saves through and the dry run's route and draft targets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… group member - The model suggestion list was portaled to <body>, which a modal Radix dialog makes inert (pointer-events: none), so clicking a suggestion did nothing. The list now renders inside the dialog it belongs to. - Pressing Escape with the suggestion list open closed the whole dialog and dropped unsaved edits. It now only closes the list. - Group members wrap instead of being clipped. - The default route row no longer adds a line about keys without a route; the default badge already says it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…list changes Suggestions were read again only when the config version changed, so models core fetched in the background after startup never showed up in them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fylorn
force-pushed
the
feat/routing-page
branch
from
September 19, 2026 11:00
2f66339 to
d264ebe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Routes are assigned to keys: each key uses one route, and keys without one use the default route. The routing page now reads that way, following the layout of the upstream page.
What was wrong with the old page
__all__group that the gateway synthesises were shown as if they were in the file, with delete and locate buttons that could never work.What the page does now
clients[].routefield a key stores), and the rules in order. Reorder by dragging or from the row menu. New rules go before the catch-all, and shadowed rules can be moved above it in one click.The built-in group is labelled as all upstreams in request details too. The routing section of
Config.tsxand the oldRoutes.tsx/DryRun.tsxare removed.Key editing itself is out of scope here; the keys page will be redesigned separately. This page only relies on keys referencing a route.
Core dependency
Needs ThinkWatch-Core v0.8.0 or later (ThinkWatchProject/ThinkWatch-Core#44). After rebasing onto dev, this uses the v0.8.1 pin that #48 brought in. That version provides:
/routes,/groups,/default_routeand/modelsendpoints;reassign_toon route delete;Test plan
pnpm typecheck,pnpm vitest run(102, including 10 new routing model tests),pnpm buildcargo fmt --check,cargo clippy --all-targets -D warnings,cargo testagainst the v0.8.0 tag🤖 Generated with Claude Code