core: move workspace roots onto environments

This commit is contained in:
pakrym-oai
2026-07-09 19:39:42 -07:00
parent dd51887ce7
commit 014742db1f
47 changed files with 390 additions and 308 deletions
@@ -4496,6 +4496,16 @@
},
"environmentId": {
"type": "string"
},
"runtimeWorkspaceRoots": {
"description": "Environment-native runtime workspace roots. Omitted inherits the request's top-level `runtimeWorkspaceRoots` fallback.",
"items": {
"$ref": "#/definitions/LegacyAppPathString"
},
"type": [
"array",
"null"
]
}
},
"required": [
@@ -20170,6 +20170,16 @@
},
"environmentId": {
"type": "string"
},
"runtimeWorkspaceRoots": {
"description": "Environment-native runtime workspace roots. Omitted inherits the request's top-level `runtimeWorkspaceRoots` fallback.",
"items": {
"$ref": "#/definitions/v2/LegacyAppPathString"
},
"type": [
"array",
"null"
]
}
},
"required": [
@@ -17949,6 +17949,16 @@
},
"environmentId": {
"type": "string"
},
"runtimeWorkspaceRoots": {
"description": "Environment-native runtime workspace roots. Omitted inherits the request's top-level `runtimeWorkspaceRoots` fallback.",
"items": {
"$ref": "#/definitions/LegacyAppPathString"
},
"type": [
"array",
"null"
]
}
},
"required": [
@@ -281,6 +281,16 @@
},
"environmentId": {
"type": "string"
},
"runtimeWorkspaceRoots": {
"description": "Environment-native runtime workspace roots. Omitted inherits the request's top-level `runtimeWorkspaceRoots` fallback.",
"items": {
"$ref": "#/definitions/LegacyAppPathString"
},
"type": [
"array",
"null"
]
}
},
"required": [
@@ -362,6 +362,16 @@
},
"environmentId": {
"type": "string"
},
"runtimeWorkspaceRoots": {
"description": "Environment-native runtime workspace roots. Omitted inherits the request's top-level `runtimeWorkspaceRoots` fallback.",
"items": {
"$ref": "#/definitions/LegacyAppPathString"
},
"type": [
"array",
"null"
]
}
},
"required": [
@@ -3,4 +3,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LegacyAppPathString } from "../LegacyAppPathString";
export type TurnEnvironmentParams = { environmentId: string, cwd: LegacyAppPathString, };
export type TurnEnvironmentParams = { environmentId: string, cwd: LegacyAppPathString,
/**
* Environment-native runtime workspace roots. Omitted inherits the
* request's top-level `runtimeWorkspaceRoots` fallback.
*/
runtimeWorkspaceRoots?: Array<LegacyAppPathString> | null, };
@@ -4217,13 +4217,15 @@ fn turn_start_params_round_trip_environments() {
let raw_cwd = r"C:\workspace";
let cwd: LegacyAppPathString =
serde_json::from_value(json!(raw_cwd)).expect("API path should deserialize");
let workspace_root = cwd.clone();
let params: TurnStartParams = serde_json::from_value(json!({
"threadId": "thread_123",
"input": [],
"environments": [
{
"environmentId": "local",
"cwd": cwd
"cwd": cwd,
"runtimeWorkspaceRoots": [workspace_root]
}
],
}))
@@ -4234,6 +4236,7 @@ fn turn_start_params_round_trip_environments() {
Some(vec![TurnEnvironmentParams {
environment_id: "local".to_string(),
cwd: cwd.clone(),
runtime_workspace_roots: Some(vec![workspace_root.clone()]),
}])
);
assert_eq!(
@@ -4247,7 +4250,8 @@ fn turn_start_params_round_trip_environments() {
Some(&json!([
{
"environmentId": "local",
"cwd": cwd
"cwd": cwd,
"runtimeWorkspaceRoots": [workspace_root]
}
]))
);
@@ -41,6 +41,10 @@ pub enum TurnStatus {
pub struct TurnEnvironmentParams {
pub environment_id: String,
pub cwd: LegacyAppPathString,
/// Environment-native runtime workspace roots. Omitted inherits the
/// request's top-level `runtimeWorkspaceRoots` fallback.
#[ts(optional = nullable)]
pub runtime_workspace_roots: Option<Vec<LegacyAppPathString>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]