smart-router
GitHub管理 Unity Gateway 智能路由开关,支持 Claude/Codex 会话的子模型路由切换、权限处理及用户反馈收集。
Trigger Scenarios
Install
npx skills add databricks/unity-gateway --skill smart-router -g -y
SKILL.md
Frontmatter
{
"name": "smart-router",
"metadata": {
"version": "1.4.1"
},
"description": "Enable or disable Unity Gateway subagent model routing for the current smart-routed Claude or Codex session, along with Smart Router Orchestrator when opted in.",
"allowed-tools": "Bash(\"$UCODE_SMART_ROUTER_PYTHON\" -m ucode.cli claude --enable-smart-routing), Bash(\"$UCODE_SMART_ROUTER_PYTHON\" -m ucode.cli claude --disable-smart-routing), Bash(\"$UCODE_SMART_ROUTER_PYTHON\" -m ucode.cli claude --disable-smart-routing --smart-router-feedback *), Bash(\"$UCODE_SMART_ROUTER_PYTHON\" -m ucode.cli codex --enable-smart-routing), Bash(\"$UCODE_SMART_ROUTER_PYTHON\" -m ucode.cli codex --disable-smart-routing), Bash(\"$UCODE_SMART_ROUTER_PYTHON\" -m ucode.cli codex --disable-smart-routing --smart-router-feedback *)"
}
Smart Router
Use the Python executable exported by the launching Unity Gateway installation.
Keep its path quoted and do not substitute ug or python from PATH.
- In Claude Code, run exactly
"$UCODE_SMART_ROUTER_PYTHON" -m ucode.cli claude --enable-smart-routingforonor"$UCODE_SMART_ROUTER_PYTHON" -m ucode.cli claude --disable-smart-routingforoff. - In Codex, run exactly
"$UCODE_SMART_ROUTER_PYTHON" -m ucode.cli codex --enable-smart-routingforonor"$UCODE_SMART_ROUTER_PYTHON" -m ucode.cli codex --disable-smart-routingforoff.
In PowerShell, use & "$env:UCODE_SMART_ROUTER_PYTHON" in place of
"$UCODE_SMART_ROUTER_PYTHON"; keep the remaining arguments the same.
If UCODE_SMART_ROUTER_PYTHON or UCODE_SESSION_ENV_FILE is unset, ask the user
to restart through an updated Unity Gateway with smart routing enabled.
If Codex reports permission denied reading the session controls, request native
approval for the same command with sandbox_permissions="require_escalated" and
retry only after approval. If approval is unavailable or denied, report that routing
was not changed. Do not change file permissions or disable the sandbox.
If the off command requires feedback, routing is still on. Ask why the user is
turning Smart Router off. Require at least 16 characters after trimming surrounding
whitespace; ask again if the reason is shorter. Never invent or pad their reason.
If they cancel, stop without disabling routing. Once they provide a valid reason,
repeat the off command with --smart-router-feedback '<reason>' appended, quoting
the exact text as one shell argument. After a successful toggle, submit that text
through /isaac-feedback --category smart-routing <reason>. Report a submission
failure without re-enabling routing. This requirement applies when Isaac sets
ISAAC_SMART_ROUTER_FEEDBACK to 1, true, yes, or on (case-insensitive);
do not change that flag to bypass it.
With no argument, explain that only on and off are accepted. Do not edit the state file.
This affects subsequent subagent model selection in the current session, not the root model
or first prompt. In sessions launched with ENABLE_SMART_ROUTER_ORCHESTRATOR=1, it also controls Smart Router
Orchestrator. When turned off, earlier Smart Router Orchestrator instructions
are superseded: do not start new automatic delegation or fall back to Smart Router Orchestrator role models.
Continue in the root unless the user explicitly requests a subagent. Honor that request using
native tools and normal harness model selection, without Smart Router Orchestrator; keep routing off.
Existing children can finish. When turned on, apply the smart-router-orchestrator
skill to further work only if the session was launched with ENABLE_SMART_ROUTER_ORCHESTRATOR=1.
Do not change the orchestration feature flag. Return the command's result.
Version History
-
69d9957
Current 2026-11-07 11:44
支持 Codex v2 原生加密分配,优化版本探测与升级流程。
- a403fe8 2026-11-02 10:41
- ca0804b 2026-10-18 17:58


