Skip to content

Commit b548483

Browse files
committed
Literalness gaps
1 parent 4f622d1 commit b548483

5 files changed

Lines changed: 60 additions & 36 deletions

File tree

apps/sim/blocks/blocks/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ Return ONLY the JSON array.`,
551551
conversationId: {
552552
type: 'string',
553553
description:
554-
'Specific conversation ID to retrieve memories from (when memoryType is conversation_id)',
554+
'Specific conversation ID to retrieve memories from (used when memoryType is conversation, sliding_window, or sliding_window_tokens)',
555555
},
556556
slidingWindowSize: {
557557
type: 'string',

apps/sim/lib/copilot/chat/workspace-context.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { createLogger } from '@sim/logger'
1313
import { toError } from '@sim/utils/errors'
1414
import { and, count, eq, inArray, isNull } from 'drizzle-orm'
1515
import { normalizeVfsSegment } from '@/lib/copilot/vfs/normalize-segment'
16+
import { canonicalWorkspaceFilePath } from '@/lib/copilot/vfs/path-utils'
1617
import { getAccessibleOAuthCredentials } from '@/lib/credentials/environment'
1718
import { listWorkspaceFiles } from '@/lib/uploads/contexts/workspace'
1819
import { listCustomTools } from '@/lib/workflows/custom-tools/operations'
@@ -200,15 +201,21 @@ export function buildWorkspaceMd(data: WorkspaceMdData): string {
200201
rootFiles.push(f)
201202
}
202203
}
203-
const lines: string[] = []
204+
const fileLine = (f: (typeof data.files)[0], indent: string) => {
205+
const vfsPath = canonicalWorkspaceFilePath({ folderPath: f.folderPath, name: f.name })
206+
return `${indent}- **${f.name}** (${f.id}) — ${f.type}, ${formatSize(f.size)} — \`${vfsPath}\``
207+
}
208+
const lines: string[] = [
209+
'Read or edit a file by the exact VFS path shown in backticks below — copy it verbatim (it is already percent-encoded) and append `/content` to read the contents. Do not retype the display name or re-encode the path.',
210+
]
204211
for (const f of rootFiles) {
205-
lines.push(`- **${f.name}** (${f.id}) — ${f.type}, ${formatSize(f.size)}`)
212+
lines.push(fileLine(f, ''))
206213
}
207214
const sortedFolders = [...folderFiles.entries()].sort((a, b) => a[0].localeCompare(b[0]))
208215
for (const [folder, folderFileList] of sortedFolders) {
209216
lines.push(`- 📁 **${folder}/**`)
210217
for (const f of folderFileList) {
211-
lines.push(` - **${f.name}** (${f.id}) — ${f.type}, ${formatSize(f.size)}`)
218+
lines.push(fileLine(f, ' '))
212219
}
213220
}
214221
sections.push(`## Files (${data.files.length})\n${lines.join('\n')}`)

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

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ export const Deploy: ToolCatalogEntry = {
597597
properties: {
598598
request: {
599599
description:
600-
'Detailed deployment instructions. Include deployment type (api/chat) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display).',
600+
'Detailed deployment instructions. Include deployment type (api/chat/mcp) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display).',
601601
type: 'string',
602602
},
603603
},
@@ -718,7 +718,8 @@ export const DeployChat: ToolCatalogEntry = {
718718
blockId: { type: 'string', description: 'The block UUID' },
719719
path: {
720720
type: 'string',
721-
description: "The output path (e.g. 'response', 'response.content')",
721+
description:
722+
'The output path (e.g. `content` for an agent; structured fields are top-level paths). Call get_block_outputs for real paths.',
722723
},
723724
},
724725
required: ['blockId', 'path'],
@@ -1352,7 +1353,7 @@ export const GenerateImage: ToolCatalogEntry = {
13521353
prompt: {
13531354
type: 'string',
13541355
description:
1355-
'Detailed text description of the image to generate, or editing instructions when used with editFileId.',
1356+
'Detailed text description of the image to generate, or editing instructions when editing the image(s) passed in `inputs.files`.',
13561357
},
13571358
},
13581359
required: ['prompt'],
@@ -1930,7 +1931,8 @@ export const ManageCustomTool: ToolCatalogEntry = {
19301931
},
19311932
operation: {
19321933
type: 'string',
1933-
description: "The operation to perform: 'add', 'edit', 'list', or 'delete'",
1934+
description:
1935+
"The operation to perform: 'add', 'edit', 'list', or 'delete'. These verbs are tool-specific — manage_job uses create/update instead of add/edit.",
19341936
enum: ['add', 'edit', 'delete', 'list'],
19351937
},
19361938
schema: {
@@ -1970,7 +1972,7 @@ export const ManageCustomTool: ToolCatalogEntry = {
19701972
toolId: {
19711973
type: 'string',
19721974
description:
1973-
'The ID of the custom tool. Must be the exact toolId from the get_workflow_data custom tool response — do not guess or construct it. Required for edit and delete; omit for add and list.',
1975+
"The ID of the custom tool. Get it from the `list` operation or the `id` field inside the tool's VFS file (agent/custom-tools/{name}.json — the filename is the display name, not the id); get_workflow_data also returns it where that tool is available. Do not guess or construct it. Required for edit and delete; omit for add and list.",
19741976
},
19751977
toolIds: {
19761978
type: 'array',
@@ -1996,7 +1998,11 @@ export const ManageJob: ToolCatalogEntry = {
19961998
description:
19971999
'Operation-specific arguments. For create: {title, prompt, cron?, time?, timezone?, lifecycle?, successCondition?, maxRuns?}. For get/delete: {jobId}. For update: {jobId, title?, prompt?, cron?, timezone?, status?, lifecycle?, successCondition?, maxRuns?}. For list: no args needed.',
19982000
properties: {
1999-
cron: { type: 'string', description: 'Cron expression for recurring jobs' },
2001+
cron: {
2002+
type: 'string',
2003+
description:
2004+
"Cron expression for a recurring job (e.g. '0 9 * * *'). Set exactly one of cron or time: recurring -> cron; one-time -> time.",
2005+
},
20002006
jobId: { type: 'string', description: 'Job ID (required for get, update)' },
20012007
jobIds: {
20022008
type: 'array',
@@ -2007,21 +2013,27 @@ export const ManageJob: ToolCatalogEntry = {
20072013
type: 'string',
20082014
description:
20092015
"'persistent' (default) or 'until_complete'. Until_complete jobs stop when complete_job is called.",
2016+
enum: ['persistent', 'until_complete'],
20102017
},
20112018
maxRuns: {
20122019
type: 'integer',
20132020
description: 'Max executions before auto-completing. Safety limit.',
20142021
},
20152022
prompt: { type: 'string', description: 'The prompt to execute when the job fires' },
2016-
status: { type: 'string', description: 'Job status: active, paused' },
2023+
status: {
2024+
type: 'string',
2025+
description: 'Job status: active, paused',
2026+
enum: ['active', 'paused'],
2027+
},
20172028
successCondition: {
20182029
type: 'string',
20192030
description:
20202031
'What must happen for the job to be considered complete (until_complete lifecycle).',
20212032
},
20222033
time: {
20232034
type: 'string',
2024-
description: 'ISO 8601 datetime for one-time jobs or cron start time',
2035+
description:
2036+
"ISO 8601 datetime. One-time job -> set time and omit cron. May also anchor a recurring cron job's first-fire time.",
20252037
},
20262038
timezone: {
20272039
type: 'string',
@@ -2035,7 +2047,8 @@ export const ManageJob: ToolCatalogEntry = {
20352047
},
20362048
operation: {
20372049
type: 'string',
2038-
description: 'The operation to perform: create, list, get, update, delete',
2050+
description:
2051+
'The operation to perform: create, list, get, update, delete. These verbs are tool-specific — the custom-tool/MCP/skill managers use add/edit instead of create/update.',
20392052
enum: ['create', 'list', 'get', 'update', 'delete'],
20402053
},
20412054
},
@@ -2079,7 +2092,8 @@ export const ManageMcpTool: ToolCatalogEntry = {
20792092
},
20802093
operation: {
20812094
type: 'string',
2082-
description: "The operation to perform: 'add', 'edit', 'list', or 'delete'",
2095+
description:
2096+
"The operation to perform: 'add', 'edit', 'list', or 'delete'. These verbs are tool-specific — manage_job uses create/update instead of add/edit.",
20832097
enum: ['add', 'edit', 'delete', 'list'],
20842098
},
20852099
serverId: {
@@ -2117,7 +2131,8 @@ export const ManageSkill: ToolCatalogEntry = {
21172131
},
21182132
operation: {
21192133
type: 'string',
2120-
description: "The operation to perform: 'add', 'edit', 'list', or 'delete'",
2134+
description:
2135+
"The operation to perform: 'add', 'edit', 'list', or 'delete'. These verbs are tool-specific — manage_job uses create/update instead of add/edit.",
21212136
enum: ['add', 'edit', 'delete', 'list'],
21222137
},
21232138
skillId: {
@@ -2270,7 +2285,7 @@ export const OauthGetAuthLink: ToolCatalogEntry = {
22702285
providerName: {
22712286
type: 'string',
22722287
description:
2273-
"The name of the OAuth provider to connect (e.g., 'Slack', 'Gmail', 'Google Calendar', 'GitHub')",
2288+
"The OAuth provider to connect. Pass the integration's provider value (e.g. `google-email`, `slack`); the service display name or providerId resolves case-insensitively/fuzzily, so avoid bare base providers like `google`.",
22742289
},
22752290
},
22762291
required: ['providerName'],
@@ -2288,7 +2303,7 @@ export const OauthRequestAccess: ToolCatalogEntry = {
22882303
providerName: {
22892304
type: 'string',
22902305
description:
2291-
"The name of the OAuth provider to connect (e.g., 'Slack', 'Gmail', 'Google Calendar')",
2306+
"The OAuth provider to connect. Pass the integration's provider value (e.g. `google-email`, `slack`); the service display name or providerId resolves case-insensitively/fuzzily, so avoid bare base providers like `google`.",
22922307
},
22932308
},
22942309
required: ['providerName'],
@@ -2788,7 +2803,6 @@ export const RunWorkflow: ToolCatalogEntry = {
27882803
description: 'JSON object with key-value mappings where each key is an input field name',
27892804
},
27902805
},
2791-
required: ['workflow_input'],
27922806
},
27932807
clientExecutable: true,
27942808
requiresConfirmation: true,
@@ -2906,7 +2920,6 @@ export const SearchOnline: ToolCatalogEntry = {
29062920
'news',
29072921
'tweet',
29082922
'github',
2909-
'paper',
29102923
'company',
29112924
'research paper',
29122925
'linkedin profile',

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

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
374374
properties: {
375375
request: {
376376
description:
377-
'Detailed deployment instructions. Include deployment type (api/chat) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display).',
377+
'Detailed deployment instructions. Include deployment type (api/chat/mcp) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display).',
378378
type: 'string',
379379
},
380380
},
@@ -500,7 +500,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
500500
},
501501
path: {
502502
type: 'string',
503-
description: "The output path (e.g. 'response', 'response.content')",
503+
description:
504+
'The output path (e.g. `content` for an agent; structured fields are top-level paths). Call get_block_outputs for real paths.',
504505
},
505506
},
506507
required: ['blockId', 'path'],
@@ -1148,7 +1149,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
11481149
prompt: {
11491150
type: 'string',
11501151
description:
1151-
'Detailed text description of the image to generate, or editing instructions when used with editFileId.',
1152+
'Detailed text description of the image to generate, or editing instructions when editing the image(s) passed in `inputs.files`.',
11521153
},
11531154
},
11541155
required: ['prompt'],
@@ -1707,7 +1708,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
17071708
},
17081709
operation: {
17091710
type: 'string',
1710-
description: "The operation to perform: 'add', 'edit', 'list', or 'delete'",
1711+
description:
1712+
"The operation to perform: 'add', 'edit', 'list', or 'delete'. These verbs are tool-specific — manage_job uses create/update instead of add/edit.",
17111713
enum: ['add', 'edit', 'delete', 'list'],
17121714
},
17131715
schema: {
@@ -1761,7 +1763,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
17611763
toolId: {
17621764
type: 'string',
17631765
description:
1764-
'The ID of the custom tool. Must be the exact toolId from the get_workflow_data custom tool response — do not guess or construct it. Required for edit and delete; omit for add and list.',
1766+
"The ID of the custom tool. Get it from the `list` operation or the `id` field inside the tool's VFS file (agent/custom-tools/{name}.json — the filename is the display name, not the id); get_workflow_data also returns it where that tool is available. Do not guess or construct it. Required for edit and delete; omit for add and list.",
17651767
},
17661768
toolIds: {
17671769
type: 'array',
@@ -1786,7 +1788,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
17861788
properties: {
17871789
cron: {
17881790
type: 'string',
1789-
description: 'Cron expression for recurring jobs',
1791+
description:
1792+
"Cron expression for a recurring job (e.g. '0 9 * * *'). Set exactly one of cron or time: recurring -> cron; one-time -> time.",
17901793
},
17911794
jobId: {
17921795
type: 'string',
@@ -1803,6 +1806,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
18031806
type: 'string',
18041807
description:
18051808
"'persistent' (default) or 'until_complete'. Until_complete jobs stop when complete_job is called.",
1809+
enum: ['persistent', 'until_complete'],
18061810
},
18071811
maxRuns: {
18081812
type: 'integer',
@@ -1815,6 +1819,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
18151819
status: {
18161820
type: 'string',
18171821
description: 'Job status: active, paused',
1822+
enum: ['active', 'paused'],
18181823
},
18191824
successCondition: {
18201825
type: 'string',
@@ -1823,7 +1828,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
18231828
},
18241829
time: {
18251830
type: 'string',
1826-
description: 'ISO 8601 datetime for one-time jobs or cron start time',
1831+
description:
1832+
"ISO 8601 datetime. One-time job -> set time and omit cron. May also anchor a recurring cron job's first-fire time.",
18271833
},
18281834
timezone: {
18291835
type: 'string',
@@ -1837,7 +1843,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
18371843
},
18381844
operation: {
18391845
type: 'string',
1840-
description: 'The operation to perform: create, list, get, update, delete',
1846+
description:
1847+
'The operation to perform: create, list, get, update, delete. These verbs are tool-specific — the custom-tool/MCP/skill managers use add/edit instead of create/update.',
18411848
enum: ['create', 'list', 'get', 'update', 'delete'],
18421849
},
18431850
},
@@ -1883,7 +1890,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
18831890
},
18841891
operation: {
18851892
type: 'string',
1886-
description: "The operation to perform: 'add', 'edit', 'list', or 'delete'",
1893+
description:
1894+
"The operation to perform: 'add', 'edit', 'list', or 'delete'. These verbs are tool-specific — manage_job uses create/update instead of add/edit.",
18871895
enum: ['add', 'edit', 'delete', 'list'],
18881896
},
18891897
serverId: {
@@ -1915,7 +1923,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
19151923
},
19161924
operation: {
19171925
type: 'string',
1918-
description: "The operation to perform: 'add', 'edit', 'list', or 'delete'",
1926+
description:
1927+
"The operation to perform: 'add', 'edit', 'list', or 'delete'. These verbs are tool-specific — manage_job uses create/update instead of add/edit.",
19191928
enum: ['add', 'edit', 'delete', 'list'],
19201929
},
19211930
skillId: {
@@ -2046,7 +2055,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
20462055
providerName: {
20472056
type: 'string',
20482057
description:
2049-
"The name of the OAuth provider to connect (e.g., 'Slack', 'Gmail', 'Google Calendar', 'GitHub')",
2058+
"The OAuth provider to connect. Pass the integration's provider value (e.g. `google-email`, `slack`); the service display name or providerId resolves case-insensitively/fuzzily, so avoid bare base providers like `google`.",
20502059
},
20512060
},
20522061
required: ['providerName'],
@@ -2060,7 +2069,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
20602069
providerName: {
20612070
type: 'string',
20622071
description:
2063-
"The name of the OAuth provider to connect (e.g., 'Slack', 'Gmail', 'Google Calendar')",
2072+
"The OAuth provider to connect. Pass the integration's provider value (e.g. `google-email`, `slack`); the service display name or providerId resolves case-insensitively/fuzzily, so avoid bare base providers like `google`.",
20642073
},
20652074
},
20662075
required: ['providerName'],
@@ -2553,7 +2562,6 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
25532562
description: 'JSON object with key-value mappings where each key is an input field name',
25542563
},
25552564
},
2556-
required: ['workflow_input'],
25572565
},
25582566
resultSchema: undefined,
25592567
},
@@ -2659,7 +2667,6 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
26592667
'news',
26602668
'tweet',
26612669
'github',
2662-
'paper',
26632670
'company',
26642671
'research paper',
26652672
'linkedin profile',

apps/sim/lib/copilot/tool-executor/register-handlers.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
CheckDeploymentStatus,
44
CompleteJob,
55
CreateFolder,
6-
CreateJob,
76
CreateWorkflow,
87
CreateWorkspaceMcpServer,
98
DeleteFolder,
@@ -74,7 +73,6 @@ import {
7473
import { executeFunctionExecute } from '../tools/handlers/function-execute'
7574
import {
7675
executeCompleteJob,
77-
executeCreateJob,
7876
executeManageJob,
7977
executeUpdateJobHistory,
8078
} from '../tools/handlers/jobs'
@@ -171,7 +169,6 @@ function buildHandlerMap(): Record<string, ToolHandler> {
171169
[LoadDeployment.id]: h(executeLoadDeployment),
172170
[PromoteToLive.id]: h(executePromoteToLive),
173171

174-
[CreateJob.id]: h(executeCreateJob),
175172
[ManageJob.id]: h(executeManageJob),
176173
[CompleteJob.id]: h(executeCompleteJob),
177174
[UpdateJobHistory.id]: h(executeUpdateJobHistory),

0 commit comments

Comments
 (0)