Skip to content

fix: restore interrupted coding-cli sessions via durable identity#308

Open
danshapiro wants to merge 1 commit intomainfrom
exact-durable-session-contract
Open

fix: restore interrupted coding-cli sessions via durable identity#308
danshapiro wants to merge 1 commit intomainfrom
exact-durable-session-contract

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

Summary

  • introduce an explicit durable session contract so live runtime handles are separated from durable restore identities across Codex, Claude, FreshClaude, and OpenCode
  • make provider promotion authoritative from durable artifacts and events, including exact-path Codex rollout tracking from app-server thread.path and fs/watch instead of scanning ~/.codex/sessions
  • propagate the contract through session repair, WebSocket snapshots, persistence, sidebar and background-session UI, and pane or tab restore flows
  • add real-provider probes plus integration, unit, and e2e coverage to lock the contract in place

Testing

  • npm test
  • FRESHELL_REAL_PROVIDER_CONTRACTS=1 npm run test:vitest -- test/integration/real/coding-cli-session-contract.test.ts

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: 88fecbd052

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


router.post('/tabs', async (req, res) => {
const { name, mode, shell, cwd, browser, editor, resumeSessionId, permissionMode, model, sandbox } = req.body || {}
const { name, mode, shell, cwd, browser, editor, sessionRef, permissionMode, model, sandbox } = req.body || {}
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 Restore legacy resume input for tab creation

The /api/tabs handler now only reads sessionRef, so resume requests sent as resumeSessionId are silently ignored and a fresh session is created instead of resuming. This regresses existing callers in the repo (for example server/cli/index.ts still posts { resumeSessionId } at line 316), so freshell new-tab --resume ... no longer resumes the requested session.

Useful? React with 👍 / 👎.

Comment on lines +271 to +273
try {
process.kill(pid, 'SIGTERM')
} catch (error) {
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 terminating live sidecars during orphan reaping

This reaper sends SIGTERM to every sidecar process described by metadata as long as the PID/identity matches, but it never verifies that the sidecar is actually orphaned. Because startup unconditionally calls CodexTerminalSidecar.reapOrphanedSidecars() (server/index.ts:291), starting a second Freshell instance can kill active Codex sidecars owned by another running instance, breaking those terminals.

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