feat(go-sdk): add AgentRouter pattern for modular agent organisation Fixes #98#499
Merged
AbirAbbas merged 3 commits intoAgent-Field:mainfrom Apr 25, 2026
Merged
Conversation
Adds Router, RouterOptions, and Agent.IncludeRouter to the Go SDK, mirroring the Python AgentRouter and TypeScript AgentRouter. - NewRouter() groups reasoners and skills under a namespace - RegisterReasoner / RegisterSkill accept any existing ReasonerOption (WithDescription, WithReasonerTags, etc.) - no new types added - IncludeRouter mounts a router with dot-separated prefix + tag inheritance via a new internal withAppendTags helper that merges without clobbering - Routers nest to arbitrary depth; same Router safe to reuse across agents - Agent.IncludeRouter delegates to existing RegisterReasoner so all middleware (DID auth, VC generation, tracing) fires unchanged Files added: sdk/go/agent/router.go core implementation sdk/go/agent/router_test.go 11 integration tests
Contributor
Author
|
Hi this is my first time doing this if there is any issues do tell me |
Member
|
Hey @dhanadeep6, thank you, could you please click on the CLAassistant tag in the comment above and sign it? Once done we can proceed with the review :D |
Contributor
Author
|
@santoshkumarradha done bro |
Contributor
Performance
✓ No regressions detected |
Contributor
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
Contributor
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
Router,RouterOptions, andAgent.IncludeRouterto the Go SDK,bringing it to parity with the Python
AgentRouterand TypeScriptAgentRouteralready in the repo.
Files changed
sdk/go/agent/router.gosdk/go/agent/router_test.goUsage
Design notes
HandlerFuncandReasonerOptionwithAppendTags(unexported) mergesRouterOptions.Tagswithout clobbering per-handlerWithReasonerTagsAgent.IncludeRoutercalls existingRegisterReasoneronly — DID auth, VC generation, and tracing fire unchangedTest results
--- PASS: TestRouter_FlatMount
--- PASS: TestRouter_NoPrefix
--- PASS: TestRouter_NestedRouters
--- PASS: TestRouter_DeeplyNested
--- PASS: TestRouter_SharedRouter
--- PASS: TestRouter_EmptyRouter
--- PASS: TestRouter_HandlerFires
--- PASS: TestRouter_WithDescription
--- PASS: TestRouter_WithReasonerTags
--- PASS: TestRouter_RouterOptionsTagsApplied
--- PASS: TestRouter_MultipleMountsOnSameAgent
--- PASS: TestRouter_IssueExample
PASS
Note on
go test ./...failuresThe
sdk/go/harnesspackage has pre-existing failures on Windows that existon
mainbefore any of my changes. I verified this by runninggit stash(removingmy files entirely) and running
go test ./...— identical failures appeared.Root causes (none related to this PR):
opencode,codex,gemini,claude-code) thatare not installed in this environment
/tmp/...but Windows produces\tmp\...All packages except
harnesspass cleanly: