mirror of
https://github.com/openai/codex.git
synced 2026-11-20 07:06:24 +00:00
Include linked worktrees in TUI session discovery (#43279)
## Why Directory-scoped session lookup misses conversations in linked worktrees of the same repository. Managed worktree creation also runs synchronous Git work on the TUI event loop. ## What changed - With `worktrees` enabled for local sessions, include corresponding directories across linked checkouts in resume and fork pickers and `--last` lookup. Group them together in the agents overview and show checkout paths for picker entries from another worktree. - Validate shared Git metadata and backlinks, preserve relative working directories and logical path aliases, and reject directory symlink escapes. Keep the expanded directory filter stable across pagination until the listing restarts. - Fall back to the originally requested directory when an older daemon rejects an array-valued `cwd` filter. - Create managed worktrees on a blocking worker, check transition blockers before allocation, and revalidate the source session before switching. Report retained checkout paths and cleanup instructions if the transition cannot complete. - Start the in-session picker server in a separate task to avoid exhausting the TUI event future's stack. ## Testing Add coverage for linked-checkout discovery, feature gating, picker selection and rendering, project grouping, pagination stability, and legacy daemon fallback. Extend worktree lifecycle tests to cover running-agent blockers and recovery after the source session changes during creation. GitOrigin-RevId: 4a8a36c0dba3d32d72600f2edf8258a29fb4cb07
This commit is contained in:
1 parent
ad931a45b2
commit
d30f9cc72a
27 files changed
+1511
-144
No files matched your search
@@ -9,14 +9,27 @@ impl App {
|
||||
tui: &mut tui::Tui,
|
||||
app_server: &mut AppServerSession,
|
||||
) -> Result<AppRunControl> {
|
||||
let picker_app_server = match crate::start_app_server_for_picker(
|
||||
&self.config,
|
||||
&self.app_server_target,
|
||||
self.state_db.clone(),
|
||||
self.environment_manager.clone(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
// This runs inside the active TUI event future. Starting a second embedded server
|
||||
// inline can exhaust that thread's stack while initializing its auth manager.
|
||||
let picker_config = self.config.clone();
|
||||
let picker_target = self.app_server_target.clone();
|
||||
let picker_state_db = self.state_db.clone();
|
||||
let picker_environment_manager = Arc::clone(&self.environment_manager);
|
||||
let picker_app_server = tokio::spawn(async move {
|
||||
crate::start_app_server_for_picker(
|
||||
&picker_config,
|
||||
&picker_target,
|
||||
picker_state_db,
|
||||
picker_environment_manager,
|
||||
)
|
||||
.await
|
||||
})
|
||||
.await;
|
||||
let picker_app_server = match picker_app_server {
|
||||
Ok(result) => result,
|
||||
Err(err) => Err(err.into()),
|
||||
};
|
||||
let picker_app_server = match picker_app_server {
|
||||
Ok(app_server) => app_server,
|
||||
Err(err) => {
|
||||
self.add_session_picker_error(format!("Failed to start TUI session picker: {err}"));
|
||||
@@ -26,6 +39,10 @@ impl App {
|
||||
};
|
||||
let selection =
|
||||
crate::resume_picker::run_resume_picker_from_existing_session_with_app_server(
|
||||
crate::uses_remote_workspace_or_environment(
|
||||
&self.app_server_target,
|
||||
&self.environment_manager,
|
||||
),
|
||||
tui,
|
||||
&self.config,
|
||||
&self.local_settings,
|
||||
|
||||
Reference in new issue
Block a user