feat(.5231): router on/off toggle in SCXChat - #2
Conversation
Add a visual Router on/off toggle to the SCXChat status strip and the effective-base plumbing behind it. HR29-additive: with the router OFF (default) requests go DIRECT to SCX and always work; ON routes chat + model-list requests via the local LiteLLM router (http://127.0.0.1:4180). - New boolean setting kritical.scxcode.routerEnabled (default false) in src/package.json contributes.configuration. - New glass/navy-cyan pill in the chat status strip labelled "Router" with on/off/direct states, a tooltip, click + keyboard toggle, posting setConfig routerEnabled and re-requesting config to reflect live state. - Host: resolveEffectiveBase() computes the base URL per request without overwriting the operator's baseUrl. Router enabled but unreachable -> transparent fallback to direct + a subtle status hint (never hard-fail). probeRouterUrl() health-checks /health/liveliness with a short timeout. - requestJson() picks http vs https by URL protocol and honours the port so the plain-http localhost router works; scxPost + fetchLiveModels both route through it identically. HR1 intact (SCX_API_KEY only). - Status strip dot/text reflect the effective base and router state. Build: esbuild green (212.9kb). Shim test 6/6. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 54 minutes. |
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What
Adds a visual Router on/off toggle to the SCXChat status strip, plus the effective-base plumbing behind it. Per HR29 (additive layers): with the router OFF (default) requests go DIRECT to SCX and always work; ON routes via the local LiteLLM router at
http://127.0.0.1:4180.Changes
Setting —
kritical.scxcode.routerEnabled(boolean, defaultfalse) insrc/package.json.Toggle UI (
chatHtml) — a glass/navy-cyan Router pill in the status strip:127.0.0.1:4180, OFF = direct to SCX (HR29 baseline, always works).Enter/Space) toggle; postssetConfig routerEnabledthen re-requestsconfigso the host re-probes and corrects the pill live.chatHtml).Host — effective base logic:
resolveEffectiveBase()computes the base URL per request — router when enabled and reachable, else the configured directbaseUrl. Never overwrites the operator'sbaseUrlsetting.probeRouterUrl()health-checks/health/livelinesswith a short timeout.requestJson()pickshttpvshttpsby URL protocol and honours the port, so the plain-http localhost router works;scxPostandfetchLiveModelsboth route through it identically.↺ router/↺ router unreachable → direct).Verify
cd src && npm run build→ esbuild green (212.9kb).node codex-wrapper/scx-agentic-shim.test.mjs→ 6/6 pass.tsc --noEmitonextension.ts→ clean.Does not touch
codex-wrapper/pack/.🤖 Generated with Claude Code