Skip to content

Commit 60dde88

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pr-1205
# Conflicts: # frontend/src/components/thread/tool-views/command-tool/CommandToolView.tsx
2 parents daf0eaf + 15669fd commit 60dde88

File tree

149 files changed

+15534
-3658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+15534
-3658
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ supabase/.temp/storage-version
192192
.env.scripts
193193

194194
redis_data
195-
rabbitmq_data
196195

197196
.setup_progress
198197

backend/.env.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ REDIS_PORT=6379
1414
REDIS_PASSWORD=
1515
REDIS_SSL=false
1616

17-
RABBITMQ_HOST=rabbitmq
18-
RABBITMQ_PORT=5672
19-
2017
# LLM Providers:
2118
ANTHROPIC_API_KEY=
2219
OPENAI_API_KEY=

backend/README.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ docker compose down && docker compose up --build
2323

2424
You can run individual services from the docker-compose file. This is particularly useful during development:
2525

26-
### Running only Redis and RabbitMQ
26+
### Running only Redis
2727

2828
```bash
29-
docker compose up redis rabbitmq
29+
docker compose up redis
3030
```
3131

3232
### Running only the API and Worker
@@ -37,16 +37,16 @@ docker compose up api worker
3737

3838
## Development Setup
3939

40-
For local development, you might only need to run Redis and RabbitMQ, while working on the API locally. This is useful when:
40+
For local development, you might only need to run Redis, while working on the API locally. This is useful when:
4141

4242
- You're making changes to the API code and want to test them directly
4343
- You want to avoid rebuilding the API container on every change
4444
- You're running the API service directly on your machine
4545

46-
To run just Redis and RabbitMQ for development:
46+
To run just Redis for development:
4747

4848
```bash
49-
docker compose up redis rabbitmq
49+
docker compose up redis
5050
```
5151

5252
Then you can run your API service locally with the following commands:
@@ -79,9 +79,6 @@ SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
7979
# Infrastructure
8080
REDIS_HOST=redis # Use 'localhost' when running API locally
8181
REDIS_PORT=6379
82-
RABBITMQ_HOST=rabbitmq # Use 'localhost' when running API locally
83-
RABBITMQ_PORT=5672
84-
8582
# LLM Providers (at least one required)
8683
ANTHROPIC_API_KEY=your-anthropic-key
8784
OPENAI_API_KEY=your-openai-key
@@ -119,8 +116,7 @@ When running services individually, make sure to:
119116

120117
1. Check your `.env` file and adjust any necessary environment variables
121118
2. Ensure Redis connection settings match your local setup (default: `localhost:6379`)
122-
3. Ensure RabbitMQ connection settings match your local setup (default: `localhost:5672`)
123-
4. Update any service-specific environment variables if needed
119+
3. Update any service-specific environment variables if needed
124120

125121
### Important: Redis Host Configuration
126122

@@ -129,22 +125,12 @@ When running the API locally with Redis in Docker, you need to set the correct R
129125
- For Docker-to-Docker communication (when running both services in Docker): use `REDIS_HOST=redis`
130126
- For local-to-Docker communication (when running API locally): use `REDIS_HOST=localhost`
131127

132-
### Important: RabbitMQ Host Configuration
133-
134-
When running the API locally with RabbitMQ in Docker, you need to set the correct RabbitMQ host in your `.env` file:
135-
136-
- For Docker-to-Docker communication (when running both services in Docker): use `RABBITMQ_HOST=rabbitmq`
137-
- For local-to-Docker communication (when running API locally): use `RABBITMQ_HOST=localhost`
138-
139128
Example `.env` configuration for local development:
140129

141130
```sh
142131
REDIS_HOST=localhost # (instead of 'redis')
143132
REDIS_PORT=6379
144133
REDIS_PASSWORD=
145-
146-
RABBITMQ_HOST=localhost # (instead of 'rabbitmq')
147-
RABBITMQ_PORT=5672
148134
```
149135

150136
---

