Skip to content

fix(codex): prevent startup hangs after binding migration#103281

Merged
steipete merged 3 commits into
openclaw:mainfrom
bdjben:codex/fix-codex-sidecar-migration-loop
Jul 10, 2026
Merged

fix(codex): prevent startup hangs after binding migration#103281
steipete merged 3 commits into
openclaw:mainfrom
bdjben:codex/fix-codex-sidecar-migration-loop

Conversation

@bdjben

@bdjben bdjben commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Codex binding sidecars that had already been imported into plugin state could remain beside transcripts when no current session owned them. Startup doctor then rediscovered and locked the same orphan sources on every run instead of converging the migration.

Why This Change Was Made

Keep this repair in the Codex doctor migration owner. The migration now classifies each source as zero-owner, uniquely owned, ambiguous, or indeterminate; validates canonical plugin-state rows; records unique session ownership with a compare-and-set update; and archives only after zero ownership or a successful owner update is proven.

The hardened version also preserves configured session-store path semantics while using canonical paths only to deduplicate aliases, contains transcript locators, retires stale rows after ownership races, preserves live leases and legitimately retired generations, and leaves foreign, malformed, ambiguous, or unreadable state untouched for review. No runtime fallback path is added.

User Impact

Safe orphan migrations now converge instead of repeating at startup. Current owners keep their Codex harness marker, while ambiguous or unsafe sources remain recoverable and produce an explicit warning rather than being archived speculatively.

Evidence

  • Focused migration regression matrix in extensions/codex/doctor-contract-api.test.ts, including zero/unique/ambiguous/indeterminate ownership, malformed state, owner races, live leases, retired generations, path containment, and symlinked store aliases.
  • Fresh full-diff autoreview: clean, no accepted or actionable findings.
  • Exact head d547621c338ad36303bff49170da4af240072203: hosted CI passed 43 jobs with zero failures; Real behavior proof passed; the Testbox-backed prepare wrapper accepted the exact-head gates.

@bdjben

bdjben commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@steipete steipete self-assigned this Jul 10, 2026
@steipete

Copy link
Copy Markdown
Contributor

Maintainer rewrite and land-ready review are complete at exact head d547621c338ad36303bff49170da4af240072203.

What changed:

  • Kept ownership in the Codex doctor migration; no runtime fallback was added.
  • Classified zero, unique, ambiguous, foreign, and indeterminate owners before archival.
  • Validated raw session rows against the SDK-normalized index and validated existing canonical plugin-state rows.
  • Preserved configured store-path semantics while using canonical identities only for alias dedupe.
  • Made owner recording compare-and-set safe, retiring only the exact stale active row while preserving live leases, new generations, and legitimately retired state.
  • Added deterministic coverage for ownership states, malformed input, locator containment, concurrency, and symlinked store paths.

Proof:

  • git diff --check
  • Fresh full-diff GPT-5.5 xhigh autoreview: clean, no accepted/actionable findings.
  • Hosted CI run 29083208246: 43 successful jobs, 10 intentional skips, zero failures.
  • Real behavior proof run 29083206162: passed.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 103281: exact-head hosted gates accepted and remote tree verified.

Known proof gap: no live user state was mutated. The deterministic migration state matrix is the safer and stronger proof for destructive archival decisions.

Separate follow-up: the pending SQLite session-storage flip must preserve owner CAS after import ordering changes; it should not add a runtime fallback here.

@steipete
steipete merged commit 1f3ea6f into openclaw:main Jul 10, 2026
95 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
…03281)

* fix(codex): archive imported orphan binding sidecars

* fix(codex): harden binding sidecar migration

Co-authored-by: Benjamin Badejo <[email protected]>

* chore: keep release notes out of contributor PRs

---------

Co-authored-by: Benjamin Badejo <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
steipete added a commit that referenced this pull request Jul 11, 2026
…faults for the stable cut (#104656)

* feat(openai): default new setups to GPT-5.6 (#103581)

* feat(openai): default fresh setup to GPT-5.6

* test(crestodian): expect GPT-5.6 Codex defaults

* test(crestodian): expect GPT-5.6 bootstrap default

(cherry picked from commit ab5d143)

* fix(infra): converge legacy state migrations on archive collisions

(cherry picked from commit 474d660)

* fix(codex): prevent startup hangs after binding migration (#103281)

* fix(codex): archive imported orphan binding sidecars

* fix(codex): harden binding sidecar migration

Co-authored-by: Benjamin Badejo <[email protected]>

* chore: keep release notes out of contributor PRs

---------

Co-authored-by: Benjamin Badejo <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 1f3ea6f)

* fix(migrations): converge recoverable legacy state (#104529)

Signed-off-by: sallyom <[email protected]>
(cherry picked from commit cdb58ca)

* test(openai): align auth contract with provider default (#103760)

(cherry picked from commit 9b4c7c0)

* fix: clear remaining release validation blockers (#104555)

* test: align provider tool call lifecycles

* test: isolate plugin install repair migrations

* fix: accept catalog temperature compatibility

* fix: disable GPT-5.6 tool reasoning on completions

* style: avoid shadowed stream model

(cherry picked from commit 57af2bb)

* test(release): keep GPT-5.6 backport scoped

* test(release): restore doctor config type import

---------

Signed-off-by: sallyom <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Ben Badejo <[email protected]>
Co-authored-by: Benjamin Badejo <[email protected]>
Co-authored-by: Sally O'Malley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants