Skip to content

fix(doctor): repair retained ISO session end timestamps - #194685

Merged
roboclaw-bot merged 1 commit into
mainfrom
roboclaw/oi-194654-iso-endedat
Nov 7, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
roboclaw/oi-194654-iso-endedat

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #194654

What Problem This Solves

Candidate Doctor blocks updates when retained session rows contain ISO-8601 endedAt strings such as 2026-06-11T17:50:58.538Z.

User Impact

Doctor now converts those timestamps losslessly to epoch milliseconds, preserves the session and its unrelated data, updates indexed timing, and reports only a repaired count in a warning. Repeating Doctor makes no further changes. Invalid dates, timezone-ambiguous values, and sub-millisecond values that cannot be preserved still retain the existing offline-repair guidance.

Why This Change Was Made

The maintainer decision for this fix authorizes automatic repair of these retained June values. The existing Doctor migration owns conversion, verified backups, and projection updates; canonical runtime admission remains numeric-only. The candidate must contain the repair; no updater protocol or schema change is needed.

Evidence

  • Main checked at 9c0b599224e1ca6fd831c146ae5132a7d301e885; affected repair/admission paths match the supplied base and still reject this shape.
  • Regression with the reporter's exact timestamp failed before the production fix (found: 1, repaired: 0) and passes with it, checking the original backup, canonical reads, indexed timing, preserved plugin data, count-only warning, and idempotence.
  • Named tests: Doctor entry state 25 passed (62.77 s including cold worker preparation; the new positive regression took 0.681 s), session normalization 45 passed (12.38 s), Doctor transcript SQLite 12 passed (3.59 s). These are production SQLite maintenance contracts; cold compilation dominates file wall time. Exact-head CI passed (702 s workflow wall time), including production types, build, all selected Node shards, lint, docs, and the test-line ratchet; openclaw/ci-gate is green.
  • Touched-file lint, format, and git diff --check pass. The targeted typecheck of all four touched TypeScript files passed on Testbox at 8fa36b1b32852535db86e2d4810b728597e8b397 (18.67 s). The local checkout-isolation guard was preserved when it refused shared dependency links.
  • Local autoreview of the final change snapshot against 7fde96db4f149290e63c28b777126300577f8b42: scoped-clean, P0–P2, no actionable findings. Local ClawSweeper unavailable; the hosted fallback acknowledged automatic intake for this PR, so no duplicate request was posted.
  • Testbox upgrade proof passed (202.94 s): installed latest stable 2026.11.1, ran stable Doctor, seeded six retained June ISO rows across two agents, then ran candidate Doctor and canonical session listing. All six rows and unrelated fields survived, original JSON remained in backups, indexed timing matched, and a second Doctor run changed no rows and emitted no repeat repair warning. This exercised the fixed source snapshot before final import formatting and the extra normalization-table cases; production logic matches the committed head. Both recorded Testbox proof commands exited 0; the lease workflow shows cancelled after the confirmed cleanup stop.
  • The separate test-lines allocation grants exactly this change's 54 new regression lines; the shared scalar is unchanged. These cover the reported SQLite repair and its file-import consumer, invalid-value retention, timezone offsets, and zero epoch.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review ended

ClawSweeper stopped reviewing this revision because the pull request closed.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations size: S labels Nov 7, 2026
@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026
@roboclaw-bot
roboclaw-bot merged commit 715c610 into main Nov 7, 2026
149 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/oi-194654-iso-endedat branch November 7, 2026 17:10
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 8, 2026
)

Doctor now repairs retained session entries whose `endedAt` is an ISO-8601 string by normalizing it to epoch milliseconds, with a warning count. Only unparseable values are still refused, and no entry is dropped. The update candidate's Doctor no longer blocks on these values (fixes openclaw#194654).

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…law#194599)

An agent database on an older schema is now reported as a required state migration, so the managed service is parked with the existing "run openclaw doctor --fix" guidance instead of restart-looping the Gateway. The session-SQLite import still defers such a target and processes the others (fixes openclaw#194580).

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>

(cherry picked from commit 8bea0c1)

Release adaptation: Classify only older canonical agent schemas as existing state-migrations maintenance; Doctor continues deferring matching targets. Keep newer schema refusal/media migration identity. No schema/version/data migration changes; retain focused Gateway parking, committed reader and Doctor regressions. Later cancellation-owner and unrelated Doctor repairs are not prerequisites.

Follow-up dispositions: 410c0dd refactor(infra): read SQLite cancellation from its scope owner (openclaw#200179); 8cd7d87 chore(ci): drop retired test-lines allocation records (1/3) (openclaw#197655); 0e966cc fix: avoid agent database stalls after worker retirement (openclaw#194484); ef47e2e fix(doctor): defer update session-entry inspection when snapshot space runs out (openclaw#196370); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685)

Validation: Source baseline old-schema error was generic SqliteSchemaMismatchError and did not trigger service maintenance parking. Matching existing maintenance codec and Doctor catch reviewed; exact regression group queued. diff check passed.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit f61a73edfda73dc6452f3e0e534cb9e891c05ae6)
(cherry picked from commit 4e8445923f2522eb6b42ab705e15624a1a674a39)
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…aw#194058)

Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139.

Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact.

Co-authored-by: TorstenW <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>

(cherry picked from commit 7c702c3)

Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression.

Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109)

Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd)
(cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Candidate Doctor refuses ISO-8601 string endedAt in session entries with no automatic repair (SessionStoreMigrationRequiredError)

1 participant