Skip to content

fix(codex): recover stale preflight bindings#86602

Merged
steipete merged 1 commit into
mainfrom
fix/86211-codex-preflight-binding-recovery
May 25, 2026
Merged

fix(codex): recover stale preflight bindings#86602
steipete merged 1 commit into
mainfrom
fix/86211-codex-preflight-binding-recovery

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

Fixes #86211.

This is the maintainer-owned replacement for the closed contributor PR #86216, with Paul Frederiksen preserved as co-author in the commit.

Changes:

  • keeps stale Codex app-server thread bindings long enough for recovery to preserve auth/model/sandbox metadata
  • lets auto-reply preflight continue only for structured missing or stale native harness binding failures
  • lets Codex conversation binding recover from an already-cleared binding by creating a fresh thread
  • keeps non-binding compaction failures fail-closed and visible

Verification

  • node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-memory.test.ts extensions/codex/src/app-server/compact.test.ts extensions/codex/src/conversation-binding.test.ts
  • env -u OPENCLAW_TESTBOX -u OPENCLAW_TESTBOX_REMOTE_RUN pnpm check:changed
  • git diff --check
  • /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode local

Real behavior proof

Behavior addressed: Telegram/Codex inbound dispatch no longer aborts solely because preflight compaction encounters a structured stale_thread_binding or missing_thread_binding result from the Codex native harness path.

Real environment tested: Local OpenClaw checkout on macOS, Node/Vitest through repository wrappers, branch fix/86211-codex-preflight-binding-recovery, commit b3c451a.

Exact steps or command run after this patch: Ran targeted runtime regressions with node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-memory.test.ts extensions/codex/src/app-server/compact.test.ts extensions/codex/src/conversation-binding.test.ts; ran env -u OPENCLAW_TESTBOX -u OPENCLAW_TESTBOX_REMOTE_RUN pnpm check:changed; ran git diff --check; ran autoreview local with the Codex engine.

Evidence after fix: The targeted Vitest run passed 57 tests across 3 files. check:changed completed guards, core and extension typechecks, core and extension lint, import-cycle checks, and pairing/webhook guards. Autoreview reported no accepted/actionable findings.

Observed result after fix: Structured missing_thread_binding and stale_thread_binding preflight compaction results return the current session entry instead of throwing. Non-binding failures such as auth profile mismatch still throw. Codex app-server compaction preserves stale binding metadata, and conversation binding can create a fresh thread when recovery finds the binding already cleared.

What was not tested: Live Telegram group delivery against a production gateway was not run in this local maintainer patch. The change is covered by focused runtime tests for the auto-reply preflight and Codex app-server binding paths.

Fixes #86211.
Recreates the focused recovery from #86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(codex): recover stale preflight bindings This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer verification before merge:

  • Target SHA: b3c451a
  • Local targeted tests: node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-memory.test.ts extensions/codex/src/app-server/compact.test.ts extensions/codex/src/conversation-binding.test.ts
  • Local changed gate: env -u OPENCLAW_TESTBOX -u OPENCLAW_TESTBOX_REMOTE_RUN pnpm check:changed
  • Whitespace check: git diff --check
  • Autoreview: /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode local; result was clean with no accepted/actionable findings
  • CI run: https://github.com/openclaw/openclaw/actions/runs/26414576242
  • Real behavior proof run: https://github.com/openclaw/openclaw/actions/runs/26414582673

Known proof gap: no live production Telegram group run was performed for this maintainer patch. The local runtime tests cover the reported stale/missing Codex binding recovery path, metadata preservation, and fail-closed non-binding failure behavior.

@steipete steipete merged commit 9b9d897 into main May 25, 2026
120 of 124 checks passed
@steipete steipete deleted the fix/86211-codex-preflight-binding-recovery branch May 25, 2026 18:37
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 26, 2026
Fixes openclaw#86211.
Recreates the focused recovery from openclaw#86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Fixes openclaw#86211.
Recreates the focused recovery from openclaw#86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Fixes openclaw#86211.
Recreates the focused recovery from openclaw#86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Fixes openclaw#86211.
Recreates the focused recovery from openclaw#86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Fixes openclaw#86211.
Recreates the focused recovery from openclaw#86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
Fixes openclaw#86211.
Recreates the focused recovery from openclaw#86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Fixes openclaw#86211.
Recreates the focused recovery from openclaw#86216 with maintainer-side tests.

Co-authored-by: Paul Frederiksen <paul@paulfrederiksen.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram inbound dispatch aborts when preflight compaction hits missing Codex thread

1 participant