diff --git a/frontend/src/lib/components/copilot/chat/shared.test.ts b/frontend/src/lib/components/copilot/chat/shared.test.ts index f85763561f..3af1f6f0fb 100644 --- a/frontend/src/lib/components/copilot/chat/shared.test.ts +++ b/frontend/src/lib/components/copilot/chat/shared.test.ts @@ -1972,6 +1972,14 @@ describe('createSearchHubScriptsTool', () => { }) describe('getHubIntegrationTool', () => { + // The plan-mode gate fails closed, so a read-only tool that is not tagged is + // silently unusable while planning. + it('is usable while planning, like the hub search beside it', async () => { + const { getHubIntegrationTool, createSearchHubScriptsTool } = await import('./shared') + expect(getHubIntegrationTool.planModeSafe).toBe(true) + expect(createSearchHubScriptsTool().planModeSafe).toBe(true) + }) + const doc = { app: 'confluence', display_name: 'Confluence', diff --git a/frontend/src/lib/components/copilot/chat/shared.ts b/frontend/src/lib/components/copilot/chat/shared.ts index 1395686857..d15d086e1d 100644 --- a/frontend/src/lib/components/copilot/chat/shared.ts +++ b/frontend/src/lib/components/copilot/chat/shared.ts @@ -1516,6 +1516,8 @@ function parseResourceTypeSchema(schema: unknown): unknown { export const getHubIntegrationTool = { def: getHubIntegrationToolDef, + // Reads one hub document over a GET and writes nothing, so planning may use it. + planModeSafe: true, fn: async ({ args, toolId, toolCallbacks }) => { const { integration } = getHubIntegrationSchema.parse(args) toolCallbacks.setToolStatus(toolId, { content: `Reading the ${integration} integration...` })