Skip to content

fix(codex): reclaim binding capacity after session deletion - #128366

Merged
steipete merged 6 commits into
mainfrom
worktree-codex-binding-owner-fix-20260822
Aug 27, 2026
Merged

steipete merged 6 commits into
mainfrom
worktree-codex-binding-owner-fix-20260822

Conversation

@steipete

@steipete steipete commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where deleting or expiring Codex-backed sessions leaves durable binding rows behind, eventually exhausting the shared plugin-state limit and preventing new work. Failed native startup can leave a binding before the session records its harness, and cron base/run aliases can share a physical session ID without sharing their logical ownership.

Why This Change Was Made

This rewrites the original patch around the session deletion owner. Core prepares the existing registered harness outside the SQLite writer, then invokes an exact-generation, synchronous companion compare-delete at the row removal edge. Transaction failures compensate that deletion; errors after commit do not resurrect it. Registry replacement, competing work, supervision, and active native claims are checked before the destructive step. Ordinary physical-ID rollover remains a transfer, preserving compaction adoption.

Codex releases the original connection's subscription after commit, serialized with native resume. Any surviving owner, including a same-key successor or legacy conversation binding, preserves the subscription. Upstream native history is never deleted or archived. Cron now persists the selected harness on both base and run rows before native startup.

Doctor uses its existing migration planner, after canonical session repair. It scans bounded pages, uses physical-ID evidence without inventing a main-session key, and compare-deletes only unchanged, proven orphan rows under maintenance ownership. Current, leased, supervised, malformed, ambiguous, and advisory state survives. No schema/version bump, config option, or capacity increase is introduced. The optional harness lifecycle gains two named SDK types so extracted plugin implementations share one public contract. Session-scoped resume now uses the same canonical model/auth planner and credential fingerprint as agent turns, preventing a second native writer while retaining the existing API-key/subscription billing boundary. Two existing generic helpers are exported through their owning SDK runtime entrypoints; no new auth policy or client registry is introduced. Manual attachment now records pending intent, verifies the immutable native tool catalog, and applies configuration only under uninterrupted sole physical-client ownership. The lease-generation guard reaches unsubscribe and the synchronous binding write; failed or competing adoption preserves the selected thread instead of silently starting another.

User Impact

Session deletion and expiry free binding capacity. Operators with accumulated orphan rows can stop the Gateway and run openclaw doctor --fix; ordinary Doctor detects the repair. Other sessions continue working, and deleted OpenClaw sessions can explicitly resume their preserved native Codex history.

The two existing databases still have a process-crash window between their commits; this change provides synchronous compensation, not a distributed transaction. Doctor repairs proven leftover ownership conservatively and does not invent missing native bindings.

Evidence

  • Original-main exact-key deletion regressions fail and pass with the rewrite, including missing harness metadata. Doctor reproductions cover synthetic-main misidentification and canonical-row races.
  • A 50,000-row incident fixture removes 47,782 proven orphan bindings, retains 2,218 live/protected/advisory rows including all four logical owners, restores capacity, and is idempotent.
  • Current validated coverage: 344 core/Doctor/cron tests with four existing skips, and 833 Codex cases across runs. The broader Codex run caught one unsafe-cleanup error-contract regression; after correcting it, all 170 lifecycle/client/retirement tests passed. Three actual-command/shared-client competing-lease regressions fail before the fence and pass afterward.
  • Current plugin/plugin-test types, scoped lint, formatting, assertion/max-lines ratchets, dead-export scans and import-cycle checks pass. Earlier unchanged core/core-test/scripts and remaining schema/database/auth boundary checks also pass. Fresh Codex review reports no findings at its default P0 threshold; independent owner review completed.
  • Fresh full Linux arm64 build and authenticated Gateway proof passed at 8f8b29c72f0cb42e0d9483b1e00bdbecae526720, using Codex 0.149.1 and openai/gpt-5.6-luna in a local container. The live test passed in 503.26 seconds (one case passed, one optional case skipped). It rejected a competing resume, verified both original bindings unchanged, deleted the selected session and binding, completed a sibling turn on the same native thread, and resumed the deleted session’s original native thread for a real model reply. Prior authenticated failures drove both the canonical-auth and pending-configuration repairs.
  • CI 33030480464 failed in two test fixtures: the Gateway delivery-context helper returns at acceptance and races the next fixture’s deletion; the OAuth command test timed out. Both fixture repairs now pass: five Gateway cases in original order and all 12 auth cases with cold source caches and the original timeout (OAuth: 1.621s, no plugin discovery). No production changes, timeout increases, auth-policy mocks, or weaker assertions. Pre-rebase test-only head d18ac70d162f3c011863b051024838d618428080 passed CI 33033571018. Superseded CI 33024648388 attempt2 received runner shutdown exit143 with no lint diagnostic, then was cancelled for the production repair.
  • The pre-rebase head differs from the authenticated live/build head only in command-rpc.test.ts and server.agent.subagent-delivery-context.test.ts; production and live-test content are identical. Fresh core/plugin test types, lint, format and SDK test-boundary checks pass; fresh Codex review found no actionable issues at the default P0 threshold.
  • Production/tooling LOC: +3,397/-1,376 (net +2,021); tests/support: +3,022/-126; docs: +59/-4. Material growth supplies previously missing deletion/compensation, bounded repair and native configuration ownership contracts. It reuses existing registries, leases, SQL helpers and migration/auth planners, removes the old post-delete path, and adds no capacity/config/schema-version surface.

