(request: JsonRpcRequest)
| 241 | } |
| 242 | |
| 243 | private async handleToolsList(request: JsonRpcRequest): Promise<void> { |
| 244 | await this.retryInitIfNeeded(); |
| 245 | // Always expose the tools — even when the server root has no index. Gating |
| 246 | // availability on whether `./` is indexed (the old behavior) breaks the |
| 247 | // monorepo case where only sub-projects carry a `.codegraph/` (the agent |
| 248 | // saw zero tools and couldn't even reach an indexed sub-project by |
| 249 | // `projectPath`), and it hides the tools from a session that started before |
| 250 | // the user ran `codegraph init` (most hosts request the list once, so the |
| 251 | // freshly-built index never surfaces). #964. The not-indexed case is still |
| 252 | // safe: a call against an un-indexed path returns SUCCESS-shaped guidance |
| 253 | // ("pass projectPath / run codegraph init"), never `isError`, so it can't |
| 254 | // teach the agent to abandon codegraph. `getTools()` returns the default |
| 255 | // surface even before a project is open. |
| 256 | this.transport.sendResult(request.id, { |
| 257 | tools: this.engine.getToolHandler().getTools(), |
| 258 | }); |
| 259 | } |
| 260 | |
| 261 | private async handleToolsCall(request: JsonRpcRequest): Promise<void> { |
| 262 | const params = request.params as { |
no test coverage detected