Skip to content

Commit 6be1d0f

Browse files
feat(api): add dev_runner_id to agents, dev_environment_id and provider to runners
1 parent 14152c3 commit 6be1d0f

5 files changed

Lines changed: 24 additions & 2 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: 172
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-871abe56c856169257435fbf85a09a3c075c2677671282c92606590e0a1bfc54.yml
3-
openapi_spec_hash: 7d0d7816110fc899f755a9d39770c044
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-700cd47eae87ca42bbbdc8b39e84e864226d169f0c369f414680f9eda694d3a5.yml
3+
openapi_spec_hash: 9364ced18661e420a15fb1be5203da4b
44
config_hash: ad1db65b32248aecda41b64586aac9ce

src/gitpod/resources/agents.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ def start_execution(
540540
code_context: AgentCodeContextParam | Omit = omit,
541541
mode: AgentMode | Omit = omit,
542542
name: str | Omit = omit,
543+
runner_id: str | Omit = omit,
543544
workflow_action_id: Optional[str] | Omit = omit,
544545
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
545546
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -569,6 +570,10 @@ def start_execution(
569570
mode: mode specifies the operational mode for this agent execution If not specified,
570571
defaults to AGENT_MODE_EXECUTION
571572
573+
runner_id: runner_id specifies a runner for this agent execution. When set, the agent
574+
execution is routed to this runner instead of the runner associated with the
575+
environment.
576+
572577
workflow_action_id: workflow_action_id is an optional reference to the workflow execution action
573578
that created this agent execution. Used for tracking and event correlation.
574579
@@ -588,6 +593,7 @@ def start_execution(
588593
"code_context": code_context,
589594
"mode": mode,
590595
"name": name,
596+
"runner_id": runner_id,
591597
"workflow_action_id": workflow_action_id,
592598
},
593599
agent_start_execution_params.AgentStartExecutionParams,
@@ -1194,6 +1200,7 @@ async def start_execution(
11941200
code_context: AgentCodeContextParam | Omit = omit,
11951201
mode: AgentMode | Omit = omit,
11961202
name: str | Omit = omit,
1203+
runner_id: str | Omit = omit,
11971204
workflow_action_id: Optional[str] | Omit = omit,
11981205
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11991206
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1223,6 +1230,10 @@ async def start_execution(
12231230
mode: mode specifies the operational mode for this agent execution If not specified,
12241231
defaults to AGENT_MODE_EXECUTION
12251232
1233+
runner_id: runner_id specifies a runner for this agent execution. When set, the agent
1234+
execution is routed to this runner instead of the runner associated with the
1235+
environment.
1236+
12261237
workflow_action_id: workflow_action_id is an optional reference to the workflow execution action
12271238
that created this agent execution. Used for tracking and event correlation.
12281239
@@ -1242,6 +1253,7 @@ async def start_execution(
12421253
"code_context": code_context,
12431254
"mode": mode,
12441255
"name": name,
1256+
"runner_id": runner_id,
12451257
"workflow_action_id": workflow_action_id,
12461258
},
12471259
agent_start_execution_params.AgentStartExecutionParams,

src/gitpod/types/agent_start_execution_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ class AgentStartExecutionParams(TypedDict, total=False):
2525

2626
name: str
2727

28+
runner_id: Annotated[str, PropertyInfo(alias="runnerId")]
29+
"""
30+
runner_id specifies a runner for this agent execution. When set, the agent
31+
execution is routed to this runner instead of the runner associated with the
32+
environment.
33+
"""
34+
2835
workflow_action_id: Annotated[Optional[str], PropertyInfo(alias="workflowActionId")]
2936
"""
3037
workflow_action_id is an optional reference to the workflow execution action

src/gitpod/types/runner_provider.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
"RUNNER_PROVIDER_DESKTOP_MAC",
1212
"RUNNER_PROVIDER_MANAGED",
1313
"RUNNER_PROVIDER_GCP",
14+
"RUNNER_PROVIDER_DEV_AGENT",
1415
]

tests/api_resources/test_agents.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ def test_method_start_execution_with_all_params(self, client: Gitpod) -> None:
438438
},
439439
mode="AGENT_MODE_UNSPECIFIED",
440440
name="name",
441+
runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
441442
workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
442443
)
443444
assert_matches_type(AgentStartExecutionResponse, agent, path=["response"])
@@ -963,6 +964,7 @@ async def test_method_start_execution_with_all_params(self, async_client: AsyncG
963964
},
964965
mode="AGENT_MODE_UNSPECIFIED",
965966
name="name",
967+
runner_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
966968
workflow_action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
967969
)
968970
assert_matches_type(AgentStartExecutionResponse, agent, path=["response"])

0 commit comments

Comments
 (0)