Skip to content

Stabilize dev green and canonical agent recovery#342

Closed
danshapiro wants to merge 217 commits into
mainfrom
fix/dev-green-20260516
Closed

Stabilize dev green and canonical agent recovery#342
danshapiro wants to merge 217 commits into
mainfrom
fix/dev-green-20260516

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

@danshapiro danshapiro commented May 16, 2026

Summary

  • stabilize the dev-green fixes around fresh-agent recovery, sidebar/session restore state, websocket restore/error handling, and Codex/OpenCode resilience contracts
  • enforce canonical durable recovery for fresh-agent Claude sessions instead of falling back to mutable legacy names
  • refresh the real OpenCode contract for installed OpenCode 1.15.3, including attach JSON event output
  • harden real-provider test infrastructure by caching process exits and retrying transient Codex wrapper identity proof during sidecar startup
  • close the 3-view PR review gaps by wiring Fresh Agent in production boot, bounding fresh-agent create replay caches, removing the obsolete Codex sidecar/tracker path, and adding direct launch-retry coverage

Context

Red/Green Evidence

  • Red: npm run test:vitest -- test/unit/server/fresh-agent/production-wiring.test.ts test/unit/server/ws-handler-fresh-agent.test.ts test/unit/server/coding-cli/codex-app-server/legacy-sidecar-dead-code.test.ts test/unit/server/coding-cli/codex-app-server/launch-retry.test.ts --run failed before the implementation on production Fresh Agent wiring, fresh-agent cache cleanup, and legacy sidecar file presence. The launch-retry test passed immediately because that claim was a missing direct coverage claim, not a runtime behavior bug.
  • Green: the same focused command now passes in /home/user/code/freshell/.worktrees/dev-green-20260516.

Verification

  • In /home/user/code/freshell/.worktrees/dev-green-20260516: npm run test:vitest -- test/unit/server/fresh-agent/production-wiring.test.ts test/unit/server/ws-handler-fresh-agent.test.ts test/unit/server/coding-cli/codex-app-server/legacy-sidecar-dead-code.test.ts test/unit/server/coding-cli/codex-app-server/launch-retry.test.ts --run
  • In /home/user/code/freshell/.worktrees/dev-green-20260516: npm run test:vitest -- test/unit/server/fresh-agent/runtime-manager.test.ts test/unit/server/fresh-agent/router.test.ts test/unit/server/fresh-agent/claude-adapter.test.ts test/unit/server/fresh-agent/codex-adapter.test.ts test/unit/server/coding-cli/codex-app-server/runtime.test.ts test/unit/server/coding-cli/codex-app-server/client.test.ts test/unit/server/coding-cli/codex-app-server/launch-planner.test.ts --run
  • In /home/user/code/freshell/.worktrees/dev-green-20260516: FRESHELL_TEST_SUMMARY="verify fresh-agent PR review corrections" npm run check
  • Earlier retained checks: npm run test:vitest -- test/integration/real/coding-cli-session-contract.test.ts --run, npm run test:vitest -- test/unit/server/coding-cli/codex-app-server/runtime.test.ts --run, and npm run test:vitest -- test/integration/real/codex-app-server-readiness-contract.test.ts --run

Dan Shapiro added 30 commits May 6, 2026 00:10
OpenCode CLI's TUI enables mouse tracking for click-handling, which
caused the fallbackToCursorKeysWhenAltScreenMouseCapture policy to
intercept scroll events and send up/down arrow keys instead. The CLI
doesn't interpret arrow keys as scroll commands, so scrolling broke.

Change scrollInputPolicy to 'native' so xterm.js passes mouse scroll
SGR sequences through to the CLI, letting it handle them natively.
…creen

- Skip term.scrollLines() in alt screen for touch scrolling (it's a no-op
  since alternate buffer has no scrollback)
- Update opencode scroll/touch test fixtures and assertions to match the
  new native policy: OpenCode no longer translates scroll events to cursor
  keys
# Conflicts:
#	server/coding-cli/codex-app-server/launch-planner.ts
#	server/coding-cli/codex-app-server/runtime.ts
#	server/index.ts
#	test/unit/server/coding-cli/codex-app-server/launch-planner.test.ts
#	test/unit/server/coding-cli/codex-app-server/runtime.test.ts
@danshapiro
Copy link
Copy Markdown
Owner Author

