Skip to content

Fix OpenCode replay-gap restore on main#348

Open
danshapiro wants to merge 8 commits into
mainfrom
codex/opencode-hidden-restore-main-20260517
Open

Fix OpenCode replay-gap restore on main#348
danshapiro wants to merge 8 commits into
mainfrom
codex/opencode-hidden-restore-main-20260517

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

Summary

  • Port the OpenCode hidden restore investigation into the main-side coding CLI session contract lab note.
  • Recreate the OpenCode viewport hydrate replay-window repair on top of origin/main, including focused TerminalView coverage.

Verification

  • npm run test:vitest -- --run test/unit/client/components/TerminalView.lifecycle.test.tsx test/unit/client/store/tabsSlice.test.ts passed: 118 tests.
  • npm run typecheck:client passed.
  • npm run check was attempted and is blocked in the origin/main base by syntax errors in server/mcp/freshell-tool.ts at lines 73 and 472, from unescaped backticks in embedded guidance text. This branch does not modify that file.

Port notes

  • The 040bcfbe unused import cleanup is already present on origin/main, so it has no diff here.
  • The 6e03da80 fresh-agent repair depends on dev-only fresh-agent pane infrastructure that is absent from origin/main; applying it directly would introduce non-compiling fresh-agent references. It was not included in this main-targeted branch.
  • PR Fix OpenCode focus restore after replay gaps #346 is dev-targeted and was not changed, closed, or commented on.

Copy link
Copy Markdown

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

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: af45323f52

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

} catch {
// disposed
}
ws.send({ type: 'terminal.kill', terminalId })
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle terminal.kill failures during replay-gap replacement

When beginOpenCodeReplacementAfterExit runs, it sets pendingDurableReplacementRef and isAttaching then sends terminal.kill, but recovery only happens on terminal.exit or INVALID_TERMINAL_ID. If killAndWait throws server-side, the backend responds with INTERNAL_ERROR (no requestId), which this component does not handle, so the pending replacement never completes and the pane can stay stuck in an attaching state indefinitely. Add a non-request error path for pending replacements (or a timeout/fallback) so kill failures don't deadlock restore.

Useful? React with 👍 / 👎.

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