Skip to content

Commit 73e1639

Browse files
committed
Disable Composio workbench tools
1 parent 47d660b commit 73e1639

4 files changed

Lines changed: 16 additions & 46 deletions

File tree

common/src/constants/composio.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ export const COMPOSIO_API_KEY_ENV_VAR = 'COMPOSIO_API_KEY'
33
export const COMPOSIO_META_TOOL_NAMES = [
44
'COMPOSIO_MANAGE_CONNECTIONS',
55
'COMPOSIO_MULTI_EXECUTE_TOOL',
6-
'COMPOSIO_REMOTE_BASH_TOOL',
7-
'COMPOSIO_REMOTE_WORKBENCH',
86
'COMPOSIO_SEARCH_TOOLS',
97
'COMPOSIO_GET_TOOL_SCHEMAS',
108
] as const

sdk/src/composio.ts

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ const sessionIdParam = z
1717
.optional()
1818
.describe('Session ID returned by COMPOSIO_SEARCH_TOOLS, when available.')
1919

20-
const workflowStepParams = {
21-
current_step: z
22-
.string()
23-
.optional()
24-
.describe('Short enum-style label for the current workflow step.'),
25-
current_step_metric: z
26-
.string()
27-
.optional()
28-
.describe('Progress metric such as "3/10 emails" or "0/n messages".'),
29-
}
30-
3120
const composioMetaToolSchemas = {
3221
COMPOSIO_SEARCH_TOOLS: z
3322
.object({
@@ -87,31 +76,8 @@ const composioMetaToolSchemas = {
8776
.describe('One concise sentence explaining the execution intent.'),
8877
sync_response_to_workbench: z
8978
.boolean()
90-
.describe('Use true when the response may be large or reused later.'),
91-
session_id: sessionIdParam,
92-
...workflowStepParams,
93-
})
94-
.catchall(z.unknown()),
95-
COMPOSIO_REMOTE_WORKBENCH: z
96-
.object({
97-
code_to_execute: z
98-
.string()
99-
.describe('Python code to run in the persistent remote workbench.'),
100-
thought: z
101-
.string()
102-
.optional()
103-
.describe(
104-
'One concise sentence describing why the workbench is needed.',
105-
),
106-
session_id: sessionIdParam,
107-
...workflowStepParams,
108-
})
109-
.catchall(z.unknown()),
110-
COMPOSIO_REMOTE_BASH_TOOL: z
111-
.object({
112-
command: z
113-
.string()
114-
.describe('Bash command to run in the remote sandbox.'),
79+
.default(false)
80+
.describe('Always use false. Codebuff disables Composio workbench.'),
11581
session_id: sessionIdParam,
11682
})
11783
.catchall(z.unknown()),
@@ -125,11 +91,7 @@ const composioMetaToolDescriptions = {
12591
COMPOSIO_MANAGE_CONNECTIONS:
12692
'Check or initiate user authentication for external app toolkits. Use when search/execution indicates a toolkit is not connected.',
12793
COMPOSIO_MULTI_EXECUTE_TOOL:
128-
'Execute one or more discovered Composio app tools in the current workflow session.',
129-
COMPOSIO_REMOTE_WORKBENCH:
130-
'Run Python in a persistent Composio workbench for bulk app workflows, large responses, or data transformations.',
131-
COMPOSIO_REMOTE_BASH_TOOL:
132-
'Run bash commands in the Composio remote sandbox for simple file and data processing.',
94+
'Execute one or more discovered Composio app tools in the current workflow session. Do not use workbench offloading.',
13395
} satisfies Record<ComposioMetaToolName, string>
13496

13597
function toJsonValue(value: unknown): JSONValue {

web/src/server/__tests__/composio.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ describe('executeComposioTool', () => {
9999
expect(result).toEqual([{ type: 'json', value: { ok: true } }])
100100
expect(useSession).toHaveBeenCalledWith('stored-session')
101101
expect(whereDelete).toHaveBeenCalledTimes(1)
102-
expect(createSession).toHaveBeenCalledWith('user-123')
102+
expect(createSession).toHaveBeenCalledWith('user-123', {
103+
workbench: { enable: false },
104+
})
103105
expect(values).toHaveBeenCalledWith({
104106
user_id: 'user-123',
105107
session_id: 'fresh-session',
@@ -124,7 +126,9 @@ describe('executeComposioTool', () => {
124126
})
125127

126128
expect(result).toEqual([{ type: 'json', value: { ok: true } }])
127-
expect(createSession).toHaveBeenCalledWith('user-123')
129+
expect(createSession).toHaveBeenCalledWith('user-123', {
130+
workbench: { enable: false },
131+
})
128132
expect(values).toHaveBeenCalledWith({
129133
user_id: 'user-123',
130134
session_id: 'losing-session',

web/src/server/composio.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ function getComposioClient(apiKey: string): ComposioClient {
8080
})
8181
}
8282

83+
const COMPOSIO_SESSION_CONFIG = {
84+
workbench: {
85+
enable: false,
86+
},
87+
} as const
88+
8389
async function insertSessionIfAbsent(params: {
8490
db: CodebuffPgDatabase
8591
userId: string
@@ -140,7 +146,7 @@ async function createSessionForUser(params: {
140146
logger: Logger
141147
}): Promise<CachedComposioSession> {
142148
const composio = getComposioClient(params.apiKey)
143-
const session = await composio.create(params.userId)
149+
const session = await composio.create(params.userId, COMPOSIO_SESSION_CONFIG)
144150
await insertSessionIfAbsent({
145151
db: params.db,
146152
userId: params.userId,

0 commit comments

Comments
 (0)