Review follow-through: Doctor migration docs now apply to all plugins. Canonical SDK export sync is idempotent; surface check passes at 4,345 public exports and 2,582 callable exports. The budget values are maintained policy constants, not generated files; the tool has report/check modes only. The generic lifecycle remains optional and closure-bound. The fresh live test passed an actual competing-owner resume denial, followed by allowed deletion, sibling continuation and same-native-thread history resume. The denial comes from the exclusive owner check before the control request; the live test observes the rejection, unchanged bindings and continued sibling work. This is not an instrumented native-I/O trace or an injected stale callback. Separate deterministic owner tests assert no native request for stale/revoked callbacks and competing lease generations. Injecting a retired internal callback through the public Gateway is not a supported operator flow, so that specific rank-up variant remains deterministic proof rather than a live claim.

Redacted observed live result:

Live source head: 8f8b29c72f0cb42e0d9483b1e00bdbecae526720
[gateway-codex-live] session-deletion {"competingResumeRejected":true,"removedBinding":true,"siblingContinued":true,"nativeHistoryResumed":true}
Test Files 1 passed; Tests 1 passed | 1 skipped; exit=0

Direct upstream inspection uses Codex rust-v0.149.1 (ff29a44391deccde0aba0f8390337d7f3c319ea4). thread_processor.rs:944-990 and thread_state.rs:488-579 show connection/thread membership without reference counting or generation tokens; thread_lifecycle.rs:7,49-64 and thread-store/src/local/writer_lock.rs:25-85 explain the retained writer. thread_processor.rs:4006-4054 plus thread_status.rs:223-251,336-347 establish successful reload notifications, but thread_manager.rs:1804-1820 can reuse a concurrently resumed native child. Therefore status notifications alone are insufficient: adoption requires the exact shared-client lease generation through commit. core/src/session/mod.rs:663-668 establishes the immutable stored dynamic tool catalog. Goal operations remain unchanged because their pinned implementation supports stored threads without loading a writer.

Named follow-ups: the advisory catalog-provenance cache should include the expected thread ID in its key; adoption bypasses that cache and validates the header ID. Separately, Crabbox pristine-workspace GitHub hydration can leak runner registration when fingerprint invalidation fails before sync; owned leaked resources were cleaned up. Current proof is local-container, not remote AWS/Blacksmith proof.

Release-note context: fixes Codex session-deletion/expiry capacity leaks and conservatively repairs accumulated orphan bindings while preserving native history. Original PR and rewrite authored by @steipete.

Latest Review Follow-through

The reported new fork-skip write race is not reachable with supported canonical targets. runPreparedSqliteSessionWrite keeps the original writer when there are no deletion targets and no beforeCommit; parent fork selects only noncanonical rows for deletion, but its earlier resolver rejects duplicate rows and a sole noncanonical alias. A final-head executable probe passed both skip branches with an independently queued concurrent update preserved. Duplicate and sole-alias inputs were rejected before deletion preparation, with both rows unchanged. All four cases observed zero deletion preparations. This addresses the review premise without adding unreachable-path guards or changing production behavior.

A separate follow-up is recorded for cross-process parent-fork skip patches: the old owner already merged a pre-transaction child snapshot, and its process-local queue does not serialize another process. That pre-existing surface needs a dedicated multi-process reproduction and a coherent fork-owner repair; it is not the new same-process writer-release regression alleged here. Both the pre-rebase and final rebased CI runs are green, including the two previously failing lanes.

The PR was mechanically rebased to 5a22aff71faa2b1e3d9dd295d95c59d62183cc00 after another SDK export change landed on main. Combined surface counts validate at 4,345 public and 2,582 callable exports; canonical export sync is clean. Range-diff confirms the reviewed runtime patch is unchanged. All 29 focused session-deletion/parent-fork tests and the four-case fork probe pass after rebasing. Final CI 33035491600 passed on that exact head: 156 passing checks, 43 skips, no pending or failed checks. The earlier live/build proof remains at the stated source head, not the full rebased tree.

