mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
core: move workspace roots onto environments
This commit is contained in:
@@ -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": [
|
||||
|
||||
+10
@@ -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": [
|
||||
|
||||
+10
@@ -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": [
|
||||
|
||||
+6
-1
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user