core: preserve selected environment workspace paths#28560
Closed
anp-oai wants to merge 0 commit into
Closed
Conversation
anp-oai
commented
Jun 16, 2026
| model_provider: "openai".to_string(), | ||
| service_tier: None, | ||
| cwd, | ||
| cwd: codex_utils_path_uri::ApiPathString::from_abs_path(&cwd), |
Collaborator
Author
There was a problem hiding this comment.
this should be imported at top of file
| .collect() | ||
| } | ||
|
|
||
| fn render_path_uri( |
Collaborator
Author
There was a problem hiding this comment.
can we use one of the lossy infallible conversions for this instead?
| && root == config_snapshot.cwd() | ||
| && let Some(environment_cwd) = selected_environment_cwd | ||
| { | ||
| let convention = environment_cwd.infer_path_convention().ok_or_else(|| { |
| - `thread/resume` — reopen an existing thread by id so subsequent `turn/start` calls append to it. Accepts the same permission override rules as `thread/start`. | ||
| - `thread/fork` — fork an existing thread into a new thread id by copying the stored history; if the source thread is currently mid-turn, the fork records the same interruption marker as `turn/interrupt` instead of inheriting an unmarked partial turn suffix. The returned `thread.forkedFromId` points at the source thread when known. Accepts `ephemeral: true` for an in-memory temporary fork, emits `thread/started` (including the current `thread.status`), and auto-subscribes you to turn/item events for the new thread. Experimental clients can pass `excludeTurns: true` when they plan to page fork history via `thread/turns/list` instead of receiving the full turn array immediately. Accepts the same permission override rules as `thread/start`. | ||
| - `thread/start`, `thread/resume`, and `thread/fork` responses include the legacy `sandbox` compatibility projection. Experimental clients can read `runtimeWorkspaceRoots` for the thread-scoped runtime roots and `activePermissionProfile` for the named or implicit built-in profile identity/provenance when known. | ||
| - `thread/start`, `thread/resume`, and `thread/fork` responses include the legacy `sandbox` compatibility projection. Experimental clients can read `runtimeWorkspaceRoots` for the thread-scoped runtime roots and `activePermissionProfile` for the named or implicit built-in profile identity/provenance when known. In a `thread/start` response, the root corresponding to a selected environment's `cwd` uses that environment's native path spelling. |
Collaborator
Author
There was a problem hiding this comment.
remove this diff, dont need to mention it
| @@ -121,14 +121,12 @@ impl FileSystemContext { | |||
| fn from_permission_profile( | |||
| permission_profile: &PermissionProfile, | |||
| workspace_roots: &[AbsolutePathBuf], | |||
Collaborator
Author
There was a problem hiding this comment.
let's discuss in chat why we're passing both here
| fn render_environment_cwd(cwd: &PathUri) -> String { | ||
| let Some(convention) = cwd.infer_path_convention() else { | ||
| return cwd.to_string(); | ||
| fn render_environment_path(path: &PathUri) -> String { |
Collaborator
Author
There was a problem hiding this comment.
see https://github.com/openai/codex/pull/28152/changes for my preferred helper shape, crib that one
c5fabde to
d7de7ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
app-server may run on a different OS from the selected execution environment. Thread metadata and model context therefore need to preserve environment-native workspace paths instead of projecting them onto the app-server host.
This returns the selected environment cwd and runtime roots as API path strings, carries model-visible roots as
PathUrithrough turn context, and reports the implicit active permission profile. The TUI still converts paths only at its host-native config boundary and rejects foreign roots there.Stacked on #28152.
Validation:
just test -p codex-app-server-protocolbazel test //codex-rs/core/tests/remote_env_windows:smoke-test --test_output=errorsjust bazel-lock-check