Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
aeef2b7
v0.3.19: openai oss models, invite & search modal fixes
waleedlatif1 Aug 5, 2025
9f2ff7e
Merge pull request #883 from simstudioai/staging
icecrasher321 Aug 5, 2025
85cdca2
v0.3.21: gpt-5, copilot files, configurable rate limits, fix deployed…
waleedlatif1 Aug 7, 2025
5a3cf54
Checkpont
Sg312 Aug 8, 2025
74a79f6
can edit names and types
Sg312 Aug 8, 2025
caa6e50
Add reasoning and thinking
Sg312 Aug 8, 2025
4997b1c
Update agent max
Sg312 Aug 8, 2025
dbf793e
Max mode v1
Sg312 Aug 8, 2025
8caa413
Add best practices
Sg312 Aug 9, 2025
aedf5e7
v0.3.22: handle files, trigger mode, email validation, tag dropdown t…
waleedlatif1 Aug 9, 2025
a7e1eb8
Todo list shows up
Sg312 Aug 9, 2025
ba92227
Todolist works
Sg312 Aug 9, 2025
6065c4b
Updates to todo
Sg312 Aug 9, 2025
e731514
Updates
Sg312 Aug 9, 2025
def859f
Updates
Sg312 Aug 9, 2025
4ecda1a
Checkpoitn
Sg312 Aug 9, 2025
e43cd9a
Yaml export updates
Sg312 Aug 9, 2025
799aaec
Updates
Sg312 Aug 9, 2025
1ac988c
Checkpoint fr
Sg312 Aug 10, 2025
669ff04
Fix diff veiw on new workflow
Sg312 Aug 11, 2025
e38e056
Subflow autolayout fix v1
Sg312 Aug 11, 2025
9e23d90
Autolayout fixes 2
Sg312 Aug 11, 2025
f8da384
Gdrive list files
Sg312 Aug 13, 2025
178c06a
Get oauth credential (email)
Sg312 Aug 13, 2025
9b51ba7
Gdrive file picker
Sg312 Aug 13, 2025
d14ee47
Gdrive file access prompt
Sg312 Aug 13, 2025
4e74abf
Api request
Sg312 Aug 13, 2025
383a5cf
Copilot ui for some tool calls
Sg312 Aug 13, 2025
2c4e59c
Updates
Sg312 Aug 13, 2025
94b52a7
Fix overflow
Sg312 Aug 13, 2025
23f2920
Openai
Sg312 Aug 14, 2025
924dd59
Streaming
Sg312 Aug 14, 2025
4f0b323
Checkpoint
Sg312 Aug 14, 2025
4b3cf45
Update
Sg312 Aug 14, 2025
d729776
Openai responses api
Sg312 Aug 14, 2025
c49638e
Depth skeleton
Sg312 Aug 14, 2025
fe39c94
Depth tooltips
Sg312 Aug 14, 2025
8cb6048
Mode selector tool tips
Sg312 Aug 14, 2025
8299104
Update ui
Sg312 Aug 14, 2025
09a8585
Update ordering
Sg312 Aug 15, 2025
22a81a7
Lint
Sg312 Aug 15, 2025
50b55b7
Remove migrations
Sg312 Aug 15, 2025
a05b11d
Merge branch 'staging', remote-tracking branch 'origin' into feat/cop…
Sg312 Aug 15, 2025
32ac13a
Add migrations back
Sg312 Aug 15, 2025
fd42fa2
Lint
Sg312 Aug 15, 2025
9872a18
Fix isdev
Sg312 Aug 15, 2025
9fa7d79
Fix tests
Sg312 Aug 15, 2025
6323d5f
Comments
Sg312 Aug 15, 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
Checkpoitn
  • Loading branch information
Sg312 committed Aug 9, 2025
commit 4ecda1a25989f9cbfb185bfdfa4e44dd88cd8d0d
129 changes: 74 additions & 55 deletions apps/sim/stores/copilot/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,15 @@ function setToolCallState(
toolCall.result = result
}

// If this tool had a todo-id, mark it as completed
if (toolCall.todoId || toolCall.input?.['todo-id']) {
const todoId = toolCall.todoId || toolCall.input?.['todo-id']
// Handle array of todoIds
const successTodoIds = toolCall.todoIds || toolCall.input?.['todo-ids']

if (successTodoIds && Array.isArray(successTodoIds)) {
const store = useCopilotStore.getState()
if (store.updatePlanTodoStatus) {
store.updatePlanTodoStatus(todoId, 'completed')
successTodoIds.forEach(todoId => {
store.updatePlanTodoStatus(todoId, 'completed')
})
}
}

Expand All @@ -547,31 +550,35 @@ function setToolCallState(
toolCall.error = error
}

// If this tool had a todo-id, reset it to not executed state
if (toolCall.todoId || toolCall.input?.['todo-id']) {
const todoId = toolCall.todoId || toolCall.input?.['todo-id']
// Handle array of todoIds
const errorTodoIds = toolCall.todoIds || toolCall.input?.['todo-ids']

if (errorTodoIds && Array.isArray(errorTodoIds)) {
const store = useCopilotStore.getState()
// Reset the todo to not executing and not completed
// Reset the todos to not executing and not completed
store.setPlanTodos(
store.planTodos.map((todo: any) =>
todo.id === todoId ? { ...todo, executing: false, completed: false } : todo
errorTodoIds.includes(todo.id) ? { ...todo, executing: false, completed: false } : todo
)
)
}
break

case 'executing':
// Tool is now executing
// If this tool has a todo-id, mark it as executing
if (toolCall.todoId || toolCall.input?.['todo-id']) {
const todoId = toolCall.todoId || toolCall.input?.['todo-id']
// Handle array of todoIds
const executingTodoIds = toolCall.todoIds || toolCall.input?.['todo-ids']

if (executingTodoIds && Array.isArray(executingTodoIds)) {
const store = useCopilotStore.getState()
if (store.updatePlanTodoStatus) {
store.updatePlanTodoStatus(todoId, 'executing')
executingTodoIds.forEach(todoId => {
store.updatePlanTodoStatus(todoId, 'executing')
})
}
// Store the todo-id on the toolCall for later reference
if (!toolCall.todoId) {
toolCall.todoId = todoId
// Store the todo-ids on the toolCall for later reference
if (!toolCall.todoIds) {
toolCall.todoIds = executingTodoIds
}
}
break
Expand All @@ -592,14 +599,15 @@ function setToolCallState(
toolCall.error = error
}

// If this tool had a todo-id, reset it to not executed state
if (toolCall.todoId || toolCall.input?.['todo-id']) {
const todoId = toolCall.todoId || toolCall.input?.['todo-id']
// Handle array of todoIds
const rejectedTodoIds = toolCall.todoIds || toolCall.input?.['todo-ids']

if (rejectedTodoIds && Array.isArray(rejectedTodoIds)) {
const store = useCopilotStore.getState()
// Reset the todo to not executing and not completed
// Reset the todos to not executing and not completed
store.setPlanTodos(
store.planTodos.map((todo: any) =>
todo.id === todoId ? { ...todo, executing: false, completed: false } : todo
rejectedTodoIds.includes(todo.id) ? { ...todo, executing: false, completed: false } : todo
)
)
}
Expand All @@ -616,14 +624,15 @@ function setToolCallState(
toolCall.endTime = Date.now()
toolCall.duration = toolCall.endTime - toolCall.startTime

// If this tool had a todo-id, reset it to not executed state
if (toolCall.todoId || toolCall.input?.['todo-id']) {
const todoId = toolCall.todoId || toolCall.input?.['todo-id']
// Handle array of todoIds
const abortedTodoIds = toolCall.todoIds || toolCall.input?.['todo-ids']

if (abortedTodoIds && Array.isArray(abortedTodoIds)) {
const store = useCopilotStore.getState()
// Reset the todo to not executing and not completed
// Reset the todos to not executing and not completed
store.setPlanTodos(
store.planTodos.map((todo: any) =>
todo.id === todoId ? { ...todo, executing: false, completed: false } : todo
abortedTodoIds.includes(todo.id) ? { ...todo, executing: false, completed: false } : todo
)
)
}
Expand Down Expand Up @@ -899,8 +908,8 @@ const sseHandlers: Record<string, SSEHandler> = {
setToolCallState(toolCall, 'success', { result: parsedResult })

// Check if this is the plan tool and extract todos
if (toolCall.name === 'plan' && parsedResult?.todoList) {
const todos = parsedResult.todoList.map((item: any, index: number) => ({
if (toolCall.name === 'plan' && parsedResult?.todoListUser) {
const todos = parsedResult.todoListUser.map((item: any, index: number) => ({
id: item.id || `todo-${index}`,
content: typeof item === 'string' ? item : item.content,
completed: false,
Expand All @@ -914,12 +923,14 @@ const sseHandlers: Record<string, SSEHandler> = {
}
}

// Check if this tool had a todo-id - mark it as completed on success
if (toolCall.todoId || toolCall.input?.['todo-id']) {
const todoId = toolCall.todoId || toolCall.input?.['todo-id']
// Check if this tool had todo-ids - mark them as completed on success
const successTodoIds = toolCall.todoIds || toolCall.input?.['todo-ids']
if (successTodoIds && Array.isArray(successTodoIds)) {
const store = get()
if (store.updatePlanTodoStatus) {
store.updatePlanTodoStatus(todoId, 'completed')
successTodoIds.forEach(todoId => {
store.updatePlanTodoStatus(todoId, 'completed')
})
}
}

Expand All @@ -939,14 +950,14 @@ const sseHandlers: Record<string, SSEHandler> = {

setToolCallState(toolCall, targetState, { error: errorMessage })

// If this tool had a todo-id, reset it from executing state
if (toolCall.todoId || toolCall.input?.['todo-id']) {
const todoId = toolCall.todoId || toolCall.input?.['todo-id']
// If this tool had todo-ids, reset them from executing state
const errorTodoIds = toolCall.todoIds || toolCall.input?.['todo-ids']
if (errorTodoIds && Array.isArray(errorTodoIds)) {
const store = get()
// Reset the todo to not executing and not completed
// Reset the todos to not executing and not completed
if (store.planTodos) {
const updatedTodos = store.planTodos.map((todo: any) =>
todo.id === todoId ? { ...todo, executing: false, completed: false } : todo
errorTodoIds.includes(todo.id) ? { ...todo, executing: false, completed: false } : todo
)
set({ planTodos: updatedTodos })
}
Expand Down Expand Up @@ -1194,15 +1205,19 @@ const sseHandlers: Record<string, SSEHandler> = {

toolCall.state = 'executing'

// Check if this tool has a todo-id parameter - mark it as executing
if (toolCall.input?.['todo-id']) {
const todoId = toolCall.input['todo-id']
const store = get()
if (store.updatePlanTodoStatus) {
store.updatePlanTodoStatus(todoId, 'executing')
// Check if this tool has todo-ids parameter - mark them as executing
if (toolCall.input?.['todo-ids']) {
const todoIds = toolCall.input['todo-ids']
if (Array.isArray(todoIds)) {
const store = get()
if (store.updatePlanTodoStatus) {
todoIds.forEach(todoId => {
store.updatePlanTodoStatus(todoId, 'executing')
})
}
// Store the todo-ids on the toolCall for later reference
toolCall.todoIds = todoIds
}
// Store the todo-id on the toolCall for later reference
toolCall.todoId = todoId
}

// Update both contentBlocks and toolCalls atomically before UI update
Expand Down Expand Up @@ -1282,8 +1297,8 @@ const sseHandlers: Record<string, SSEHandler> = {
}

// Check if this is the plan tool and extract todos
if (context.toolCallBuffer.name === 'plan' && context.toolCallBuffer.input?.todoList) {
const todos = context.toolCallBuffer.input.todoList.map((item: any, index: number) => ({
if (context.toolCallBuffer.name === 'plan' && context.toolCallBuffer.input?.todoListUser) {
const todos = context.toolCallBuffer.input.todoListUser.map((item: any, index: number) => ({
id: item.id || `todo-${index}`,
content: typeof item === 'string' ? item : item.content,
completed: false,
Expand All @@ -1297,15 +1312,19 @@ const sseHandlers: Record<string, SSEHandler> = {
}
}

// Check if this tool has a todo-id parameter - mark it as executing
if (context.toolCallBuffer.input?.['todo-id']) {
const todoId = context.toolCallBuffer.input['todo-id']
const store = get()
if (store.updatePlanTodoStatus) {
store.updatePlanTodoStatus(todoId, 'executing')
// Check if this tool has todo-ids parameter - mark them as executing
if (context.toolCallBuffer.input?.['todo-ids']) {
const todoIds = context.toolCallBuffer.input['todo-ids']
if (Array.isArray(todoIds)) {
const store = get()
if (store.updatePlanTodoStatus) {
todoIds.forEach(todoId => {
store.updatePlanTodoStatus(todoId, 'executing')
})
}
// Store the todo-ids on the toolCall for later reference
context.toolCallBuffer.todoIds = todoIds
}
// Store the todo-id on the toolCall for later reference
context.toolCallBuffer.todoId = todoId
}

// Update both contentBlocks and toolCalls atomically before UI update
Expand Down