Skip to content

fix(sessions): isolate fresh creation from unrelated archive exports - #148958

Merged
steipete merged 2 commits into
mainfrom
codex/swarm-fresh-upsert-archive-20260915
Sep 17, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/swarm-fresh-upsert-archive-20260915

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #130741

What Problem This Solves

Creating a fresh session can report an unrelated archive-export failure after its session row and transcript have already committed.

User Impact

Fresh sessions can be created independently of failed exports from other sessions. Those archives remain recoverable through the existing deletion and retry paths.

Why This Change Was Made

Fresh upserts with maintenance disabled do not own unrelated archive recovery. Skip only that publication path; existing entries, resets, removal retries, maintenance, Doctor work, and empty retries retain their required publication behavior.

Evidence

The archive-path collision regression proves creation succeeds while preserving the pending archive bytes, followed by successful recovery on deletion retry. All six complete regression and sibling suites passed (38 tests), together with canonical checks, in a clean Linux Testbox using Node 24.19 and pnpm 12.4. The candidate source tree and every tracked file were verified before and after installation, tests, and checks. The Testbox command exited successfully and its lease completed.

Skip unrelated pending archive publication for fresh session upserts with
maintenance disabled. Preserve publication for existing entries, resets,
removal retries, maintenance, and Doctor work.

A real archive collision reproduces creation failing after its session row
and transcript committed; verify successful creation and later archive
recovery through the lifecycle entry points.

Related: #130741
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S maintainer Maintainer-authored PR labels Sep 15, 2026
@steipete
steipete marked this pull request as ready for review September 15, 2026 09:22
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 11:15 AM ET / 15:15 UTC (Revision 4).

ClawSweeper review

What this changes

The PR prevents fresh session creation from retrying unrelated archive exports, adds creation and recovery regressions, and documents how to retry failed exports.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main still couples fresh session creation to unrelated archive-export failures. No blocking defect was found, and the protected maintainer PR should remain open.

Priority: P2
Reviewed head: 3e62ca8e5267dea73dccc9faf536e1c44415a588

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level fix with meaningful recovery coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate and introduces no material authority change; its reported Testbox regressions exercise creation and archive recovery through the SQLite lifecycle owner.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate and introduces no material authority change; its reported Testbox regressions exercise creation and archive recovery through the SQLite lifecycle owner.
Evidence reviewed 7 items Introduced fix and preserved recovery paths: The complete projection module shows that publication is skipped only for nonempty fresh upserts with maintenance disabled and no removals, canonical repair, or Doctor transfer. Existing-entry updates and empty retries still publish. The patch leaves commit guards, canonical archive persistence, and transaction validation unchanged.
Actual creation entrypoint and failure mechanism: createSessionEntryWithTranscript invokes the lifecycle owner with maintenance disabled. publishSessionStateArchives attempts pending exports even when its requested archive list is empty and throws after recording publication failures. These are OpenClaw-owned SQLite/filesystem operations; no Codex dependency contract is involved.
Current main still needs the fix: Fetched main still unconditionally calls publishSessionStateArchives after the lifecycle commit. The related merged cleanup-reporting change does not isolate fresh creation.
Findings None None.
Security None None.

How this fits together

OpenClaw’s session lifecycle owner commits session changes and retains deleted transcripts as canonical SQLite archives. A separate publication step exports those archives to files; this change controls which lifecycle operations invoke that step.

flowchart TD
  A[Session lifecycle request] --> B[Validate and commit SQLite changes]
  B --> C{Fresh creation only?}
  C -->|Yes, maintenance disabled| D[Return creation success]
  C -->|No| E[Publish pending archive files]
  F[Canonical SQLite archives] --> E
  E --> G[Record success or retryable failure]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +16, Tests +162, Docs +6. Total +184 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 21 5 +16
Tests 1 162 0 +162
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 189 5 +184

Review metrics

Metric Value Why it matters
Production and regression growth Production net +16 lines; tests +162 lines The production growth adds one publication decision in the existing owner, justified by isolation and recovery coverage.

Technical review

Best possible solution:

Keep fresh creation independent of unrelated exports while preserving canonical archive bytes and the existing explicit recovery operations.

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

Yes, from source: leave a deleted session’s export pending through a file collision, then create an unrelated session with maintenance disabled. Current main retries that export after committing creation; this review did not execute the scenario.

Is this the best way to solve the issue?

Yes. The condition belongs in the existing lifecycle owner and preserves removal retries, existing-entry updates, maintenance, and Doctor recovery without adding configuration or changing stored formats.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1ee713eed0bd.

Labels

Label justifications:

  • P2: This fixes a bounded session-creation failure triggered by an unrelated pending archive export.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate and introduces no material authority change; its reported Testbox regressions exercise creation and archive recovery through the SQLite lifecycle owner.

Evidence

What I checked:

  • Introduced fix and preserved recovery paths: The complete projection module shows that publication is skipped only for nonempty fresh upserts with maintenance disabled and no removals, canonical repair, or Doctor transfer. Existing-entry updates and empty retries still publish. The patch leaves commit guards, canonical archive persistence, and transaction validation unchanged. (src/config/sessions/session-accessor.sqlite-projection.ts:530, 3e62ca8e5267)
  • Actual creation entrypoint and failure mechanism: createSessionEntryWithTranscript invokes the lifecycle owner with maintenance disabled. publishSessionStateArchives attempts pending exports even when its requested archive list is empty and throws after recording publication failures. These are OpenClaw-owned SQLite/filesystem operations; no Codex dependency contract is involved. (src/config/sessions/session-accessor.entry-mutation.ts:116, 3e62ca8e5267)
  • Current main still needs the fix: Fetched main still unconditionally calls publishSessionStateArchives after the lifecycle commit. The related merged cleanup-reporting change does not isolate fresh creation. (src/config/sessions/session-accessor.sqlite-projection.ts:534, 1ee713eed0bd)
  • Latest release comparison: The v2026.9.4 source retrieved through GitHub also calls archive publication unconditionally. Release source was inspected remotely because the corresponding local object was unavailable. (src/config/sessions/session-accessor.sqlite-projection.ts:518, 3a9d69db306c)
  • Focused regression coverage: The added test creates a real archive-path collision, checks successful fresh creation without changing the pending archive, then verifies byte-preserving recovery after deleting the collision. Five additional cases retain publication for existing updates, canonical repair, Doctor transfer, maintenance, and empty retries. Existing archive-worker coverage separately exercises retry after deletion has already committed. Tests were inspected, not executed in this read-only review. (src/config/sessions/session-accessor.sqlite-fresh-upsert-archive.test.ts:86, 3e62ca8e5267)
  • Discussion and validation context: The captured PR body reports 38 passing tests and canonical checks in https://github.com/openclaw/openclaw/actions/runs/35233613939. GitHub identifies this as a completed, cancelled Testbox workflow; that aggregate status neither verifies nor disproves the reported commands inside the lease. Previous completed review context contains no findings or published rank-up moves.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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 (3 earlier review cycles)
  • reviewed 2026-09-15T09:21:49.134Z sha b673364 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T09:28:32.077Z sha b673364 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T15:08:17.485Z sha 3e62ca8 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit b669279 into main Sep 17, 2026
214 checks passed
@steipete
steipete deleted the codex/swarm-fresh-upsert-archive-20260915 branch September 17, 2026 15:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…148958)

Skip unrelated pending archive publication for fresh session upserts with
maintenance disabled. Preserve publication for existing entries, resets,
removal retries, maintenance, and Doctor work.

A real archive collision reproduces creation failing after its session row
and transcript committed; verify successful creation and later archive
recovery through the lifecycle entry points.

Related: openclaw#130741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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