-
Notifications
You must be signed in to change notification settings - Fork 36
Fix/on mcp configuration always called #2356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JonasJesus42
wants to merge
29
commits into
main
Choose a base branch
from
fix/on-mcp-configuration-always-called
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
da2ce46
refactor(monitoring): translate log-row comment to English for code c…
JonasJesus42 1cfa8f0
fix(connections): always call ON_MCP_CONFIGURATION when updating conn…
JonasJesus42 f2d0321
feat(mesh): adiciona logs detalhados de validação no endpoint decopilot
JonasJesus42 4d9bc88
Updated agent view (#2283)
rafavalls d5b0d17
[release]: bump to 2.59.3
github-actions[bot] a6ce759
fix /mcp (#2359)
tlgimenes 44d72b7
[release]: bump to 2.59.4
github-actions[bot] a615df0
Refactor virtual MCP schemas and improve metadata handling (#2358)
tlgimenes e072084
[release]: bump to 2.59.5
github-actions[bot] 34ab7aa
fix: error boundary reset on select other (#2360)
tlgimenes 193e936
[release]: bump to 2.59.6
github-actions[bot] 0cbd51f
fix types (#2362)
tlgimenes 5785464
[release]: bump to 2.59.7
github-actions[bot] f49e5b7
feat(sidebar): add account switcher and inbox components (#2363)
tlgimenes 3733bb7
[release]: bump to 2.60.0
github-actions[bot] 3dffc72
feat(ui): add breadcrumb navigation and improve table headers (#2364)
tlgimenes bd763fb
[release]: bump to 2.61.0
github-actions[bot] b662ba0
feat(ui): unify save button UX across detail pages (#2365)
tlgimenes 4e62ee2
[release]: bump to 2.62.0
github-actions[bot] 0c5a6ff
feat(ui): Add gray sidebar and chat panel styles (#2366)
tlgimenes 35c6111
[release]: bump to 2.63.0
github-actions[bot] c2ed2fd
fix(sidebar): remove profile and security menu items, fix preferences…
tlgimenes 3d5c47d
[release]: bump to 2.63.1
github-actions[bot] 8090c36
feat(chat): enhance ThoughtSummary streaming UX with auto-scroll and …
tlgimenes bb09576
[release]: bump to 2.64.0
github-actions[bot] a30ae08
fix(sidebar): prevent organization button and chevron from appearing …
tlgimenes 13ff18e
[release]: bump to 2.64.1
github-actions[bot] 93be77d
[feat]: Virtual tools (#2351)
mcandeia 0266899
Revert "[feat]: Virtual tools (#2351)" (#2372)
pedrofrxncx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -118,23 +118,13 @@ export class VirtualMCPStorage implements VirtualMCPStoragePort { | |||||
| } | ||||||
|
|
||||||
| async findById( | ||||||
| id: string | null, | ||||||
| id: string, | ||||||
| organizationId?: string, | ||||||
| ): Promise<VirtualMCPEntity | null> { | ||||||
| // Handle Decopilot ID - return Decopilot agent with all org connections | ||||||
| if (id && isDecopilot(id)) { | ||||||
| // Extract orgId from decopilot_{orgId} pattern or use provided organizationId | ||||||
| const orgIdMatch = id.match(/^decopilot_(.+)$/); | ||||||
| let resolvedOrgId: string; | ||||||
| if (organizationId) { | ||||||
| resolvedOrgId = organizationId; | ||||||
| } else if (orgIdMatch && orgIdMatch[1]) { | ||||||
| resolvedOrgId = orgIdMatch[1]; | ||||||
| } else { | ||||||
| throw new Error( | ||||||
| `Invalid Decopilot ID format: ${id}. Expected decopilot_{orgId} or provide organizationId`, | ||||||
| ); | ||||||
| } | ||||||
| const decopilotOrgId = isDecopilot(id); | ||||||
| if (decopilotOrgId) { | ||||||
| const resolvedOrgId = organizationId ?? decopilotOrgId; | ||||||
|
|
||||||
| // Get all active connections for the organization | ||||||
| const connections = await this.db | ||||||
|
|
@@ -157,35 +147,6 @@ export class VirtualMCPStorage implements VirtualMCPStoragePort { | |||||
| }; | ||||||
| } | ||||||
|
|
||||||
| // Handle null ID - treat as Decopilot for backward compatibility | ||||||
| if (!id) { | ||||||
| if (!organizationId) { | ||||||
| throw new Error( | ||||||
| "organizationId is required when id is null (Decopilot agent)", | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| // Get all active connections for the organization | ||||||
| const connections = await this.db | ||||||
| .selectFrom("connections") | ||||||
| .selectAll() | ||||||
| .where("organization_id", "=", organizationId) | ||||||
| .where("status", "!=", "inactive") | ||||||
| .where("status", "!=", "error") | ||||||
| .execute(); | ||||||
|
|
||||||
| // Return Decopilot agent with connections populated | ||||||
| return { | ||||||
| ...getWellKnownDecopilotVirtualMCP(organizationId), | ||||||
| connections: connections.map((c) => ({ | ||||||
| connection_id: c.id, | ||||||
| selected_tools: null, // null = all tools | ||||||
| selected_resources: null, // null = all resources | ||||||
| selected_prompts: null, // null = all prompts | ||||||
| })), | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| // Normal database lookup for string IDs | ||||||
| return this.findByIdInternal(this.db, id); | ||||||
| } | ||||||
|
|
@@ -422,6 +383,8 @@ export class VirtualMCPStorage implements VirtualMCPStoragePort { | |||||
| const status: "active" | "inactive" = | ||||||
| row.status === "active" ? "active" : "inactive"; | ||||||
|
|
||||||
| const metadata = this.parseJson<{ instructions?: string }>(row.metadata); | ||||||
|
|
||||||
| return { | ||||||
| id: row.id, | ||||||
| organization_id: row.organization_id, | ||||||
|
|
@@ -433,7 +396,10 @@ export class VirtualMCPStorage implements VirtualMCPStoragePort { | |||||
| updated_at: updatedAt, | ||||||
| created_by: row.created_by, | ||||||
| updated_by: undefined, // connections table doesn't have updated_by | ||||||
| metadata: this.parseJson<{ instructions?: string }>(row.metadata), | ||||||
| metadata: { | ||||||
| ...metadata, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Spreading Prompt for AI agents
Suggested change
|
||||||
| instructions: metadata?.instructions ?? null, | ||||||
| }, | ||||||
| connections: aggregationRows.map((agg) => ({ | ||||||
| connection_id: agg.child_connection_id, | ||||||
| selected_tools: this.parseJson<string[]>(agg.selected_tools), | ||||||
|
|
||||||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Avoid logging the full raw payload on validation errors because it can expose sensitive data in logs. Log only validation errors or redact the payload.
Prompt for AI agents