Skip to content

fix: handle terminal startup failures and degraded session watchers#279

Merged
danshapiro merged 5 commits intomainfrom
fix/restore-launch-failure-reviewed
Apr 3, 2026
Merged

fix: handle terminal startup failures and degraded session watchers#279
danshapiro merged 5 commits intomainfrom
fix/restore-launch-failure-reviewed

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

Summary

  • surface provider-aware startup and restore failures instead of reconnect loops that flash and reload dead tabs
  • return exited-terminal attach errors with recent output so restores fail in place with useful context
  • fall back to periodic coding-session full scans when chokidar watch setup degrades or late roots are still missing

Testing

  • npm run test:vitest -- test/unit/client/components/TerminalView.lifecycle.test.tsx
  • npm run test:vitest -- --config vitest.server.config.ts test/server/ws-edge-cases.test.ts test/unit/server/terminal-registry.test.ts test/unit/server/coding-cli/session-indexer.test.ts
  • npm test

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

ℹ️ 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".

Comment on lines +520 to +521
this.needsFullScan = true
this.scheduleRefresh()
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 Avoid debouncing away every fallback full scan

The fallback loop schedules a refresh every rootFallbackScanIntervalMs using scheduleRefresh(), but scheduleRefresh() always clears any pending timer before creating a new one. With the defaults in this commit (rootFallbackScanIntervalMs = 1000, debounceMs = 2000), each fallback tick cancels the prior refresh before it can fire, so no full scan runs while fallback mode is active. In degraded watcher or missing-root scenarios, this prevents the intended recovery behavior and sessions may not appear until some unrelated trigger/full-scan interval occurs.

Useful? React with 👍 / 👎.

@danshapiro danshapiro merged commit d1f8366 into main Apr 3, 2026
1 check passed
@danshapiro danshapiro deleted the fix/restore-launch-failure-reviewed branch April 3, 2026 04:53
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