Skip to content

feat: index autorouter captures by agentId for multi-agent gateway#8

Merged
rjcloudsigma merged 1 commit into
mainfrom
feat/autorouter-agent-keying
May 25, 2026
Merged

feat: index autorouter captures by agentId for multi-agent gateway#8
rjcloudsigma merged 1 commit into
mainfrom
feat/autorouter-agent-keying

Conversation

@rjcloudsigma
Copy link
Copy Markdown
Collaborator

Follows up #7. The previous capture map was keyed only by the plugin-derived sessionId, which the Studio cannot easily reconstruct because it does not know each agent gateway-side workspace dir. Add an agentId-keyed alias derived from agentDir/workspaceDir (workspace -> main, workspace-X -> X) or OPENCLAW_AGENT_ID env. The taas.autorouter.lastRoute RPC now accepts { agentId } and prefers the agent-keyed lookup so multi-agent gateways serve each agent the correct routing metadata.

Adds a second in-memory index keyed by a derived agent identifier (env OPENCLAW_AGENT_ID/RUN_ID first, then trailing path segment of agentDir/workspaceDir — "workspace" -> "main", "workspace-new-agent-3" -> "new-agent-3"). Extends the taas.autorouter.lastRoute RPC to accept { agentId } and prefer the agent-keyed lookup. Studio passes its known agentId so each agent gets ITS routing metadata in a multi-agent gateway process. Smoke test covers the new path.
@rjcloudsigma rjcloudsigma merged commit 191fdb6 into main May 25, 2026
@rjcloudsigma rjcloudsigma deleted the feat/autorouter-agent-keying branch May 25, 2026 15:34
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