Handle ToolRouter aliases and historical tool slugs
loading diff…
This PR makes ToolRouter tolerant of Mercury tool renames and historical deletions without exposing deleted tools as currently executable session tools.
Changes included:
include_aliases and include_all_versions query params while preserving the existing default behavior.tool_router_tools and session /tools output.alias_of slug.The new Thermos query params are optional and default to the previous behavior. Apollo uses them only for ToolRouter validation paths that need alias/historical awareness.
Passed:
cd apps/apollo && pnpm exec oxfmt src/lib/toolRouterV2/features/session/create.ts src/lib/toolRouterV2/features/session/helpers/validateSessionConfigFields.ts src/lib/toolRouterV2/features/session/helpers/validateSessionConfigFields.unit.test.ts src/lib/toolRouterV2/utils/preload.ts src/lib/toolRouterV2/utils/preload.unit.test.ts src/lib/toolRouterV2/features/execution/executeForSessionRPC.ts src/lib/tool_execution/execute_tool.ts src/generated/thermos/types.gen.ts src/generated/thermos/services.gen.tscd apps/thermos && gofmt -w handlers/tools/enums.go ent/registrydb/utils/tool.go service_isolation/tool_alias_versioning_test.gocd apps/apollo && pnpm exec vitest run src/lib/toolRouterV2/utils/preload.unit.test.ts --config vitest.unit.config.ts (39 tests)cd apps/apollo && pnpm exec vitest run src/lib/toolRouterV2/features/session/helpers/validateSessionConfigFields.unit.test.ts --config vitest.unit.config.ts (14 tests)cd apps/thermos && go test ./handlers/tools ./ent/registrydb/utils/tools, execute, wrong-toolkit rejection, and never-known rejection all matched the intended invariant.cd apps/apollo && pnpm lint completed with 0 errors and existing warnings only.Known existing blockers observed locally:
cd apps/apollo && pnpm exec tsgo --noEmit --pretty false still fails on existing unrelated test type issues in tool_router_e2e.test.ts, restrictionConfig.test.ts, link_flow_scenario.test.ts, and session/[session_id]/execute.test.ts.cd apps/thermos && go test -tags service_isolation ./service_isolation -run 'TestAlias_ListToolEnumsByGroup' could not run locally because the service-isolation DB on localhost:54112 was not available.