Skip to content

Commit a9edbd7

Browse files
Sg312emir-karabeg
authored andcommitted
Renaming
1 parent bd35dda commit a9edbd7

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,18 +1105,25 @@ function SubAgentThinkingContent({
11051105
)
11061106
}
11071107

1108+
/**
1109+
* Subagents that should collapse when done streaming.
1110+
* Default behavior is to NOT collapse (stay expanded like edit).
1111+
* Only these specific subagents collapse into "Planned for Xs >" style headers.
1112+
*/
1113+
const COLLAPSIBLE_SUBAGENTS = new Set(['plan', 'debug', 'research', 'info'])
1114+
11081115
/**
11091116
* SubagentContentRenderer handles the rendering of subagent content.
11101117
* - During streaming: Shows content at top level
1111-
* - When done (not streaming): Collapses everything under a header like "Explored for 20s >"
1112-
* - Exception: "edit" subagent always stays at top level, never collapses
1118+
* - When done (not streaming): Most subagents stay expanded, only specific ones collapse
1119+
* - Exception: plan, debug, research, info subagents collapse into a header
11131120
*/
11141121
function SubagentContentRenderer({
11151122
toolCall,
1116-
isEditSubagent,
1123+
shouldCollapse,
11171124
}: {
11181125
toolCall: CopilotToolCall
1119-
isEditSubagent: boolean
1126+
shouldCollapse: boolean
11201127
}) {
11211128
const [isExpanded, setIsExpanded] = useState(true)
11221129
const [duration, setDuration] = useState(0)
@@ -1143,12 +1150,12 @@ function SubagentContentRenderer({
11431150
return () => clearInterval(interval)
11441151
}, [isStreaming])
11451152

1146-
// Auto-collapse when streaming ends (except for edit subagent)
1153+
// Auto-collapse when streaming ends (only for collapsible subagents)
11471154
useEffect(() => {
1148-
if (!isStreaming && !isEditSubagent) {
1155+
if (!isStreaming && shouldCollapse) {
11491156
setIsExpanded(false)
11501157
}
1151-
}, [isStreaming, isEditSubagent])
1158+
}, [isStreaming, shouldCollapse])
11521159

11531160
// Build segments: each segment is either text content or a tool call
11541161
const segments: Array<{ type: 'text'; content: string } | { type: 'tool'; block: SubAgentContentBlock }> = []
@@ -1213,7 +1220,7 @@ function SubagentContentRenderer({
12131220
}
12141221
if (segment.type === 'tool' && segment.block.toolCall) {
12151222
// For edit subagent's edit_workflow tool: only show the diff summary, skip the tool call header
1216-
if (isEditSubagent && segment.block.toolCall.name === 'edit_workflow') {
1223+
if (toolCall.name === 'edit' && segment.block.toolCall.name === 'edit_workflow') {
12171224
return (
12181225
<div key={`tool-${segment.block.toolCall.id || index}`} className='mt-2'>
12191226
<WorkflowEditSummary toolCall={segment.block.toolCall} />
@@ -1231,7 +1238,8 @@ function SubagentContentRenderer({
12311238
</>
12321239
)
12331240

1234-
if (isEditSubagent || isStreaming) {
1241+
// During streaming OR for non-collapsible subagents: show content at top level
1242+
if (isStreaming || !shouldCollapse) {
12351243
return (
12361244
<div className='w-full'>
12371245
{renderCollapsibleContent()}
@@ -1240,7 +1248,7 @@ function SubagentContentRenderer({
12401248
)
12411249
}
12421250

1243-
// Completed non-edit subagent: show collapsible header
1251+
// Completed collapsible subagent (plan, debug, research, info): show collapsible header
12441252
// Plan artifact stays outside the collapsible
12451253
return (
12461254
<div className='w-full'>
@@ -1927,7 +1935,7 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
19271935
return (
19281936
<SubagentContentRenderer
19291937
toolCall={toolCall}
1930-
isEditSubagent={toolCall.name === 'edit'}
1938+
shouldCollapse={COLLAPSIBLE_SUBAGENTS.has(toolCall.name)}
19311939
/>
19321940
)
19331941
}

apps/sim/lib/copilot/tools/client/other/oauth-request-access.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ export class OAuthRequestAccessClientTool extends BaseClientTool {
7171
displayNames: {
7272
[ClientToolCallState.generating]: { text: 'Requesting integration access', icon: Loader2 },
7373
[ClientToolCallState.pending]: { text: 'Requesting integration access', icon: Loader2 },
74-
[ClientToolCallState.executing]: { text: 'Connecting integration', icon: Loader2 },
74+
[ClientToolCallState.executing]: { text: 'Requesting integration access', icon: Loader2 },
7575
[ClientToolCallState.rejected]: { text: 'Skipped integration access', icon: MinusCircle },
76-
[ClientToolCallState.success]: { text: 'Integration connected', icon: CheckCircle },
76+
[ClientToolCallState.success]: { text: 'Requested integration access', icon: CheckCircle },
7777
[ClientToolCallState.error]: { text: 'Failed to request integration access', icon: X },
7878
[ClientToolCallState.aborted]: { text: 'Aborted integration access request', icon: XCircle },
7979
},
@@ -87,17 +87,16 @@ export class OAuthRequestAccessClientTool extends BaseClientTool {
8787
switch (state) {
8888
case ClientToolCallState.generating:
8989
case ClientToolCallState.pending:
90-
return `Requesting ${name} access`
9190
case ClientToolCallState.executing:
92-
return `Connecting to ${name}`
91+
return `Requesting ${name} access`
9392
case ClientToolCallState.rejected:
9493
return `Skipped ${name} access`
9594
case ClientToolCallState.success:
96-
return `${name} connected`
95+
return `Requested ${name} access`
9796
case ClientToolCallState.error:
98-
return `Failed to connect ${name}`
97+
return `Failed to request ${name} access`
9998
case ClientToolCallState.aborted:
100-
return `Aborted ${name} connection`
99+
return `Aborted ${name} access request`
101100
}
102101
}
103102
return undefined
@@ -151,9 +150,12 @@ export class OAuthRequestAccessClientTool extends BaseClientTool {
151150
})
152151
)
153152

154-
// Mark as success - the modal will handle the actual OAuth flow
153+
// Mark as success - the user opened the prompt, but connection is not guaranteed
155154
this.setState(ClientToolCallState.success)
156-
await this.markToolComplete(200, `Opened ${this.providerName} connection dialog`)
155+
await this.markToolComplete(
156+
200,
157+
`The user opened the ${this.providerName} connection prompt and may have connected. Check the connected integrations to verify the connection status.`
158+
)
157159
} catch (e) {
158160
logger.error('Failed to open OAuth connect modal', { error: e })
159161
this.setState(ClientToolCallState.error)

0 commit comments

Comments
 (0)