Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
8f0ef58
v0.5.7: combobox selectors, usage indicator, workflow loading race co…
icecrasher321 Nov 18, 2025
31c34b2
v0.5.8: notifications, billing, ui changes, store loading state machine
icecrasher321 Nov 20, 2025
842ef27
v0.5.9: add backwards compatibility for agent messages array
waleedlatif1 Nov 20, 2025
b7e814b
v0.5.10: copilot upgrade, preprocessor, logs search, UI, code hygiene
waleedlatif1 Nov 21, 2025
ebcd243
v0.5.11: stt, videogen, vllm, billing fixes, new models
waleedlatif1 Nov 25, 2025
1d08796
v0.5.12: memory optimizations, sentry, incidentio, posthog, zendesk, …
waleedlatif1 Nov 29, 2025
8c32ad4
v0.5.13: polling fixes, generic agent search tool, status page, smtp,…
waleedlatif1 Dec 1, 2025
54cc937
v0.5.14: fix issue with teams, google selectors + cleanup code
icecrasher321 Dec 1, 2025
774e5d5
v0.5.15: add tools, revert subblock prop change
icecrasher321 Dec 1, 2025
e157ce5
v0.5.16: MCP fixes, code refactors, jira fixes, new mistral models
waleedlatif1 Dec 3, 2025
3187493
v0.5.17: modals, billing fixes, bun update, zoom, dropbox, kalshi, po…
waleedlatif1 Dec 4, 2025
c3afbdd
Superagent poc
Sg312 Nov 26, 2025
04eeb59
Checkpoint brokeN
Sg312 Dec 1, 2025
7913c67
tool call rag
Sg312 Dec 2, 2025
a21b796
Fix
Sg312 Dec 2, 2025
0517d61
Fixes
Sg312 Dec 2, 2025
804c157
Improvements
Sg312 Dec 2, 2025
5ec85be
Creds stuff
Sg312 Dec 2, 2025
09bb84f
Fix
Sg312 Dec 2, 2025
dca8c78
Fix tools
Sg312 Dec 2, 2025
0258ca3
Fix stream
Sg312 Dec 3, 2025
88f5bfb
Prompt
Sg312 Dec 3, 2025
10ae3ed
Update sheets descriptions
Sg312 Dec 3, 2025
63d36b7
Better
Sg312 Dec 3, 2025
1f1a73e
Copilot components
Sg312 Dec 3, 2025
67ad858
Delete stuff
Sg312 Dec 3, 2025
d160090
Remove db migration
Sg312 Dec 3, 2025
9fe4cf4
Fix migrations
Sg312 Dec 3, 2025
5dced7f
Fix things
Sg312 Dec 3, 2025
3b56e01
Copilot side superagent
Sg312 Dec 3, 2025
b6ca604
Build workflow from chat
Sg312 Dec 3, 2025
114a224
Combine superagent into copilkot
Sg312 Dec 3, 2025
70b6a40
Render tools
Sg312 Dec 3, 2025
1c53dd7
Function execution
Sg312 Dec 3, 2025
c77405b
Max mode indicators
Sg312 Dec 3, 2025
e8c4f23
Tool call confirmations
Sg312 Dec 3, 2025
ab07356
Credential settings
Sg312 Dec 3, 2025
06aecd7
Remove betas
Sg312 Dec 3, 2025
67a8485
Bump version
Sg312 Dec 3, 2025
3af1a35
Dropdown options in block metadata
Sg312 Dec 3, 2025
23980a2
Copilot kb tools
Sg312 Dec 3, 2025
308847e
Fix lint
Sg312 Dec 4, 2025
1d22630
Credentials modal
Sg312 Dec 4, 2025
19bb425
Fix lint
Sg312 Dec 4, 2025
b0d27b9
Cleanup
Sg312 Dec 4, 2025
8331cc7
Env var resolution in superagent tools
Sg312 Dec 4, 2025
02b4035
Get id for workflow vars
Sg312 Dec 4, 2025
6e8b18c
Fix insert into subflow
Sg312 Dec 4, 2025
3241daf
Fix executor for while and do while loops
Sg312 Dec 4, 2025
756293b
Fix metadata for parallel
Sg312 Dec 5, 2025
1958448
Remove db migration
Sg312 Dec 5, 2025
de3457f
Rebase
Sg312 Dec 5, 2025
b5a8f1e
Add migrations back
Sg312 Dec 5, 2025
89e7a51
Clean up code
Sg312 Dec 5, 2025
71bcc2d
Fix executor logic issue
Sg312 Dec 5, 2025
8179e49
Cleanup
Sg312 Dec 5, 2025
f8b6e50
Diagram tool
Sg312 Dec 5, 2025
2c5d2e4
Fix tool naems
Sg312 Dec 5, 2025
813f519
Comment out g3p
Sg312 Dec 5, 2025
63a5efc
Remove popup option
Sg312 Dec 5, 2025
2009b0c
Hide o3
Sg312 Dec 5, 2025
8e64a55
Remove db migration
Sg312 Dec 5, 2025
65701c4
Merge remote-tracking branch 'origin' into feat/superagent
Sg312 Dec 5, 2025
95709c5
Merge branch 'staging' into feat/superagent
Sg312 Dec 5, 2025
fa65d31
Fix merge conflicts
Sg312 Dec 5, 2025
3eb448a
Fix lint
Sg312 Dec 5, 2025
f0bc5d0
Fix tests
Sg312 Dec 5, 2025
dafca72
Remove webhook change
Sg312 Dec 5, 2025
adae879
Remove cb change
Sg312 Dec 5, 2025
77de64b
Fix lint
Sg312 Dec 5, 2025
c2a81a6
Fix
Sg312 Dec 5, 2025
7e677d0
Fix lint
Sg312 Dec 5, 2025
833d301
Fix build
Sg312 Dec 5, 2025
3d8796c
comment out gemini
Sg312 Dec 5, 2025
8655975
Add gemini back
Sg312 Dec 5, 2025
dc27220
Merge branch 'staging' into feat/superagent
Sg312 Dec 5, 2025
2deb727
Remove bad test
Sg312 Dec 5, 2025
aca1fa6
Fix
Sg312 Dec 5, 2025
8696baa
Fix test
Sg312 Dec 5, 2025
e4fab34
Fix
Sg312 Dec 5, 2025
3d66f11
Nuke bad test
Sg312 Dec 5, 2025
6e55083
Fix lint
Sg312 Dec 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Creds stuff
  • Loading branch information