backend/agent/agent_builder_prompt.py

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@
5050
### 🔐 Credential Profile Management
5151
Securely connect external accounts:
5252
- **`get_credential_profiles`**: See what's already connected
53-
- **`create_credential_profile`**: Set up new service connections
54-
- **`connect_credential_profile`**: Generate secure connection links
55-
- **`check_profile_connection`**: Verify connections are working
53+
- **`create_credential_profile`**: Set up new service connections (includes connection link)
5654
- **`configure_profile_for_agent`**: Add connected services to your agent
5755
5856
### 🔄 Workflow Management
@@ -326,9 +324,30 @@
326324
327325
## 🔗 **CRITICAL: Credential Profile Creation & Tool Selection Flow**
328326
329-
When creating credential profiles for external integrations, you MUST follow this EXACT step-by-step process:
327+
When working with external integrations, you MUST follow this EXACT step-by-step process:
330328
331-
### **Step 1: Search for App** 🔍
329+
### **Step 1: Check Existing Profiles First** 🔍
330+
```
331+
"Let me first check if you already have any credential profiles set up for this service:
332+
333+
<function_calls>
334+
<invoke name="get_credential_profiles">
335+
<parameter name="toolkit_slug">[toolkit_slug if known]</parameter>
336+
</invoke>
337+
</function_calls>
338+
```
339+
340+
**Then ask the user:**
341+
"I can see you have the following existing profiles:
342+
[List existing profiles]
343+
344+
Would you like to:
345+
1. **Use an existing profile** - I can configure one of these for your agent
346+
2. **Create a new profile** - Set up a fresh connection for this service
347+
348+
Which would you prefer?"
349+
350+
### **Step 2: Search for App (if creating new)** 🔍
332351
```
333352
"I need to find the correct app details first to ensure we create the profile for the right service:
334353
@@ -340,7 +359,7 @@
340359
</function_calls>
341360
```
342361
343-
### **Step 2: Create Credential Profile** 📋
362+
### **Step 3: Create Credential Profile (if creating new)** 📋
344363
```
345364
"Perfect! I found the correct app details. Now I'll create the credential profile using the exact app_slug:
346365
@@ -352,20 +371,13 @@
352371
</function_calls>
353372
```
354373
355-
### **Step 3: Generate Connection Link** 🔗
374+
### **Step 4: MANDATORY - User Must Connect Account**
356375
```
357-
"Great! The credential profile has been created. Now I'll generate your connection link:
376+
"🔗 **IMPORTANT: Please Connect Your Account**
358377
359-
<function_calls>
360-
<invoke name="connect_credential_profile">
361-
<parameter name="profile_id">[profile_id from create response]</parameter>
362-
</invoke>
363-
</function_calls>
364-
```
378+
The credential profile has been created successfully! I can see from the response that you need to connect your account:
365379
366-
### **Step 4: MANDATORY - Wait for User Connection** ⏳
367-
```
368-
"🔗 **IMPORTANT: Please Connect Your Account**
380+
**Connection Link:** [connection_link from create_credential_profile response]
369381
370382
1. **Click the connection link above** to connect your [app_name] account
371383
2. **Complete the authorization process** in your browser
@@ -376,22 +388,11 @@
376388
**Please reply with 'connected' or 'done' when you've completed the connection process.**"
377389
```
378390
379-
### **Step 5: MANDATORY - Check Connection & Get Available Tools** 🔍
380-
```
381-
"After user confirms connection, immediately check:
382-
383-
<function_calls>
384-
<invoke name="check_profile_connection">
385-
<parameter name="profile_id">[profile_id]</parameter>
386-
</invoke>
387-
</function_calls>
388-
```
389-
390-
### **Step 6: MANDATORY - Tool Selection** ⚙️
391+
### **Step 5: MANDATORY - Tool Selection** ⚙️
391392
```
392393
"Excellent! Your [app_name] account is connected. I can see the following tools are available:
393394
394-
[List each available tool with descriptions from check_profile_connection response]
395+
[List each available tool with descriptions from discover_user_mcp_servers response]
395396
396397
**Which tools would you like to enable for your agent?**
397398
- **Tool 1**: [description of what it does]
@@ -414,9 +415,11 @@
414415
```
415416
416417
### 🚨 **CRITICAL REMINDERS FOR CREDENTIAL PROFILES**
418+
- **ALWAYS check existing profiles first** - ask users if they want to use existing or create new
419+
- **CONNECTION LINK is included in create response** - no separate connection step needed
417420
- **NEVER skip the user connection step** - always wait for confirmation
418421
- **NEVER skip tool selection** - always ask user to choose specific tools
419-
- **NEVER assume tools** - only use tools returned from `check_profile_connection`
422+
- **NEVER assume tools** - only use tools returned from `discover_user_mcp_servers`
420423
- **NEVER proceed without confirmation** - wait for user to confirm each step
421424
- **ALWAYS explain what each tool does** - help users make informed choices
422425
- **ALWAYS use exact tool names** - character-perfect matches only
@@ -429,10 +432,10 @@
429432
2. **EXACT NAME ACCURACY**: Tool names and MCP server names MUST be character-perfect matches. Even minor spelling errors will cause complete system failure.
430433
3. **NO FABRICATED NAMES**: NEVER invent, assume, or guess MCP server names or tool names. Only use names explicitly returned from tool calls.
431434
4. **MANDATORY VERIFICATION**: Before configuring any MCP server, MUST first verify its existence through `search_mcp_servers` or `get_popular_mcp_servers`.
432-
5. **APP SEARCH BEFORE CREDENTIAL PROFILE**: Before creating ANY credential profile, MUST first use `search_mcp_servers` to find the correct app and get its exact `app_slug`.
433-
6. **IMMEDIATE CONNECTION LINK GENERATION**: After successfully creating ANY credential profile, MUST immediately call `connect_credential_profile` to generate the connection link.
434-
7. **MANDATORY USER CONNECTION**: After generating connection link, MUST ask user to connect their account and WAIT for confirmation before proceeding. Do NOT continue until user confirms connection.
435-
8. **TOOL SELECTION REQUIREMENT**: After user connects credential profile, MUST call `check_profile_connection` to get available tools, then ask user to select which specific tools to enable. This is CRITICAL - never skip tool selection.
435+
5. **CHECK EXISTING PROFILES FIRST**: Before creating ANY credential profile, MUST first call `get_credential_profiles` to check existing profiles and ask user if they want to create new or use existing.
436+
6. **APP SEARCH BEFORE CREDENTIAL PROFILE**: Before creating ANY new credential profile, MUST first use `search_mcp_servers` to find the correct app and get its exact `app_slug`.
437+
7. **MANDATORY USER CONNECTION**: After creating credential profile, the connection link is provided in the response. MUST ask user to connect their account and WAIT for confirmation before proceeding. Do NOT continue until user confirms connection.
438+
8. **TOOL SELECTION REQUIREMENT**: After user connects credential profile, MUST call `discover_user_mcp_servers` to get available tools, then ask user to select which specific tools to enable. This is CRITICAL - never skip tool selection.
436439
9. **WORKFLOW TOOL VALIDATION**: Before creating ANY workflow with tool steps, MUST first call `get_current_agent_config` to verify which tools are available.
437440
10. **DATA INTEGRITY**: Only use actual data returned from function calls. Never supplement with assumed information.
438441

0 commit comments

Comments
 (0)