Skip to content

fix(sessions): preserve lifecycle targets during maintenance - #146749

Merged
steipete merged 1 commit into
mainfrom
codex/swarm-lifecycle-retention
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/swarm-lifecycle-retention

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #130741

What Problem This Solves

Fixes automatic maintenance archiving an aged session while a lifecycle mutation still owns it.

User Impact

The session stays available during its lifecycle change, and normal retention resumes after that change finishes. Retention settings and transcript contents are unchanged.

Why This Change Was Made

The existing maintenance preserve set now includes active lifecycle ownership, matching the store scope, session key and backing session ID. Work-admission guards and explicit deletion retain their existing behavior.

Evidence

Both new regressions fail on the main preimage and pass with the fix. All 108 tests across maintenance, pruning and lifecycle admission pass on Node 24.21.0, including unrelated-session archival and resumed retention. Canonical changed checks pass and fresh P1 review is clean. This correctness split makes no Swarm latency claim.

@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@steipete
steipete marked this pull request as ready for review September 13, 2026 04:53
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Sep 13, 2026
@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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 1:02 AM ET / 05:02 UTC.

ClawSweeper review

What this changes

The PR prevents automatic session maintenance from archiving or pruning sessions undergoing lifecycle changes and adds regressions showing retention resumes afterward.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main lacks lifecycle-target protection during maintenance. No actionable introduced defect was found, and the maintainer-protected PR should remain open.

Priority: P2
Reviewed head: 7526eff69c4b2edf816871d3b37ebddbbdda8ee9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and no supported blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored fix, so the external-contributor proof gate does not apply. Its SQLite regressions cover maintenance during ownership and after release; umbrella UI media is not counted as proof of this race.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored fix, so the external-contributor proof gate does not apply. Its SQLite regressions cover maintenance during ownership and after release; umbrella UI media is not counted as proof of this race.
Evidence reviewed 9 items Introduced change: The pinned merge-base-to-head diff adds lifecycle checks to the existing preserve-set collector; the host-verified test merge contains the same two changed files.
Still necessary on main: Fetched main combines runtime providers and acquired work admissions, but does not include active lifecycle mutations in maintenance protection.
Latest release comparison: The same lifecycle-protection omission exists in the supplied latest release, v2026.9.4.
Findings None None.
Security None None.

How this fits together

Session maintenance applies retention rules to stored conversations. It consults runtime ownership before selecting sessions to archive or remove, preserving conversations that ongoing operations still need.

flowchart TD
  A[Stored sessions] --> D[Maintenance preserve set]
  B[Active work] --> D
  C[Active lifecycle changes] --> D
  D --> E[Retention selection]
  E --> F[Keep protected sessions]
  E --> G[Archive or prune eligible sessions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +15, Tests +59. Total +74 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 17 2 +15
Tests 1 59 0 +59
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 76 2 +74

Review metrics

None.

Technical review

Best possible solution:

Keep lifecycle protection in the existing maintenance collector, using live store-scoped ownership and allowing normal retention immediately after release.

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

Yes, from source: run automatic maintenance on an aged session while its lifecycle mutation is active; current main omits that ownership from preservation. The added SQLite regressions encode this sequence, but were not executed in this review.

Is this the best way to solve the issue?

Yes. Extending the shared preserve-set owner is a narrow repair that reuses existing lifecycle state and leaves retention configuration and explicit deletion intact.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a bounded race between session lifecycle changes and automatic retention without evidence of a widespread urgent outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored fix, so the external-contributor proof gate does not apply. Its SQLite regressions cover maintenance during ownership and after release; umbrella UI media is not counted as proof of this race.

Label justifications:

  • P2: This repairs a bounded race between session lifecycle changes and automatic retention without evidence of a widespread urgent outage.
  • 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 supplied repository state identifies a maintainer-authored fix, so the external-contributor proof gate does not apply. Its SQLite regressions cover maintenance during ownership and after release; umbrella UI media is not counted as proof of this race.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • 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.

@steipete
steipete merged commit cb92030 into main Sep 13, 2026
253 checks passed
@steipete
steipete deleted the codex/swarm-lifecycle-retention branch September 13, 2026 06:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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