Skip to content

Fix OpenCode focus restore after replay gaps#346

Closed
danshapiro wants to merge 3 commits into
devfrom
codex/opencode-focus-activation-repro-20260517
Closed

Fix OpenCode focus restore after replay gaps#346
danshapiro wants to merge 3 commits into
devfrom
codex/opencode-focus-activation-repro-20260517

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

Summary

  • recover visible restored OpenCode panes when viewport hydration hits replay_window_exceeded by retiring the stale PTY before restored create
  • add a red/green lifecycle test for the focus/activation path
  • update the OpenCode restore research note with the production log evidence and repair policy
  • remove the unused RestoreFallbackAttempt import that was failing lint

Verification

  • npm run lint (exit 0; existing warnings remain)
  • npm run test:vitest -- test/unit/client/components/TerminalView.lifecycle.test.tsx --run
  • npm run test:vitest -- test/e2e/opencode-startup-probes.test.tsx --run

Base

This PR targets dev because the focus repair depends on the current OpenCode resilience integration stack already present there. A clean cherry-pick onto origin/main conflicts in TerminalView.tsx and the research note does not exist on origin/main yet.

@danshapiro
Copy link
Copy Markdown
Owner Author

Superseded by main-targeted replacements for the parity rebuild.

Verified coverage:

  • Fix OpenCode replay-gap restore on main #348 carries the OpenCode visible viewport replay-gap repair and focused /home/user/code/freshell/src/components/TerminalView.tsx / /home/user/code/freshell/test/unit/client/components/TerminalView.lifecycle.test.tsx coverage onto main.
  • Fix OpenCode replay-gap restore on main #348 carries the restore-contract note on main in /home/user/code/freshell/docs/lab-notes/2026-04-20-coding-cli-session-contract.md; the detailed dev research note is no longer a reason to keep a dev-target carrier open.
  • Fix fresh-agent resume pane repair #354 carries the separate fresh-agent resume-pane repair for the main rebuild.

The only #346-only delta left is a one-line unused RestoreFallbackAttempt import removal in /home/user/code/freshell/src/store/panesSlice.ts on current dev. That is a dev-stack cleanup, not a main-parity payload, so this stale dev-target PR can be closed.

@danshapiro danshapiro closed this May 18, 2026
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