Latest investigation update:

  • Live logs showed restored OpenCode sessions were created and bound successfully; the failure was viewport hydration after replay gaps/huge stale alternate-screen replay, not OpenCode resume launch.
  • Red test added: TerminalView.lifecycle.test.tsx now expects OpenCode replay-gap hydration to force a delayed PTY resize repaint instead of sending input. It failed red against the previous Ctrl-L implementation.
  • Fix: OpenCode viewport hydration uses redraw-only replay (maxReplayBytes: 1) and, on replay gap, sends a temporary resize followed by the original size after 150ms. This matches the live probe where Ctrl-L produced no output and delayed resize produced OpenCode repaint frames.
  • Validation: npm run check passed locally on commit 3625e4f1.
  • Applied to local dev as merge f8e4e0f6 and rebuilt client assets without restarting the self-hosted server.

@danshapiro
Copy link
Copy Markdown
Owner Author

Task 10 update: the fresh-agent/canonical recovery portion of this stale dev-stack carrier is superseded by #351: #351

#351 is built on #350 and preserves the selected fresh-agent/canonical recovery content from 0dea351a, bf4f948d, 9290e5f4, e02e695a, ce6bb53b, bf59a03e, and the canonical UUID portion of ca8c1882. It also carries the small canonical resumeSessionId promotion prerequisite from e333d1a9 because the selected subset depends on it.

This only supersedes the fresh-agent/canonical recovery slice. Codex durability, OpenCode residuals, and the remaining #342 content still need separate handling, so I am not closing #342.

@danshapiro
Copy link
Copy Markdown
Owner Author

Split update: #352 now supersedes the Codex/app-server durability portion of this stale dev-stack carrier only.

Preserved source commits/content from #342: 36528c75, 843ac2ea, 0aff9c2e, 90c1a539, b98e756d, f1739793, and fb0532b7, with fresh-agent recovery and OpenCode residuals left out.

#342 should remain open until the remaining non-Codex portions are superseded separately.

@danshapiro
Copy link
Copy Markdown
Owner Author

Task 12 update: the OpenCode/restore/activity residual portion of this dev-stack carrier has been split to PR #353: #353

Preserved in #353:

  • 035a6949 canonical session ids in focus/history tests
  • ec021780 OpenCode resume model identity and related real-provider harness/server-suite routing
  • fdcc0bfd uncapped OpenCode viewport hydration replay for restored running terminals

Intentionally not duplicated:

I am leaving #342 open rather than closing it in this step because the known supersession map now spans #336, #348, #350, #351, #352, #353, and #333 for the recency sidecar. I do not want to close the stale carrier without a final owner confirmation that no non-listed dev-stack payload remains.

@danshapiro
Copy link
Copy Markdown
Owner Author

Final stale-carrier audit before parity rebuild: I am not closing this PR yet.

Verified covered/superseded slices:

Remaining content I could not find in an open main-target replacement PR:

Leaving #342 open until those payloads are either ported to main-target PRs or explicitly dropped.

@danshapiro
Copy link
Copy Markdown
Owner Author

Task 15 update: opened #355 (#355) as the clean main-targeted replacement for the #331 compact tabs-registry device snapshots payload currently embedded in this stale dev-stack PR. #355 ports only the compact tabs-registry/device snapshot content and intentionally leaves #335 multi-row tabs and the other dev-only payloads out of scope.

@danshapiro
Copy link
Copy Markdown
Owner Author

Task 16 final update: #356 (#356) supersedes the #335 multi-row tabs setting payload from this stale dev-stack carrier. It ports source #335 commit 00a54902 onto current origin/main, including the local multirowTabs setting, Settings toggle, TabBar wrapped layout, local persistence, docs mock CSS, and focused tests.

With #355 covering the #331 compact tabs-registry device snapshots payload, the two remaining gaps identified in the final stale-carrier audit are now covered by clean main-targeted PRs. The earlier comments already map the other #342 slices to their replacement PRs (#350/#351/#354, #352, #353/#348, #336/#338, #332/#333/#349).

Closing #342 as fully superseded. Please review/merge the replacement PRs rather than this stale dev-stack PR.

@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