Skip to content

feat: improve unavailable workspace recovery and cleanup#1183

Merged
su8su merged 6 commits into
mainfrom
fix_delete_workspace
Jul 20, 2026
Merged

feat: improve unavailable workspace recovery and cleanup#1183
su8su merged 6 commits into
mainfrom
fix_delete_workspace

Conversation

@su8su

@su8su su8su commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c131ca07ae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/pages/Chat/index.tsx
}}
onStop={() => void cancelAcp()}
disabled={acpLoading || acpCancelling || !cwd}
disabled={acpLoading || acpCancelling || !cwd || !workspaceContextAvailable}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep Stop enabled during workspace-unavailable runs

When an ACP prompt is already running (for example after restoring a live session, or if the workspace becomes unavailable while a run is active), adding !workspaceContextAvailable to the disabled prop disables the stop button too, because ChatInput derives canStop from sending && !inputDisabled. This leaves users unable to cancel the active run while the missing-workspace recovery state is shown; the unavailable workspace check should block new sends without disabling Stop.

Useful? React with 👍 / 👎.

Comment thread src/pages/Chat/index.tsx
Comment on lines +489 to +494
if (promptCwd !== cwd) {
const promptWorkspace = await hostApi.files.resolveWorkspaceContext({
workspaceRoot: promptCwd,
executionCwd: promptCwd,
}).catch(() => ({ ok: false }));
if (!promptWorkspace.ok) return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report failed target-workspace validation

For @agent sends where the target agent's workspace differs from the current cwd, a missing target workspace now causes this return to silently drop the user's message after selectAcpSession(sessionKey) has already moved the UI to the target session. In that scenario there is no unavailable banner for the target workspace and no ACP load error, so the user sees a session switch but no explanation or sent prompt; surface the validation failure or defer switching until after validation succeeds.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c01c79577e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/pages/Chat/index.tsx
Comment on lines +260 to +263
if (!result.ok || !result.workspaceRoot || !result.executionCwd) {
setResolvedWorkspaceContext(null);
setWorkspaceContextCheck({ key: workspaceContextKey, available: false });
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear stale chat content for missing workspaces

When a user switches from a populated chat to an existing session whose workspacePath was moved or deleted, this failure path only clears resolvedWorkspaceContext; the later load effect returns while workspaceContextAvailable is false, so the ACP store still holds the previous session's timeline. The render path below then shows the unavailable-workspace banner above another chat's messages/actions. Clear or replace the ACP timeline here, or gate timeline rendering on acpTimeline.sessionId === currentSessionKey when workspace resolution fails.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad9b5de760

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +33 to +36
const result = await hostApi.files.resolveWorkspaceContext({
workspaceRoot: path,
executionCwd: path,
}).catch(() => ({ ok: false }));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid exposing deletes on resolver transport errors

Because this catch converts any rejected resolveWorkspaceContext call into {ok:false}, the sidebar treats an IPC/host bridge failure during startup or reload the same as Main confirming that the directory is missing. In that scenario a valid non-default workspace gets the unavailable badge and destructive group-delete button until a later focus recheck, so users can delete all sessions for a workspace that was never actually validated as unavailable. Keep rejected checks as checking/unknown or retry, and only mark unavailable when Main returns an explicit negative result.

Useful? React with 👍 / 👎.

@su8su
su8su merged commit 5d0099a into main Jul 20, 2026
7 checks passed
@su8su
su8su deleted the fix_delete_workspace branch July 20, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant