Fix OpenCode replay-gap restore on main#348
Conversation
There was a problem hiding this comment.
💡 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 }) |
There was a problem hiding this comment.
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 👍 / 👎.
…ivity-main-20260518' into codex/opencode-hidden-restore-main-20260517
Summary
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.tspassed: 118 tests.npm run typecheck:clientpassed.npm run checkwas attempted and is blocked in theorigin/mainbase by syntax errors inserver/mcp/freshell-tool.tsat lines 73 and 472, from unescaped backticks in embedded guidance text. This branch does not modify that file.Port notes
040bcfbeunused import cleanup is already present onorigin/main, so it has no diff here.6e03da80fresh-agent repair depends on dev-only fresh-agent pane infrastructure that is absent fromorigin/main; applying it directly would introduce non-compilingfresh-agentreferences. It was not included in this main-targeted branch.