Skip to content

fix(host): the marked repair also removes the old socket of an older host - #305

Merged
ThomasK33 merged 6 commits into
mainfrom
fix/marked-repair-old-socket
Nov 4, 2026
Merged

ThomasK33 merged 6 commits into
mainfrom
fix/marked-repair-old-socket

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Why

ThomasK33 asked to work every deferred follow-up of the first autopilot round until none is left, and to ship valid deferred review findings as a follow-up PR in the same run. Codex's last review round on #284 found this one (P2, thread on src/host/lifecycle.ts), and #284 deferred it because that round took blockers only.

A reconcile that repairs a marked session (#284) records destroyed and then unlinks the session's socket. A host of an older version listens at the old path under /tmp/agent-tty (#288). The repair never removed that old socket, so list or inspect recorded destroyed and left the old socket file of a dead host until a later gc or destroy. recordDestroyed already removes it.

What changed

  • src/host/lifecycle.ts: after the marked repair's unlink and socket directory cleanup, reconcileSession calls removeLegacySocketBestEffort, as recordDestroyed does. That helper removes the old socket only when isOwnLegacySocket accepts it, and it logs errors instead of throwing them.
  • .agents/skills/verify-session-lifecycle/scripts/facts.mjs: the ReconcileRepairsMarked pattern includes the new statement. SKILL.md and src/host/README.md name the old-socket removal. The model has one host version, so the old socket path stays outside it.

Behavior changes for CLI and JSON users

  • No JSON shape, error code or exit code changes.
  • After list, inspect or gc repairs a marked session, the old socket of an older host is gone too.

Validation

  • Red first: at 933125a0 (test only), a reconcile that repairs a marked session removes it failed (the old socket under /tmp/agent-tty stayed). It passes on the head. The two other old-socket tests (destroy removes it when the host is dead, destroy keeps it when the host check throws) pass before and after.

  • Lifecycle check (check.sh --update-coverage): all 71 runs as expected, current 25,534,376 distinct states and current-no-token 24,675,744 (unchanged: the model does not change, and ReconcileRepairsMarked still reads TRUE). Coverage synced in 4eb86f8d.

  • Gates: typecheck, lint and format pass. Unit 1930/1930. socket-directory and lifecycle integration 77/77 (vitest run --maxWorkers=1 --retry=2).

  • Merge of main ca7c6367 (fix: create stops its host and names the session on every error of its readiness wait #294, ci: give the macOS quality gates 45 minutes instead of 30 #306, docs: say that a query a shell command prints leaves its reply at the next prompt #298; merge ad0395c2, coverage a0ce3474), no Codex round (Codex round 1 on 4eb86f8d was clean in both lanes). Only coverage.json conflicted. check.sh: all 71 runs as expected, same state counts. facts.mjs drift 0. Unit 1938/1938. Typecheck and lint pass.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T21:39:04.032894Z 4eb86f8 Manual request
🔒 Security Review ✅ Completed 2026-11-03T21:40:00.146641Z 4eb86f8 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 4eb86f8da6

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4eb86f8da6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit bee349a Nov 4, 2026
14 checks passed
@ThomasK33
ThomasK33 deleted the fix/marked-repair-old-socket branch November 4, 2026 00:05
@github-actions github-actions Bot mentioned this pull request Nov 4, 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