feat(ai-proxy): add forest connectors#1505
Merged
Conversation
5 new issues
|
4dd7990 to
f4f1525
Compare
f4f1525 to
f4aa7a3
Compare
Scra3
reviewed
Mar 27, 2026
|
|
||
| export default class McpConfigChecker { | ||
| static check(mcpConfig: McpConfiguration) { | ||
| static isForestIntegrationConfig( |
|
|
||
| try { | ||
| const json = await response.json(); | ||
| errorMessage = json.error || json.title || json.description || errorMessage; |
There was a problem hiding this comment.
🟠 High zendesk/utils.ts:22
assertResponseOk extracts json.error directly into the error message, but the API can return { error: { title: '...' } }. When json.error is an object, string interpolation produces [object Object], discarding the actual error details. The sibling function validateZendeskConfig handles this correctly with json.error?.title.
- errorMessage = json.error || json.title || json.description || errorMessage;
+ errorMessage = json.error?.title || json.error || json.title || json.description || errorMessage;🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file packages/ai-proxy/src/integrations/zendesk/utils.ts around line 22:
`assertResponseOk` extracts `json.error` directly into the error message, but the API can return `{ error: { title: '...' } }`. When `json.error` is an object, string interpolation produces `[object Object]`, discarding the actual error details. The sibling function `validateZendeskConfig` handles this correctly with `json.error?.title`.
Evidence trail:
packages/ai-proxy/src/integrations/zendesk/utils.ts lines 16-28 (assertResponseOk) and lines 30-46 (validateZendeskConfig) at REVIEWED_COMMIT. Line 22 uses `json.error` directly, while line 40 correctly uses `json.error?.title` to extract nested error details.
Scra3
reviewed
Mar 31, 2026
| ) {} | ||
|
|
||
| async getConfiguration(): Promise<McpConfiguration> { | ||
| async getConfiguration(): Promise<Record<string, ToolConfig>> { |
Scra3
approved these changes
Mar 31, 2026
…orest integrations
Decouple Router from McpClient/IntegrationClient by introducing a ToolProvider interface. Router now receives ToolProvider[] instead of raw configs, and a factory handles the MCP vs integration split. - Add ToolProvider interface (loadTools, checkConnection, dispose) - Add createToolProviders factory to split configs - McpClient/IntegrationClient implement ToolProvider - Router accepts toolProviders[] instead of mcpConfigs - McpConfigChecker uses factory instead of manual type guard - Fix McpClient.loadTools() tool accumulation bug - Fix validateZendeskConfig response.json() before response.ok check - Clean McpConfiguration type (remove ForestIntegrationConfig union) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The class no longer has any MCP-specific logic — it delegates to the ToolProvider factory. The new name reflects its actual responsibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Parameters<AiRouter['route']>[0] from agent-toolkit instead of maintaining a local copy that can diverge silently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Internal lib, no need for backward compat shim. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ider RemoteTools was both an aggregator and a Brave tool factory. Now Brave is a ToolProvider like McpClient and IntegrationClient. RemoteTools becomes a pure container. - Add BraveToolProvider implementing ToolProvider - Router creates BraveToolProvider from localToolsApiKeys - Simplify RemoteTools constructor (no more apiKeys) - Remove getIntegratedTools dispatcher (no longer needed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename class IntegrationClient → ForestIntegrationClient - Rename file integration-client.ts → forest-integration-client.ts - Move isForestIntegrationConfig guard to forest-integration-client.ts (colocated with the type it discriminates) - Update all imports and test mocks Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The refactoring to ToolProvider silently dropped dispose error logging. Inspect Promise.allSettled results and log rejected settlements to prevent silent resource leaks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test was passing { configs: { server1: ... } } (wrapped) but the
type now expects Record<string, ToolConfig> (flat).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e0bf102 to
402767a
Compare
forest-bot
added a commit
that referenced
this pull request
Mar 31, 2026
# @forestadmin/agent-toolkit [1.2.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent-toolkit@1.1.0...@forestadmin/agent-toolkit@1.2.0) (2026-03-31) ### Features * **ai-proxy:** add forest connectors ([#1505](#1505)) ([6181114](6181114))
forest-bot
added a commit
that referenced
this pull request
Mar 31, 2026
# @forestadmin/ai-proxy [1.7.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/ai-proxy@1.6.3...@forestadmin/ai-proxy@1.7.0) (2026-03-31) ### Features * **ai-proxy:** add forest connectors ([#1505](#1505)) ([6181114](6181114)) ### Dependencies * **@forestadmin/agent-toolkit:** upgraded to 1.2.0 * **@forestadmin/datasource-toolkit:** upgraded to 1.53.1
forest-bot
added a commit
that referenced
this pull request
Mar 31, 2026
# @forestadmin/forestadmin-client [1.38.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/forestadmin-client@1.37.19...@forestadmin/forestadmin-client@1.38.0) (2026-03-31) ### Features * **ai-proxy:** add forest connectors ([#1505](#1505)) ([6181114](6181114)) ### Dependencies * **@forestadmin/ai-proxy:** upgraded to 1.7.0 * **@forestadmin/datasource-toolkit:** upgraded to 1.53.1
forest-bot
added a commit
that referenced
this pull request
Mar 31, 2026
# @forestadmin/agent [1.76.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.75.2...@forestadmin/agent@1.76.0) (2026-03-31) ### Features * **ai-proxy:** add forest connectors ([#1505](#1505)) ([6181114](6181114)) ### Dependencies * **@forestadmin/agent-toolkit:** upgraded to 1.2.0 * **@forestadmin/datasource-customizer:** upgraded to 1.69.2 * **@forestadmin/datasource-toolkit:** upgraded to 1.53.1 * **@forestadmin/forestadmin-client:** upgraded to 1.38.0 * **@forestadmin/mcp-server:** upgraded to 1.8.11 * **@forestadmin/datasource-sql:** upgraded to 1.17.10
forest-bot
added a commit
that referenced
this pull request
Mar 31, 2026
# @forestadmin/agent-testing [1.1.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent-testing@1.0.25...@forestadmin/agent-testing@1.1.0) (2026-03-31) ### Features * **ai-proxy:** add forest connectors ([#1505](#1505)) ([6181114](6181114)) ### Dependencies * **@forestadmin/agent-client:** upgraded to 1.4.16 * **@forestadmin/datasource-customizer:** upgraded to 1.69.2 * **@forestadmin/datasource-toolkit:** upgraded to 1.53.1 * **@forestadmin/forestadmin-client:** upgraded to 1.38.0 * **@forestadmin/agent:** upgraded to 1.76.0 * **@forestadmin/datasource-sql:** upgraded to 1.17.10
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.

Definition of Done
General
Security
Note
Add Zendesk connector and refactor tool providers into a unified ToolProvider abstraction
ToolProviderinterface withloadTools,checkConnection, anddisposemethods, replacing directMcpClientlifecycle management in the router.ForestIntegrationClientsupporting Zendesk as a Forest connector, exposing 6 Zendesk tools (get/create/update tickets, get/create comments) viaServerRemoteTool.BraveToolProviderto wrap Brave search tools; Brave is no longer auto-injected intoRemoteToolsbut supplied via the provider pipeline.createToolProvidersfactory that splits a heterogeneousRecord<string, ToolConfig>intoMcpClientandForestIntegrationClientinstances.mcpConfigs/mcpServerConfigstotoolConfigsacross the router, agent, and public API surface;validMcpConfigurationOrThrowis renamed tovalidToolConfigurationOrThrow.McpClient.loadToolsnow returns tools directly instead of accumulating internal state;testConnections/closeConnectionsare renamed tocheckConnection/dispose.Macroscope summarized 402767a.