Spread AbsolutePathBuf (#17792)

Mechanical change to promote absolute paths through code.
This commit is contained in:
pakrym-oai
2026-04-14 14:26:10 -07:00
committed by GitHub
parent dae56994da
commit dd1321d11b
166 changed files with 1638 additions and 1214 deletions

View File

@@ -1021,7 +1021,7 @@ fn session_configured_from_thread_response(
approval_policy: AskForApproval,
approvals_reviewer: codex_protocol::config_types::ApprovalsReviewer,
sandbox_policy: SandboxPolicy,
cwd: PathBuf,
cwd: AbsolutePathBuf,
reasoning_effort: Option<codex_protocol::openai_models::ReasoningEffort>,
) -> Result<SessionConfiguredEvent, String> {
let session_id = codex_protocol::ThreadId::from_string(thread_id)
@@ -1191,7 +1191,7 @@ async fn latest_thread_cwd(thread: &AppServerThread) -> PathBuf {
{
return cwd;
}
thread.cwd.clone()
thread.cwd.to_path_buf()
}
async fn parse_latest_turn_context_cwd(path: &Path) -> Option<PathBuf> {
@@ -1245,7 +1245,8 @@ async fn resolve_resume_thread_id(
.await
.map_err(anyhow::Error::msg)?;
for thread in response.data {
if args.all || cwds_match(config.cwd.as_path(), &latest_thread_cwd(&thread).await) {
let latest_cwd = latest_thread_cwd(&thread).await;
if args.all || cwds_match(config.cwd.as_path(), latest_cwd.as_path()) {
return Ok(Some(thread.id));
}
}
@@ -1309,7 +1310,8 @@ async fn resolve_resume_thread_id(
if thread.name.as_deref() != Some(session_id) {
continue;
}
if args.all || cwds_match(config.cwd.as_path(), &latest_thread_cwd(&thread).await) {
let latest_cwd = latest_thread_cwd(&thread).await;
if args.all || cwds_match(config.cwd.as_path(), latest_cwd.as_path()) {
return Ok(Some(thread.id));
}
}

View File

@@ -1,6 +1,8 @@
use super::*;
use codex_otel::set_parent_from_w3c_trace_context;
use codex_protocol::config_types::ApprovalsReviewer;
use codex_utils_absolute_path::test_support::PathBufExt;
use codex_utils_absolute_path::test_support::test_path_buf;
use opentelemetry::trace::TraceContextExt;
use opentelemetry::trace::TraceId;
use opentelemetry::trace::TracerProvider as _;
@@ -250,7 +252,7 @@ fn turn_items_for_thread_returns_matching_turn_items() {
updated_at: 0,
status: codex_app_server_protocol::ThreadStatus::Idle,
path: None,
cwd: PathBuf::from("/tmp/project"),
cwd: test_path_buf("/tmp/project").abs(),
cli_version: "0.0.0-test".to_string(),
source: codex_app_server_protocol::SessionSource::Exec,
agent_nickname: None,
@@ -397,7 +399,7 @@ fn session_configured_from_thread_response_uses_review_policy_from_response() {
updated_at: 0,
status: codex_app_server_protocol::ThreadStatus::Idle,
path: Some(PathBuf::from("/tmp/rollout.jsonl")),
cwd: PathBuf::from("/tmp"),
cwd: test_path_buf("/tmp").abs(),
cli_version: "0.0.0".to_string(),
source: codex_app_server_protocol::SessionSource::Cli,
agent_nickname: None,
@@ -409,7 +411,7 @@ fn session_configured_from_thread_response_uses_review_policy_from_response() {
model: "gpt-5.4".to_string(),
model_provider: "openai".to_string(),
service_tier: None,
cwd: PathBuf::from("/tmp"),
cwd: test_path_buf("/tmp").abs(),
instruction_sources: Vec::new(),
approval_policy: codex_app_server_protocol::AskForApproval::OnRequest,
approvals_reviewer: codex_app_server_protocol::ApprovalsReviewer::GuardianSubagent,