Skip to content

feat(chat): auto-create agent on connection install with passport card UI#2857

Open
rafavalls wants to merge 3 commits intomainfrom
rafavalls/auto-connection-agent
Open

feat(chat): auto-create agent on connection install with passport card UI#2857
rafavalls wants to merge 3 commits intomainfrom
rafavalls/auto-connection-agent

Conversation

@rafavalls
Copy link
Collaborator

@rafavalls rafavalls commented Mar 24, 2026

What is this contribution about?

When a user installs a new MCP connection, automatically opens Decopilot chat and triggers creation of a specialized agent for that connection. The newly created agent is displayed in the chat as a stylized "passport card" with 3D tilt effects, holographic gradients, guilloche patterns, and a certification stamp.

Key changes:

  • Auto-agent trigger (connections.tsx): On successful connection install, injects app context with agent-creation instructions into Decopilot and fires a new chat thread
  • AgentPassportCard (agent-passport-card.tsx): New component rendering COLLECTION_VIRTUAL_MCP_CREATE results as a passport-styled card with interactive hover effects
  • Chat routing (assistant.tsx): Routes COLLECTION_VIRTUAL_MCP_CREATE tool calls to the passport card renderer
  • Bug fixes: Fixed race condition in app context lifecycle (clearAppContext called before message sent), explicit handling of denied tool calls, input sanitization for prompt injection mitigation, removed dead code (unused navigate, inert draft param)

Screenshots/Demonstration

UI changes — screenshots to be added.

How to Test

  1. Start the dev environment with bun run dev
  2. Navigate to an organization's connections page
  3. Install/authenticate a new MCP connection
  4. Observe that Decopilot chat opens automatically and begins creating an agent
  5. Verify the agent passport card renders in the chat with the agent's name, description, icon, and a "See agent" button
  6. Click "See agent" to navigate to the agent detail page

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Automatically creates a specialized agent when a new MCP connection is installed and opens Decopilot chat to show it as a passport-style card. Also hardens DuckDB availability checks and test skips to stabilize CI monitoring.

  • New Features

    • Auto-opens chat and creates an agent after connection install using app context and a new thread.
    • Renders the created agent with AgentPassportCard (3D tilt, holographic gradients, guilloche, certification stamp) and a “See agent” link.
    • Routes COLLECTION_VIRTUAL_MCP_CREATE tool calls to the passport card renderer; shows avatar, name, description, and linked connections.
  • Bug Fixes

    • Fixed race where app context was cleared before message send; now persists until replaced.
    • DuckDBEngine.isAvailable() now instantiates, connects, and disconnects via @duckdb/node-api, and tests use this check to skip in CI; falls back when unavailable.
    • Improved tool-call safety: explicit denied/error handling and output sanitization; removed dead parameters and unused code.

Written for commit 3907563. Summary will update on new commits.

…d UI

When a user installs a new MCP connection, automatically open Decopilot
chat to create a specialized agent for that connection. Display the
created agent as a stylized "passport card" in the chat with 3D tilt
effects, holographic gradients, and guilloche patterns.

Includes fixes for race condition in app context lifecycle, explicit
handling of denied tool calls, and input sanitization for prompt
injection mitigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

🧪 Benchmark

Should we run the Virtual MCP strategy benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

Release Options

Suggested: Minor (2.203.0) — based on feat: prefix

React with an emoji to override the release type:

Reaction Type Next Version
👍 Prerelease 2.202.5-alpha.1
🎉 Patch 2.202.5
❤️ Minor 2.203.0
🚀 Major 3.0.0

Current version: 2.202.4

Note: If multiple reactions exist, the smallest bump wins. If no reactions, the suggested bump is used (default: minor).

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

rafavalls and others added 2 commits March 25, 2026 00:31
DuckDBEngine.isAvailable() only checked if the module could be imported,
not if an instance could actually be created. In CI environments with
constrained thread limits, DuckDB loads but fails with "Number of threads
must be positive!" — causing unhandled rejections that leak into other
test shards.

Now isAvailable() creates and tears down a trial instance, so
createMonitoringEngine falls back to NoopEngine when DuckDB can't
actually run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix type error where `instance.connect()` was not awaited in
`isAvailable()`. Also update pipeline.integration.test.ts to use
`DuckDBEngine.isAvailable()` instead of a bare require check, so the
test correctly skips in CI where DuckDB loads but cannot instantiate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant