Skip to content

fix(sessions): skip disabled dashboard expiry queries - #191967

Merged
vincentkoc merged 2 commits into
mainfrom
fix/skip-disabled-dashboard-age-probe-20261103
Nov 4, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/skip-disabled-dashboard-age-probe-20261103

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Session maintenance scans dashboard expiry rows even when dashboard expiry is disabled. PostgreSQL materializes that unused query result before the caller discards it.

User Impact

Disabled dashboard expiry no longer performs that scan. Existing expiry deadlines and recent-session protection are preserved; database schemas and stored values are unchanged.

Why This Change Was Made

The existing deadline calculation always returns Infinity for a disabled dashboard age. Skip that query at its owner instead of loading rows that cannot affect the deadline. Keep the separate recent-protection scan intact.

Evidence

  • Acceptance rule: with dashboard expiry null or zero, execute zero dashboard queries and preserve the exact next deadline; recent protection must still work when enabled.
  • Added four cases using the existing real SQLite statement counter, covering null/zero settings with and without recent protection.
  • Native syntax, diff, and staged formatting checks passed. Independent review found no actionable issue.
  • Exact-head cadence suite: 32 SQLite tests passed. Core and session-test typechecks, targeted lint, and formatting passed.
  • Fresh exact-head independent review: no findings.
  • The stacked PR 192023 separately passed eight real PostgreSQL cases, including disabled dashboard policies; that is follow-up-head evidence.
  • Proof: Blacksmith Testbox run 41676457364. Completed Testbox commands exited 0 before the lease reached its one-hour workflow limit. The later cancelled workflow status does not represent an interrupted test command.
  • No latency, CPU, or memory improvement is claimed.
  • Production: +15/-15 lines. Tests: +42 lines. No schema, retention, durability, or stored-format change.

Regression replay

All four disabled-dashboard cases failed on the unpatched frozen base: the unchanged deadline was correct, but one dashboard query ran instead of zero. They pass at this PR head. Replayed with test-only overlays and unchanged production on the recorded base through Blacksmith Testbox.

Landing refresh — 2026-11-04

Current head: 539d7bbc27b2430aa7a611c487b8ece1993ebaa2. Integrated frozen main d27139b2b220327d6f65b659c6fba0b0110fad97; independent integration review found no new source defect. Earlier exact-head evidence above remains explicitly attributed and is reused only for unchanged inputs. Maintainer landing is now authorized; GitHub checks and native landing guards remain enforced.

Combined Track A candidate tree 6059134c361ed8602271261ddb940c9b9d1b413e: 1,183 tests passed, 12 intentional skips across tooling, sessions, plugin workers and Matrix. The repository transaction-boundary guard passed. Test-line total and ceiling both equal 6,447,876; allocations credit only each change’s literal added test lines. Real PostgreSQL integration recheck is in progress and is not counted as passed here.

No DDL, schema-version/fingerprint, persisted representation, retention/durability, identity, or recovery-authority changes are introduced by this PR. This is scoped functional proof, not a global PostgreSQL or performance qualification.

Current merged-base CI has an inherited test-line ceiling deficit: main toast commit 1be3b6d2a1a786a325724faf9126010b7195087f added 46 test lines without credit (+44 in ui/src/lib/toast.browser.test.ts, +2 in ui/src/e2e/chat-attachment-toast.test-support.ts). This PR’s own added lines are fully allocated. Exact failed-run attribution remains a separate native landing requirement.

Completed integration qualification

Targeted real PostgreSQL qualification completed: 50 tests passed across 13 files, including the five newly registered inventory suites, public recovery paths and session-bound/cold-selection regressions. Schema parity checks found zero unexplained differences. The real cold maintenance workload also passed its0/0 full-batch scan and2/2 mixed-batch scan expectations, with admission checks retained.

Seven relevant type configurations and four scoped lint groups completed without diagnostics. The one README separator-format failure was corrected and the repository formatter check passed. Runtime tests remain tied to tree 6059134c361ed8602271261ddb940c9b9d1b413e; tree 338bef659fad31f557af06c4930cf4ce6a628733 differs only by that Markdown blank line.

The remaining test-line red is attributed to unchanged main toast inputs; this PR’s exact failed run and two-parent merge are recorded in native landing evidence. That red is not called a passing check.

@vincentkoc vincentkoc self-assigned this Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR skips dashboard-expiry queries when that expiry policy is disabled while preserving recent-session protection.

Example: Dashboard expiry and pruning are disabled, with recent-session protection set to seven days.

  • Before: Maintenance executes an unnecessary dashboard query plus the required activity query.
  • After: Maintenance executes only the activity query and retains the same next deadline.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, correct source change with meaningful real-database regression coverage; supplied evidence does not establish inspected shipped-entry-point coverage.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; source and reported real-SQLite replay cover the changed owner, while the linked Testbox logs could not be inspected because their download host is blocked.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Session maintenance performs unnecessary database work when users have disabled dashboard expiry.
Reason: The maintainer-authored direction removes provably irrelevant work while preserving existing policy outputs and defaults.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR fixes a current unnecessary database scan with a focused change and no actionable source findings; the explicit review hold and unresolved CI gate remain.

Priority: P2
Reviewed head: 539d7bbc27b2430aa7a611c487b8ece1993ebaa2

Before merge

  • Await maintainer action - Vincent must complete the expressly requested review before merge or auto-merge.

Findings

None.

Tests

  • Missing end-to-end proof: The earlier requested shipped-maintenance before/after query trace remains unverified; the body reports base/head replay, but the linked Testbox log download is blocked by review infrastructure.
Agent review details

How this fits together

Session-maintenance planning passes resolved retention settings and a database snapshot to the age-fact owner, which reads relevant timestamps and returns the next scheduling deadline.

flowchart LR
A[Maintenance planner] --> B[Age fact owner]
B --> C[Enabled dashboard expiry]
B --> D[Recent activity protection]
C --> E[Database timestamp queries]
D --> E
E --> F[Next maintenance deadline]
Loading

Technical review

Best possible solution:

Retain the existing owner's positive-age guard and independent recent-protection scan, then land after the explicit review hold and CI gate are resolved.

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

Current-main source directly shows the unconditional scan and disabled-age Infinity result; the PR also reports intended base/head regression failures and passes, which this read-only review did not rerun.

Is this the best way to solve the issue?

The smallest complete fix is to apply the existing disabled-age condition before the query in the existing age-fact owner; this diff does that without a parallel path, new state, or changed retention semantics.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Dashboard deadline metadata reads keeps the original intent (9dee538: Combine dashboard and pending-alias projections into one statement while preserving eligibility, snapshot semantics, and exact deadlines.)
  • Disabled-age deadline semantics and worker placement keeps the original intent (c958468: Move automatic maintenance database work to workers while retaining policy and scheduling facts with their existing owners.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c958468 adds src/config/sessions/session-accessor.sqlite-maintenance-age.ts:181 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c9584688c461; files: src/config/sessions/session-accessor.sqlite-maintenance-age.ts)

PR surface

Source 0, Tests +42, Other +1. Total +43 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 15 15 0
Tests 1 42 0 +42
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 3 58 15 +43

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on maintainer.

Label justifications:

  • P2: Removes unnecessary maintenance database work with limited blast radius and no demonstrated urgent availability failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-03T14:47:20.046Z sha 577b2e1 :: needs maintainer review before merge. :: none

Reviewed November 3, 2026, 7:17 PM ET / November 4, 2026, 00:17 UTC (Revision 2).

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head 539d7bbc27b2430aa7a611c487b8ece1993ebaa2. Integrated main d27139b2b220327d6f65b659c6fba0b0110fad97; preserved the scoped schema-neutral repair and original recorded runtime/base-regression proof. Test-line allocation covers only this PR’s added test lines. Independent integration review found no new source issue. Updated combined SQLite/PostgreSQL qualification is running; CI remains a separate landing gate. No schema version, DDL, stored representation, or recovery-authority change is introduced.

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 4, 2026
@vincentkoc
vincentkoc merged commit f0ebd97 into main Nov 4, 2026
142 of 145 checks passed
@vincentkoc
vincentkoc deleted the fix/skip-disabled-dashboard-age-probe-20261103 branch November 4, 2026 01:52
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant