Repository navigation
[EPIC-D][LOU-D25] github and jira tools are defined with defineTool; src/tools has no ai import - #114
Merged
Merged
Conversation
…src/tools has no ai import All 28 GitHub and 20 Jira descriptors are built with defineTool (names, descriptions, schemas and factory signatures unchanged) and carry canonical inputSchema / execute. GitHubTools.register() disables out-of-scope tools by registering a copy whose canonical execute and legacy tool.execute both throw. JiraTools.register() now routes defineTool results through the sandbox seam. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
createGitHubTools()tools and all 20createJiraTools()tools are built withdefineToolinstead ofai'stool(). Names, descriptions, zod schemas, sandbox flags and factory signatures are unchanged. Each tool now carries canonicalinputSchema/execute, and the legacy.toolstays.this.register('name', { displayName, tool: tool({ ... }) })pattern). Inner lines keep their indentation, so only each tool's header and footer lines changed.parameters:becameinput:.GitHubTools.register()disables the out-of-scope tools by registering a copy of the descriptor whose canonicalexecuteand legacytool.executeboth throw the "out of scope" error. A canonicalexecutetakes priority, so overriding onlytool.executewould have left the real implementation reachable. This is the same hazard D24 fixed inexamples/ops-pipeline/fixer.ts.JiraTools.register()now routes adefineToolresult throughrouteFetchThroughSandboxas well. Before, theregister(DefinedTool)overload skipped it, so a descriptor registered that way would not have been flaggedrequiresSandbox.src/tools/noAiToolImport.test.tslistsgithub.tsandjira.ts. CHANGELOG has an entry under Changed (not breaking).Why
Step 4 of the
aiv4 -> v6/v7 upgrade chain (after D22 #79, D23 #103 and D24 #108). With the lasttool()call undersrc/toolsgone, the legacy.toolshape can be removed in D26.aiimports remaining undersrc/:src/types/tool.ts(type import),src/providers/*(OpenRouterProvider,AnthropicProvider,OpenAIProvider,OllamaProvider,aiSdkProvider),src/execution/structuredOutput.tsandsrc/execution/errors.ts.src/tools/toolContract.test.tsandsrc/tools/defineTool.test-d.ts(they importaito assert thatdefineToolno longer callsai.tool()), plus provider and execution tests.No production file under
src/toolsimportsaiany more. A literalgrep -rn "from 'ai'" src/toolsstill matches those two D22 test files. I left them alone because they are out of this ticket's scope and they test the absence oftool().Acceptance criteria
defineTool(28 + 20), import nothing fromai, and keep names, descriptions, schemas and factory signatures unchanged. Neither file setsneedsApprovalorrequiresSandboxitself, so no such flags changed.requiresSandboxandsandboxExecuteare still set inregister()viarouteFetchThroughSandbox.execute: a new test calls every out-of-scope GitHub tool throughgetToolExecute()anddescriptor.executeand expects the "out of scope" error with nofetchcall.github.test.tsandjira.test.tspass with no edits to existing assertions. I only added new tests, and the existing tests still call.tool.execute, which now equals the canonicalexecute.noAiToolImport.test.ts.How verified
npx tsc --noEmit: pass, no output.npm run lint: 0 errors, 402 warnings. For the files I touched,github.ts+jira.tsstill have 23 warnings, the same as onorigin/main, and the two test files have 18, with none added.npm run test:types: 30 passed, no type errors.npx vitest runafternpm run build(the create-loushy-agent e2e test needsdist): 160 files passed, 2337 tests passed, 3 skipped.npm run build && npm run build --workspace=packages/create-loushy-agent: success.npm run test:coverage: exit 0.npm run fallow: exit 0, "No issues found" in dead code, and no refactor targets above threshold. It lists one existing duplicate block,AnthropicProvider.tsandOpenAIProvider.ts, which this PR does not touch.docs:verify-snippetsanddocs:llms:checkwere not run, since README and docs are untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
Generated by Claude Code