Conversation
Wirebot can now ask Jev, TypeSafe's decision model, to pick the reasoning effort for each user message instead of using one fixed level for every conversation. With WIREBOT_JEV_API_KEY set, the message text, whether it starts a new task, the attachment count and the connector name go to OpenRouter's Decisions endpoint before turn/start, and the chosen level (among the ones the selected model reports, from low up to ultra) is passed as the turn's effort. WIREBOT_JEV_FAST=auto additionally lets Jev decide per turn whether the fast service tier is worth it, using the serviceTierForTurn override so the choice never sticks to the thread. Routing is advisory and opt-in: a timeout, an API error or an unsupported level falls back to the configured settings, scheduled runs are untouched, and every decision is logged with its probabilities. The API key is scrubbed from Codex subprocess environments like the other bridge credentials.
nocell
force-pushed
the
feat/jev-turn-routing
branch
from
September 22, 2026 07:19
5a1533a to
51d3866
Compare
This branch has not been deployed
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
Opt-in per-message routing of Codex's reasoning effort (and, optionally, Fast mode) with Jev, TypeSafe's decision model, through OpenRouter's Decisions API.
Today effort and speed are one shared setting for everyone using the bot. With
WIREBOT_JEV_API_KEYset, Wirebot asks Jev before each user turn how much effort the message needs and passes the answer toturn/start:supportedReasoningEffortsfrommodel/list), soultra/maxare offered only where Codex offers them. A greeting lands onlow, a typo fix onmedium, a debugging session onhigh, a migration design onxhigh, a large research task onultra.WIREBOT_JEV_FAST=autoadds a second question — is a quick reply worth more than a thorough one — and selects the model's fast service tier (WIREBOT_JEV_FAST_TIER, defaultfast) throughserviceTierForTurn, so the choice never sticks to the thread. Off by default because Fast mode costs more credits.infolevel.Implementation
src/routing/jev.ts: thin client forPOST /api/alpha/decisionswith zod-validated answers.src/routing/turn-router.ts: builds the questions from the current model's capabilities and maps the answers toTurnStartParamsoverrides.CodexServicegains an optionalturnRoutingprovider, called in parallel withensureThreadfor user turns only; its result is spread over the configured turn settings.selectedModelmoves fromchannels/config-fields.tsintoCodexConfigServiceso both callers share it.WIREBOT_JEV_API_KEYjoinsbridgeOnlyEnvironmentKeysand is scrubbed from Codex subprocess environments like the other credentials.Testing
bun run check(tsc + biome) andbun testpass.low, small edit →medium, deploy debugging →high, architecture design →xhigh, three research prompts →ultrawith probability 1.0; fast-reply probabilities 0.83–0.90 for short messages vs 0.09–0.54 for real work, hence the 0.7 threshold).🤖 Generated with Claude Code