Skip to content

fix(certification): route si_* tools proactively to /si tenant - #7512

Merged
garvitkaushik-123 merged 4 commits into
adcontextprotocol:mainfrom
garvitkaushik-123:fix/cert-c3-si-tenant-routing
Sep 14, 2026
Merged

garvitkaushik-123 merged 4 commits into
adcontextprotocol:mainfrom
garvitkaushik-123:fix/cert-c3-si-tenant-routing

Conversation

@garvitkaushik-123

Copy link
Copy Markdown
Collaborator

Summary

  • C3 module completion was blocked because si_initiate_session never reached the /si tenant
  • Root cause: formatTenantBlock() used a reactive sibling-switch that pattern-matched "Unknown tool" in error strings, but JSON-RPC errors and adcp_error-wrapped responses never match that pattern
  • Replaced the reactive fallback with a proactive per-tool routing table built from TOOL_CATALOG — each tool call now goes directly to its owning tenant URL at session start, no error round-trip needed

What changed

  • certification-tools.ts: formatTenantBlock() now builds a {url → tools[]} routing block from TOOL_CATALOG for multi-tenant modules instead of emitting sibling-switch instructions
  • training-agent-config-tenant-urls.test.ts: Updated existing multi-tenant test to assert proactive routing; added C3-specific test confirming si_initiate_session routes to /si

Test plan

  • vitest run server/tests/unit/training-agent-config-tenant-urls.test.ts — all 10 tests pass
  • TypeScript compilation clean (no new errors in changed files)
  • Verify C3 module completion works end-to-end on staging

Closes #7483

The reactive sibling-switch in formatTenantBlock relied on matching
"Unknown tool" in error responses to trigger a tenant switch. JSON-RPC
errors and adcp_error-wrapped responses don't match that pattern, so
si_initiate_session never reached the /si tenant — blocking C3 module
completion entirely.

Replace the reactive fallback with a proactive per-tool routing table
built from TOOL_CATALOG. Each tool call is now sent directly to its
owning tenant URL at session start, eliminating the error round-trip.

Closes adcontextprotocol#7483
aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Sep 14, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean, correctly-targeted routing fix.

What I checked:

  • No findings at any severity (no critical/high/medium/low). Decision table rows 1, 4, 5, 6, 8 do not fire.
  • gated_paths: false — row 2 does not apply despite review_decision: REVIEW_REQUIRED.
  • high_risk: true only via server/src/addie/mcp/certification-tools.ts (modified) matching server/src/addie/**. Per the high-risk-flag reading, a (modified) file with no medium-or-higher finding is presumed safe — rows 3 and 5 do not fire (no deletion, no medium).
  • No no-auto-approve team match (row 7 clears).
  • App/Addie-only change: no static/schemas/source/**, no docs/reference/**, no dist/**, no migrations touched — none of the mandatory schema/docs/changeset/oneOf/immutability/patch-eligibility gates apply. No changeset needed for an Addie-only change.
  • The fix replaces a brittle reactive "unknown tool" string match with a proactive {url → tools[]} routing table from TOOL_CATALOG; reviewer verified primary-preference logic, deterministic output, parallel-array alignment, and that the session-based SI flow keeps si_initiate_session/si_send_message on /si.

Falls through to row 9 → approve.

Non-blocking note: end-to-end C3 completion on staging is unchecked in the test plan; LLM-routing ships validated at the string-builder level only. Recommend a manual smoke before merge, but this is not a blocking finding.

Avoids CodeQL js/incomplete-hostname-regexp alert caused by
interpolating a dotted hostname into a RegExp without escaping.
The toContain assertions are equally precise for this test.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approval: no reviewable delta since the prior approval; re-submitting after stale-review dismissal.

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Sep 14, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — routing refactor to formatTenantBlock is sound.

This PR replaces the reactive sibling-switch in formatTenantBlock with a proactive per-tool routing table built from TOOL_CATALOG (server/src/addie/mcp/certification-tools.ts) plus a test update. Changes are Addie/Sage server code, not the published protocol surface (no static/schemas/source/**, docs/reference, dist artifacts, or version edits), so no changeset is required and none of the spec-drift / immutability / oneOf / 3.1.x gates apply.

Gate checks:

  • gated_paths: false; review_decision: APPROVED — no path gate blocks.
  • No no-auto-approve team match.
  • high_risk: true only via (modified) match on server/src/addie/**; not a deletion, and no medium-or-higher finding on that file, so row 5 does not fire.

Medium findings

  • server/tests/unit/training-agent-config-tenant-urls.test.ts — the new si_* routing test's negative assertion matches the agent_url primary declaration line rather than the creative routing line, making the guard vacuous. Worth fixing but the reviewer recorded it as a note (not in the actionable findings list) and it does not block.

With no critical/high findings, no escalation trigger, and fewer than three medium findings, this falls through to the approve row.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approval: no reviewable delta since the prior approval; re-submitting after stale-review dismissal.

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.

fix(certification): C3 module completion blocked by missing Sponsored Intelligence sandbox endpoint

1 participant