Maintainer implementation decision after the latest review (03:21 UTC): retain the optional generic withSessionDeletion lifecycle for this rewrite. Core owns logical session deletion and harness plugins own their companion bindings; a Codex-specific core hook would put policy in the wrong owner. Existing harness implementations gain no required callback or parameter. Retain the existing two stores with compensation and conservative Doctor repair, explicitly without a cross-database crash-atomicity claim. No table or schema-version change is introduced; existing-database repair, protected rows and idempotence are covered by the incident/migration fixtures. The acting maintainer agent directly inspected the exact sibling Codex source cited above; its absence from the automated review checkout is not a dependency-proof gap in this review. Exact-head CI is now complete and green. All latest rank-up items are addressed without requesting another redundant review cycle.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations extensions: codex size: XL maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 21:01
@steipete steipete self-assigned this Aug 23, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 11:21 PM ET / August 27, 2026, 03:21 UTC.

ClawSweeper review

What this changes

The PR reclaims Codex thread-binding capacity when an OpenClaw session is deleted, adds conservative Doctor repair for orphaned bindings, and fences native-thread cleanup and resume ownership.

Warning

SQLite table change

This PR modifies persisted SQLite tables in extensions/codex/src/migration/session-binding-orphans.ts. Prefer a design that avoids changing persisted SQLite tables. If the change is necessary, verify migration and upgrade compatibility against an existing database before merge.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open for maintainer review. The PR addresses a real session-state capacity failure with an owner-boundary design, but it introduces a public Plugin SDK lifecycle contract and durable cross-store cleanup; the required direct Codex runtime-source check cannot be completed because the sibling checkout is absent.

Priority: P1
Reviewed head: 5a22aff71faa2b1e3d9dd295d95c59d62183cc00
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR has substantial focused coverage and a claimed authenticated run, but its public SDK and Codex dependency contract remain unverified for merge readiness.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: Not applicable to the ordinary contributor-proof gate because this is maintainer-authored; the body supplies a redacted terminal trace, but unavailable direct Codex source inspection prevents it from settling the dependency contract.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to the ordinary contributor-proof gate because this is maintainer-authored; the body supplies a redacted terminal trace, but unavailable direct Codex source inspection prevents it from settling the dependency contract.
Evidence reviewed 8 items Deletion owner boundary: The new coordinator prepares harness deletion outside the SQLite writer, rechecks ownership, and enters the synchronous commit edge through the session-deletion context.
Exact binding compare-delete: The Codex binding owner requires the prepared generation and lease token to remain current, conditionally removes the exact stored row, and restores it on pre-commit rollback.
Caller reaches the commit edge: Session-row and legacy-alias deletion paths invoke the shared deletion commit hook before removing their rows.
Findings None None.
Security None None.

How this fits together

OpenClaw stores session rows in an agent database while the Codex plugin stores native-thread bindings in shared plugin state. Deletion must update both owners safely, then release only the deleted session's native subscription while preserving shared native history.

flowchart LR
  A[Session lifecycle request] --> B[Prepare harness deletion]
  B --> C[Codex binding lease]
  C --> D[Agent database transaction]
  D --> E[Binding commit or rollback]
  E --> F[Native subscription release]
  G[Doctor repair] --> E
Loading

Decision needed

Question Recommendation
Should OpenClaw adopt the optional public Plugin SDK withSessionDeletion lifecycle contract and its durable two-store cleanup semantics for external harness plugins? Approve after contract verification: Confirm the external-harness lifecycle contract after direct Codex source review and let exact-head CI complete.

Why: This is a compatibility-sensitive public plugin contract and persistent-state behavior change; source inspection establishes the implementation shape but cannot determine the intended long-term SDK contract.

Before merge

  • Resolve merge risk (P1) - The optional public Plugin SDK session-deletion hook changes the contract available to external harness plugins; maintainers need to accept its lifecycle and compatibility semantics.
  • Resolve merge risk (P1) - The patch changes durable session-associated binding deletion across two stores. The supplied live trace is from a pre-rebase head, while current-head CI remains incomplete.
  • Resolve merge risk (P1) - The direct Codex source contract required to validate subscription, thread retention, and concurrent-resume assumptions was unavailable in this review environment.
  • Complete next step (P2) - A maintainer must decide the public SDK and persistent-state contract, and the required direct Codex dependency check cannot be completed in this checkout.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Runtime/tooling/docs delta +3,571 / -1,514; tests/support +3,033 / -455 This is substantial non-test growth for a bug fix, justified only if the shared deletion lifecycle and recovery contract are accepted as the canonical owner boundary.

