feat: route Discord turns between fast and deep-think via router_core #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/router-escalation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Routes each Discord turn between the fast model and the deep-think backend using the shared
router_coredecision core (installed from the boxxo-router repo) — the same routing logic as theOpen WebUI Pipe, so both front doors behave consistently.
brain.pyimportsrouter_coreand escalates hard turns (multi-tool, sequential-dependent,unit conversion, precise multi-item relay) to the deep-think backend, with a user-visible
"🧠 Switching to deep-think mode…" notice.
backends use different wire formats: dict vs JSON-string tool args, tool_call_id).
ROUTER_ENABLEDtoggle; repo-local system-prompt fallback so the module imports under test.requirements.txtpullsrouter_corevia git ref;Dockerfileinstalls git and injects theForgejo token via a BuildKit secret (never baked into a layer);
.env.exampledocuments the vars.Notable Decisions
evaluate_heuristics), keepingbrain.pysynchronous. The post-fast failure-detector escalation (which the Pipe has) is a follow-up.
differ enough that separate, correct loops are clearer than a leaky abstraction.
router_corerather than routing Discord through Open WebUI — brain.py staysself-contained (its own MCP loop), with one source of routing truth.
Test Plan
pytest -q— 8 tests green (4 new mocked-backend routing tests + existing identity-injectiontests, which now import cleanly via the prompt-file fallback).
history hygiene are covered with mocked HTTP.
real Forgejo token (no docker available in the dev sandbox).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.