Sg312 committed Dec 5, 2025
commit 5ec85be0cdc2e545657c7836f1992ecbfe679fe4
15 changes: 11 additions & 4 deletions apps/sim/app/api/superagent/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export async function POST(req: NextRequest) {
let credentialsText = ''
const accessTokenMap: Record<string, string> = {} // provider -> accessToken
let decryptedEnvVars: Record<string, string> = {} // env var name -> decrypted value
let envVarNames: string[] = []

try {
logger.info('Fetching credentials', { userId })
Expand All @@ -268,7 +269,6 @@ export async function POST(req: NextRequest) {
})

const oauthCreds = credentialsResult.oauth?.credentials || []
const envVarNames = credentialsResult.environment?.variableNames || []

// Pre-fetch access tokens for all OAuth credentials
const requestId = generateRequestId()
Expand Down Expand Up @@ -300,6 +300,7 @@ export async function POST(req: NextRequest) {
// Fetch decrypted environment variables for API keys
try {
decryptedEnvVars = await getEffectiveDecryptedEnv(userId, workspaceId)
envVarNames = Object.keys(decryptedEnvVars)
logger.info('Fetched decrypted environment variables', {
count: Object.keys(decryptedEnvVars).length,
keys: Object.keys(decryptedEnvVars),
Expand All @@ -318,13 +319,15 @@ export async function POST(req: NextRequest) {

credentialsText = `\n\n**Available Credentials:**\n`
if (oauthCreds.length > 0) {
credentialsText += `\nOAuth Integrations:\n${oauthCreds.map((c: any) => `- ${c.name} (${c.provider})`).join('\n')}`
credentialsText += `\nOAuth Integrations (connected):\n${oauthCreds
.map((c: any) => `- ${c.name} (${c.provider})`)
.join('\n')}`
}
if (envVarNames.length > 0) {
credentialsText += `\n\nEnvironment Variables:\n${envVarNames.map((v: string) => `- ${v}`).join('\n')}`
credentialsText += `\n\nAPI Keys Configured:\n${envVarNames.map((v: string) => `- ${v}`).join('\n')}`
}
if (oauthCreds.length === 0 && envVarNames.length === 0) {
credentialsText = '\n\n**No credentials configured yet.**'
credentialsText = '\n\n**No credentials or API keys configured yet.**'
}
} catch (error) {
logger.warn('Failed to fetch credentials', {
Expand Down Expand Up @@ -509,6 +512,10 @@ CRITICAL BEHAVIOR RULES:
4. When you need a tool, silently search for it and use it without narrating the process
5. Respond naturally as if the capabilities are built into you

CREDENTIAL RULES:
- You may ONLY call OAuth-based tools for providers the user has already connected (see "Available Credentials" appended to the user's request). If a required credential is missing, ask the user to connect it before attempting the tool call.
- You may ONLY call API-key-based tools when the relevant API key name is listed under "API Keys Configured". If it is missing, ask the user to add it first.

INTERNAL WORKFLOW (do not expose to user):
- Use tool_search_tool_bm25 or tool_search_tool_regex to find tools
- Call the discovered tools directly
Expand Down
42 changes: 23 additions & 19 deletions apps/sim/app/workspace/[workspaceId]/superagent/superagent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,36 @@ const MAX_CONTENT_WIDTH = 800
* Convert raw SSE-formatted content into plain text
*/
function parseSSEContent(content: string): string {
if (!content || !content.includes('data: ')) {
if (!content || !content.includes('data:')) {
return content
}

let parsed = ''
const pattern = /data:\s*({[\s\S]*?})(?:\n|$)/g
const matches = Array.from(content.matchAll(pattern))

for (const line of content.split('\n')) {
const trimmed = line.trim()
if (!trimmed.startsWith('data: ')) continue

const payload = trimmed.slice(6)
if (!payload) continue
if (matches.length === 0) {
return content
}

try {
const data = JSON.parse(payload)
if (data.type === 'text' && typeof data.text === 'string') {
parsed += data.text
} else if (data.type === 'content' && typeof data.content === 'string') {
parsed += data.content
const parsedSegments = matches
.map((match) => {
try {
const payload = JSON.parse(match[1])
if (payload.type === 'text' && typeof payload.text === 'string') {
return payload.text
}
if (payload.type === 'content' && typeof payload.content === 'string') {
return payload.content
}
return ''
} catch {
return ''
}
} catch {
// Ignore malformed JSON payloads
}
}
})
.join('')
.trim()

return parsed || content
return parsedSegments.length > 0 ? parsedSegments : content
}

/**
Expand Down