Skip to content

Commit f37a964

Browse files
feat: [APP-3106] Specs: Explicit QueryMode for cloud agent run creation
1 parent aeb9296 commit f37a964

6 files changed

Lines changed: 30 additions & 3 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-8eb8e46de29b887cbcb25b90fec55d34e11ff82b174b7a5c1d1ce4ba4d7c2fb4.yml
3-
openapi_spec_hash: a071b7c932453dc870e7e6cf39df0535
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-f4c3bab952ad19ea9d246794add1bda6d3911eb32d8372f0d7271b52267b6d0b.yml
3+
openapi_spec_hash: 9fd38bfc2e640fb456258f50fccacf88
44
config_hash: c15534df6c8d861059e44d9dd5483b3f

src/resources/agent/agent.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,13 @@ export interface AgentRunParams {
10101010
*/
10111011
interactive?: boolean;
10121012

1013+
/**
1014+
* Optional query mode for the run. Defaults to `normal` when omitted. The server
1015+
* does not infer mode from prompt prefixes such as `/plan`, so callers should pass
1016+
* this field explicitly to request non-normal behavior.
1017+
*/
1018+
mode?: 'normal' | 'plan' | 'orchestrate';
1019+
10131020
/**
10141021
* Optional run ID of the parent that spawned this run. Used for orchestration
10151022
* hierarchies.

src/resources/agent/runs.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,12 @@ export interface RunSubmitFollowupParams {
731731
* The follow-up message to send to the run.
732732
*/
733733
message: string;
734+
735+
/**
736+
* Optional query mode for the follow-up. Defaults to `normal` when omitted. The
737+
* server does not infer mode from prompt prefixes such as `/plan`.
738+
*/
739+
mode?: 'normal' | 'plan' | 'orchestrate';
734740
}
735741

736742
export declare namespace Runs {

src/resources/agent/schedules.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ export interface ScheduleCreateParams {
245245
*/
246246
enabled?: boolean;
247247

248+
/**
249+
* Optional query mode applied to every triggered run. Defaults to `normal` when
250+
* omitted. The server does not infer mode from prompt prefixes such as `/plan`.
251+
*/
252+
mode?: 'normal' | 'plan' | 'orchestrate';
253+
248254
/**
249255
* The prompt/instruction for the agent to execute. Required unless
250256
* agent_config.skill_spec is provided.
@@ -285,6 +291,12 @@ export interface ScheduleUpdateParams {
285291
*/
286292
agent_uid?: string;
287293

294+
/**
295+
* Optional query mode applied to every triggered run. Defaults to `normal` when
296+
* omitted. The server does not infer mode from prompt prefixes such as `/plan`.
297+
*/
298+
mode?: 'normal' | 'plan' | 'orchestrate';
299+
288300
/**
289301
* The prompt/instruction for the agent to execute. Required unless
290302
* agent_config.skill_spec is provided.

tests/api-resources/agent/runs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ describe('resource runs', () => {
103103

104104
// Mock server tests are disabled
105105
test.skip('submitFollowup: required and optional params', async () => {
106-
const response = await client.agent.runs.submitFollowup('runId', { message: 'message' });
106+
const response = await client.agent.runs.submitFollowup('runId', { message: 'message', mode: 'normal' });
107107
});
108108
});

tests/api-resources/agent/schedules.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ describe('resource schedules', () => {
5353
},
5454
agent_uid: 'agent_uid',
5555
enabled: true,
56+
mode: 'normal',
5657
prompt: 'Review open pull requests and provide feedback',
5758
team: true,
5859
});
@@ -116,6 +117,7 @@ describe('resource schedules', () => {
116117
worker_host: 'worker_host',
117118
},
118119
agent_uid: 'agent_uid',
120+
mode: 'normal',
119121
prompt: 'prompt',
120122
});
121123
});

0 commit comments

Comments
 (0)