Skip to content

feat: capture TaaS autorouter response headers + expose via gateway RPC#7

Merged
rjcloudsigma merged 1 commit into
mainfrom
feat/autorouter-response-headers
May 25, 2026
Merged

feat: capture TaaS autorouter response headers + expose via gateway RPC#7
rjcloudsigma merged 1 commit into
mainfrom
feat/autorouter-response-headers

Conversation

@rjcloudsigma
Copy link
Copy Markdown
Collaborator

Adds an onResponse callback in wrapStreamFn that captures X-TaaS-Autorouter-* + X-TaaS-Thinking-Applied + X-TaaS-Routed-Context-Window headers from autorouted TaaS responses, and exposes them via a new gateway RPC taas.autorouter.lastRoute. Backs the Alien AI Studio Auto-Routing Model UX PRD (Confluence 1901363271). Zero OpenClaw core changes — uses existing plugin SDK hooks.

Adds an onResponse callback to the wrapStreamFn options that reads X-TaaS-Autorouter-* and X-TaaS-Thinking-Applied and X-TaaS-Routed-Context-Window response headers from autorouted TaaS calls, stores them in an in-memory per-session map (bounded to 256 entries, oldest-evicted), and exposes them via a new gateway RPC: taas.autorouter.lastRoute. Alien AI Studio (PRD Confluence 1901363271) polls this method after each turn to populate the routed model, algo, source, thinking-applied, and context-window fields in the AgentChatPanel for cloudsigma/auto and other autorouted requests. Smoke test extended to cover both the header capture and the gateway method response shape. Zero OpenClaw core changes — uses existing wrapStreamFn + registerGatewayMethod hooks. Registration is guarded for older API surfaces that lack registerGatewayMethod.
@rjcloudsigma rjcloudsigma merged commit 520efe7 into main May 25, 2026
@rjcloudsigma rjcloudsigma deleted the feat/autorouter-response-headers branch May 25, 2026 13:58
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