Stored data model

Persistent data-model change detected: migration/backfill/repair: docs/plugins/sdk-migration.md, migration/backfill/repair: extensions/codex/doctor-contract-api.ts, migration/backfill/repair: extensions/codex/src/migration/session-binding-orphans.ts, migration/backfill/repair: src/commands/doctor-session-transcripts.incident.test.ts, migration/backfill/repair: src/commands/doctor-session-transcripts.test.ts, migration/backfill/repair: src/commands/doctor-session-transcripts.ts, and 79 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify and accept the lifecycle contract (recommended)
    Inspect the exact Codex runtime contract, confirm SDK ownership, and require the current head's checks before merge.
  2. Pause for a narrower design
    Keep this PR open while maintainers decide whether the public hook should instead remain Codex-specific.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Verify the direct Codex runtime contract for subscription and concurrent resume, record SDK lifecycle approval, and require green checks on the current head.

Technical review

Best possible solution:

Retain the prepared owner-boundary deletion design only after direct Codex contract inspection and explicit maintainer acceptance of the generic SDK lifecycle and cross-store recovery contract.

Do we have a high-confidence way to reproduce the issue?

No: this read-only review did not execute the failing deletion path. The PR body provides a redacted authenticated run and focused regression claims, but they were not independently rerun here.

Is this the best way to solve the issue?

Unclear: placing binding cleanup at the session-deletion owner is a plausible canonical fix, but direct Codex runtime-contract verification and acceptance of the new public SDK contract are still required.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 47fe3cc8fc0c.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P1: Leaked Codex bindings can exhaust plugin-state capacity and prevent subsequent Codex-backed work.
  • merge-risk: 🚨 compatibility: The PR adds an optional public Plugin SDK lifecycle callback that external harness implementations may adopt.
  • merge-risk: 🚨 session-state: Session deletion now coordinates durable session rows and plugin binding rows across separate stores.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to the ordinary contributor-proof gate because this is maintainer-authored; the body supplies a redacted terminal trace, but unavailable direct Codex source inspection prevents it from settling the dependency contract.

Evidence

What I checked:

