Skip to content

feat: add per-session AutoRouter algorithm override - #24

Merged
rjcloudsigma merged 1 commit into
mainfrom
feat/studio-autorouter-algorithm
Jul 30, 2026
Merged

feat: add per-session AutoRouter algorithm override#24
rjcloudsigma merged 1 commit into
mainfrom
feat/studio-autorouter-algorithm

Conversation

@rjcloudsigma

Copy link
Copy Markdown
Collaborator

Summary

  • add taas.autorouter.setAlgorithm { sessionId, algorithm } with null clear semantics
  • validate against the TaaS algorithm allowlist and keep overrides in a bounded 256-session LRU-like map
  • inject X-TaaS-Autorouter-Algorithm into transport turn state and wrapped stream options
  • preserve existing behavior when no override exists
  • bump plugin version to 0.12.0

Studio integration contract

Call the write-scoped gateway method before the next auto-model send:

{"sessionId":"<OpenClaw session id>","algorithm":"cost"}

Allowed: best_fit, price_performance, savings_curve, cost, ttft, tps. Clear with algorithm: null. TaaS org/department enforcement retains precedence.

Verification

  • npm run build
  • npm test (39/39)
  • npm run typecheck
  • npm run smoke

@rjcloudsigma
rjcloudsigma merged commit 619b44f into main Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant