Skip to content

Commit 65e8d12

Browse files
fix(tables): remove copilot deployment mode
1 parent 17760cb commit 65e8d12

4 files changed

Lines changed: 20 additions & 38 deletions

File tree

apps/sim/lib/copilot/generated/tool-catalog-v1.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5312,12 +5312,6 @@ export const TableAutomations: ToolCatalogEntry = {
53125312
},
53135313
},
53145314
},
5315-
deploymentMode: {
5316-
type: 'string',
5317-
description:
5318-
'Which workflow version rows execute: "live" (default, editable draft — edits take effect immediately) or "deployed" (latest active deployment; fails if the workflow was never deployed).',
5319-
enum: ['live', 'deployed'],
5320-
},
53215315
groupId: {
53225316
type: 'string',
53235317
description:
@@ -6092,12 +6086,6 @@ export const UserTable: ToolCatalogEntry = {
60926086
},
60936087
},
60946088
},
6095-
deploymentMode: {
6096-
type: 'string',
6097-
description:
6098-
"Which version of the backing workflow this group's per-row runs execute, for add_workflow_group and update_workflow_group. 'live' (default) runs the editable draft, so later edits take effect immediately. 'deployed' runs the workflow's latest active deployment, pinning rows to a published version — if that workflow has never been deployed the cell fails rather than falling back to the draft. Only meaningful for workflow groups; enrichment groups have no backing workflow.",
6099-
enum: ['live', 'deployed'],
6100-
},
61016089
description: { type: 'string', description: "Table description (optional for 'create')" },
61026090
enrichmentId: {
61036091
type: 'string',

apps/sim/lib/copilot/generated/tool-schemas-v1.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5173,12 +5173,6 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
51735173
},
51745174
},
51755175
},
5176-
deploymentMode: {
5177-
type: 'string',
5178-
description:
5179-
'Which workflow version rows execute: "live" (default, editable draft — edits take effect immediately) or "deployed" (latest active deployment; fails if the workflow was never deployed).',
5180-
enum: ['live', 'deployed'],
5181-
},
51825176
groupId: {
51835177
type: 'string',
51845178
description:
@@ -6034,12 +6028,6 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
60346028
},
60356029
},
60366030
},
6037-
deploymentMode: {
6038-
type: 'string',
6039-
description:
6040-
"Which version of the backing workflow this group's per-row runs execute, for add_workflow_group and update_workflow_group. 'live' (default) runs the editable draft, so later edits take effect immediately. 'deployed' runs the workflow's latest active deployment, pinning rows to a published version — if that workflow has never been deployed the cell fails rather than falling back to the draft. Only meaningful for workflow groups; enrichment groups have no backing workflow.",
6041-
enum: ['live', 'deployed'],
6042-
},
60436031
description: {
60446032
type: 'string',
60456033
description: "Table description (optional for 'create')",

apps/sim/lib/copilot/tools/server/table/user-table.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ vi.mock('@/lib/workflows/application/context', () => ({
258258
}))
259259

260260
vi.mock('@/lib/workflows/application/resolve-workflow-outputs', () => ({
261+
loadResolvedDeployedWorkflowOutputs: async () => mockExecuteCopilotWorkflowUseCase(),
261262
loadResolvedWorkflowOutputs: async () => mockExecuteCopilotWorkflowUseCase(),
262263
resolveWorkflowOutputs: { operation: { id: 'workflows.read' } },
263264
}))
@@ -959,6 +960,25 @@ describe('userTableServerTool workflow scope', () => {
959960
expect(mockAddWorkflowGroup).not.toHaveBeenCalled()
960961
})
961962

963+
it('does not pass a legacy deployment mode into workflow group creation', async () => {
964+
const result = await userTableServerTool.execute(
965+
{
966+
operation: 'add_workflow_group',
967+
args: {
968+
tableId: 'tbl_1',
969+
workflowId: 'workflow-1',
970+
outputs: [{ blockId: 'block-1', path: 'content' }],
971+
deploymentMode: 'live',
972+
},
973+
},
974+
buildToolContext()
975+
)
976+
977+
expect(result.success).toBe(true)
978+
expect(mockAddWorkflowGroup).toHaveBeenCalledTimes(1)
979+
expect(mockAddWorkflowGroup.mock.calls[0][0].group).not.toHaveProperty('deploymentMode')
980+
})
981+
962982
it('conceals unknown application failures from tool output', async () => {
963983
mockQueryRows.mockRejectedValueOnce(new Error('database host unavailable'))
964984

apps/sim/lib/copilot/tools/server/table/user-table.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import type {
6262
TablePredicateInput,
6363
TableSchema,
6464
WorkflowGroupDependencies,
65-
WorkflowGroupDeploymentMode,
6665
} from '@/lib/table/types'
6766
import { viewConfigIdsToNames } from '@/lib/table/views/service'
6867
import type { ResolvedSecretTraceProvenanceV1 } from '@/executor/utils/resolved-secret-trace-registry'
@@ -132,16 +131,6 @@ function resolveAuthorizedWorkflowOutputs(
132131
})
133132
}
134133

135-
/**
136-
* Narrows a raw `deploymentMode` arg to the `'live' | 'deployed'` union, or
137-
* `undefined` when absent/invalid (leaving the group's existing value — which
138-
* itself defaults to `'live'`). Lets Mothership choose whether a group's
139-
* per-cell runs execute the live draft or the latest active deployment.
140-
*/
141-
function parseDeploymentMode(value: unknown): WorkflowGroupDeploymentMode | undefined {
142-
return value === 'live' || value === 'deployed' ? value : undefined
143-
}
144-
145134
/** Validates an optional row limit against the policy for the requested surface operation. */
146135
function limitError(limit: unknown, max?: number): string | null {
147136
if (limit === undefined) return null
@@ -1242,7 +1231,6 @@ export const userTableServerTool: BaseServerTool<UserTableArgs, UserTableResult>
12421231

12431232
const dependencies = args.dependencies as WorkflowGroupDependencies | undefined
12441233
const name = args.name as string | undefined
1245-
const deploymentMode = parseDeploymentMode(args.deploymentMode)
12461234
assertNotAborted()
12471235
const autoRun = args.autoRun === true
12481236
const { table: updated, group } = await executeCopilotCreateWorkflowTableGroup(context, {
@@ -1252,7 +1240,6 @@ export const userTableServerTool: BaseServerTool<UserTableArgs, UserTableResult>
12521240
outputs: rawOutputs,
12531241
name,
12541242
dependencies,
1255-
deploymentMode,
12561243
autoRun,
12571244
})
12581245
return {
@@ -1294,7 +1281,6 @@ export const userTableServerTool: BaseServerTool<UserTableArgs, UserTableResult>
12941281
dependencies: args.dependencies as WorkflowGroupDependencies | undefined,
12951282
outputs: updateOutputs,
12961283
mappingUpdates,
1297-
deploymentMode: parseDeploymentMode(args.deploymentMode),
12981284
autoRun: typeof args.autoRun === 'boolean' ? args.autoRun : undefined,
12991285
})
13001286
return {

0 commit comments

Comments
 (0)