Likely related people:

  • steipete: Blame attributes the pre-existing Codex retirement flow on current main and the proposed deletion owner flow on this head to Peter Steinberger. (role: current and preceding lifecycle owner; confidence: high; commits: 8e1c34e21d, 5a22aff71faa; files: extensions/codex/src/app-server/session-retirement.ts, src/config/sessions/session-accessor.sqlite-deletion.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Make the exact sibling Codex checkout available and verify the thread subscription and concurrent-resume contract directly.
  • Record explicit acceptance of the optional Plugin SDK lifecycle contract, then wait for current-head CI.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-26T23:22:53.456Z sha 0dacb6f18afdcd260297383d3960ddf9021f5535 :: needs real behavior proof before merge. :: [P2] Regenerate the SDK surface budget | [P2] Describe the migration contract for all plugins
  • reviewed 2026-08-26T23:55:21.484Z sha 4f27de9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T00:25:39.258Z sha 4f27de9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T01:40:07.996Z sha 8f8b29c :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T01:48:56.820Z sha 8f8b29c :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T02:20:11.783Z sha 8f8b29c :: needs real behavior proof before merge. :: [P1] Revalidate fork-skip targets after deletion preparation
  • reviewed 2026-08-27T02:45:25.310Z sha d18ac70d162f3c011863b051024838d618428080 :: found issues before merge. :: [P1] Revalidate fork-skip targets at the commit edge
  • reviewed 2026-08-27T03:05:08.836Z sha d18ac70d162f3c011863b051024838d618428080 :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Holding this PR before merge. Direct source review plus two independent owner-boundary reviews found the post-commit finalizer does not repair the reported producer safely.

Blocking findings:

  • Failed isolated runs still leak. The cron run row can be created without agentHarnessId; the Codex binding is written during execution, but harness ownership is projected only by successful finalization. A thrown run skips that projection and deletes the row in finally, so the new callback declines cleanup and the binding survives.
  • The exact cron alias case is inverted. Base and :run: rows can share a sessionId, while Codex bindings hash the exact session key. isRetained() suppresses cleanup whenever any row retains that ID, so deleting the run key can preserve its orphaned run-key binding. The doctor migration later identifies the same key mismatch as stale.
  • Known conflicts are discovered after commit. Supervision ownership and live claimed-thread conflicts are checked only after the canonical session row is gone. The current test explicitly accepts “session deleted, binding retained,” which is an unrecoverable half-delete for supervised bindings because doctor intentionally preserves them.
  • Cleanup is not crash-durable and normal doctor does not surface it. Pending work is in memory after the agent-DB commit; a crash recreates the original orphan. The repair migration is fix-only and the ordinary health probe checks a different namespace.
  • The physical agent-DB writer queue is held across arbitrary async plugin callbacks. This creates avoidable head-of-line blocking and a reentrancy/deadlock contract for public plugin handlers.
  • The incident fixture does not reproduce the live shape. It seeds legacy physical keys and a different binding/marker distribution instead of stable hashed run keys with four live owners and the observed stale/current split.

Upstream Codex confirms the ownership distinction: thread/delete destroys persisted history and descendants, thread/archive preserves durable history, thread/unsubscribe only releases one connection, and thread/closed is an idle runtime unload. The fix must release the exact OpenClaw binding/subscription without deleting the upstream thread.

Required rewrite: use the existing exact agent-harness lifecycle owner for a pre-commit prepared deletion. Acquire/revalidate the binding and plugin generation before destructive writes, reject supervision/live claims while both records remain, synchronously compare-delete the exact binding, commit the session deletion, and compensate by compare-restoring the binding if the agent-DB commit fails. Keep doctor as bounded crash recovery for the unavoidable cross-database commit window. Cover the real cron base+run path, failed run, supervision/live claim, alias move, registry replacement, rollback, and incident-scale stable-key distribution.

I am taking the branch through that rewrite and will refresh the PR evidence before it is eligible for landing.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 23, 2026
@steipete
steipete force-pushed the worktree-codex-binding-owner-fix-20260822 branch from 89f45cd to 0dacb6f Compare August 26, 2026 22:57
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts agents Agent runtime and tooling labels Aug 26, 2026
@steipete steipete changed the title fix(codex): finalize deleted session bindings fix(codex): reclaim binding capacity after session deletion Aug 26, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Rewritten around the session deletion owner in 0dacb6f18af: prepare and veto before SQLite mutation, exact-row companion compare-delete with compensation, post-commit native cleanup serialized with resume, and bounded conservative Doctor repair. The earlier review checklist and maintainer hold are addressed by owner-boundary regressions, the 50,000-row incident fixture, registry/claim/alias/race coverage, and a fresh Codex review. The authenticated Docker live run is in progress; I will add its actual result before landing.

@clawsweeper re-review

@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Aug 27, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 27, 2026
Prepare harness deletion outside the SQLite writer and compare-delete exact companion ownership at the session removal edge, with compensation before commit and native subscription release afterward. Preserve live siblings and upstream native history. Repair proven orphan bindings through the existing Doctor planner under maintenance ownership.
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 27, 2026
Record pending attachment intent and validate the immutable native tool catalog
before applying configuration to the selected thread. Require uninterrupted
physical-client ownership through native unsubscribe, resume, and binding commit.
Keep the thread intact on unsupported policy, competing work, or failed proof.

Reuse canonical retained-owner cleanup and preserve unsafe-client retirement.
Cover the real command producer, cold and loaded resumes, competing leases,
lazy-store commit fencing, and the Gateway competing-owner path.
@steipete
steipete force-pushed the worktree-codex-binding-owner-fix-20260822 branch from d18ac70 to 5a22aff Compare August 27, 2026 03:09
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 27, 2026
@steipete
steipete merged commit 0924fd9 into main Aug 27, 2026
216 checks passed
@steipete
steipete deleted the worktree-codex-binding-owner-fix-20260822 branch August 27, 2026 03:33
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…#128366)

* fix(codex): reclaim binding ownership when sessions are deleted

Prepare harness deletion outside the SQLite writer and compare-delete exact companion ownership at the session removal edge, with compensation before commit and native subscription release afterward. Preserve live siblings and upstream native history. Repair proven orphan bindings through the existing Doctor planner under maintenance ownership.

* fix(codex): reuse prepared auth for resumed thread ownership

* docs(plugins): clarify shared migration and auth contracts

* test(codex): use the canonical config type facade

* fix(codex): preserve native threads during manual resume

Record pending attachment intent and validate the immutable native tool catalog
before applying configuration to the selected thread. Require uninterrupted
physical-client ownership through native unsubscribe, resume, and binding commit.
Keep the thread intact on unsupported policy, competing work, or failed proof.

Reuse canonical retained-owner cleanup and preserve unsafe-client retirement.
Cover the real command producer, cold and loaded resumes, competing leases,
lazy-store commit fencing, and the Gateway competing-owner path.

* test: isolate Codex auth and session completion fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant