fix: let plan mode use the hub integration lookup

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-08-25 17:25:58 +02:00
parent 7667de3b5f
commit a015ae00a5
2 changed files with 10 additions and 0 deletions
@@ -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',
@@ -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...` })