Skip to content

Commit 2ee9161

Browse files
j15zclaude
andcommitted
improvement(copilot): retire search_documentation and get_platform_actions outright, no shims
The transitional apparatus is gone: no search_documentation registry alias, no get_platform_actions handler, and the ids are out of the regenerated catalog/schemas. During the deploy window an old Mothership build calling either id gets the recoverable tool-not-found result. The two ids stay in HIDDEN_TOOL_NAMES forever — like load_agent_skill, historical persisted chats contain their tool calls and must replay without rendering chips for retired tools. The alias test is replaced by a dispatch test pinning search_docs's own catalog -> route -> handler chain and the retired ids' gone-but-chip-hidden state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e106da0 commit 2ee9161

5 files changed

Lines changed: 45 additions & 135 deletions

File tree

apps/sim/lib/copilot/tool-executor/register-handlers.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
GetBlockUpstreamReferences,
1717
GetDeployedWorkflowState,
1818
GetDeploymentLog,
19-
GetPlatformActions,
2019
GetWorkflowData,
2120
GetWorkflowRunOptions,
2221
Glob as GlobTool,
@@ -81,7 +80,6 @@ import { executeManageSandbox } from '../tools/handlers/management/manage-sandbo
8180
import { executeManageSkill } from '../tools/handlers/management/manage-skill'
8281
import { executeMaterializeFile } from '../tools/handlers/materialize-file'
8382
import { executeOAuthGetAuthLink, executeOAuthRequestAccess } from '../tools/handlers/oauth'
84-
import { executeGetPlatformActions } from '../tools/handlers/platform'
8583
import { executeOpenResource } from '../tools/handlers/resources'
8684
import { executeRestoreResource } from '../tools/handlers/restore-resource'
8785
import { executeRunCode } from '../tools/handlers/run-code'
@@ -192,7 +190,6 @@ function buildHandlerMap(): Record<string, ToolHandler> {
192190
[OauthRequestAccess.id]: h(executeOAuthRequestAccess),
193191
[OpenResource.id]: h(executeOpenResource),
194192
[RestoreResource.id]: h(executeRestoreResource),
195-
[GetPlatformActions.id]: h(executeGetPlatformActions),
196193
[ListIntegrationTools.id]: h(executeListIntegrationTools),
197194
[MaterializeFile.id]: h(executeMaterializeFile),
198195
[FunctionExecute.id]: h(executeFunctionExecute),

apps/sim/lib/copilot/tools/handlers/platform-actions.ts

Lines changed: 0 additions & 118 deletions
This file was deleted.

apps/sim/lib/copilot/tools/handlers/platform.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* @vitest-environment node
3+
*/
4+
import { describe, expect, it } from 'vitest'
5+
import { TOOL_CATALOG } from '@/lib/copilot/generated/tool-catalog-v1'
6+
import { isKnownTool, isSimExecuted } from '@/lib/copilot/tool-executor/router'
7+
import { getHiddenToolNames } from '@/lib/copilot/tools/client/hidden-tools'
8+
import { getRegisteredServerToolNames } from '@/lib/copilot/tools/server/router'
9+
10+
/**
11+
* `executeTool` gates on `isKnownTool` (catalog membership) before it ever
12+
* consults the handler registry, so a sim-routed tool needs every link of this
13+
* chain or dispatch rejects it before the handler is reached. These assertions
14+
* pin that chain for search_docs.
15+
*/
16+
describe('search_docs dispatch chain', () => {
17+
it('is in the catalog, so dispatch does not reject it as unknown', () => {
18+
expect(isKnownTool('search_docs')).toBe(true)
19+
})
20+
21+
it('routes to sim, so dispatch reaches the server tool registry', () => {
22+
expect(isSimExecuted('search_docs')).toBe(true)
23+
})
24+
25+
it('has a registered server handler', () => {
26+
expect(getRegisteredServerToolNames()).toContain('search_docs')
27+
})
28+
})
29+
30+
/**
31+
* The retired ids are fully unregistered server-side — no catalog entry, no
32+
* handler, no alias. Only the client-side chip suppression survives, forever,
33+
* so historical persisted chats replay without rendering chips for tools that
34+
* no longer exist (the load_agent_skill precedent).
35+
*/
36+
describe('retired docs-tool ids', () => {
37+
for (const retired of ['search_documentation', 'get_platform_actions']) {
38+
it(`${retired} is gone from the catalog and server registry but stays chip-hidden`, () => {
39+
expect(TOOL_CATALOG[retired]).toBeUndefined()
40+
expect(isKnownTool(retired)).toBe(false)
41+
expect(getRegisteredServerToolNames()).not.toContain(retired)
42+
expect(getHiddenToolNames().has(retired)).toBe(true)
43+
})
44+
}
45+
})

apps/sim/lib/copilot/tools/server/router.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ const baseServerToolRegistry: Record<string, BaseServerTool> = {
164164
[editWorkflowServerTool.name]: editWorkflowServerTool,
165165
[queryLogsServerTool.name]: queryLogsServerTool,
166166
[searchDocsServerTool.name]: searchDocsServerTool,
167-
// Transitional alias: sim and mothership deploy independently, so during the
168-
// rollout of the search_documentation -> search_docs rename one side is still
169-
// emitting the old id. The old params are a subset of the new, so routing them
170-
// here is safe. Remove once both repos have shipped the rename.
171-
search_documentation: searchDocsServerTool,
172167
[searchOnlineServerTool.name]: searchOnlineServerTool,
173168
[setEnvironmentVariablesServerTool.name]: setEnvironmentVariablesServerTool,
174169
[getCredentialsServerTool.name]: getCredentialsServerTool,

0 commit comments

Comments
 (0)