You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a947730
Browse filesBrowse the repository at this point in the historyBrowse files
fix(sessions): scope legacy-main owner notice to real legacy rows (#126551)
* fix(sessions): scope legacy-main owner notice to real legacy rows
resolveArmingDecision returns owner-unresolved purely from config, before any
session store is read, so the unresolved-owner notice and the agents-create
gate both fired without checking whether any legacy `main` rows exist. A new
explicit-ownership fleet with zero session data printed "legacy main rows have
no unambiguous configured owner" on every startup, and `agents create main`
dead-ended: it told operators to run `openclaw doctor --fix`, which cannot
resolve anything when there is nothing to migrate.
Probe the candidate stores in the unresolved-owner branch and report
no-legacy-rows when every store proves clean. Unreadable stores, legacy JSON
stores, and genuine read failures still fail open and keep the notice, so the
precaution survives exactly where absence cannot be proven. The main-creation
gate now blocks an unarmed run only when the scan did not prove the fleet
clean; armed runs still require a completed ledger.
Store scanning moves to legacy-main-session-key-scan.ts: the probe and the
armed claim reader share one normalization-aware key predicate, so a store
holding `agent:Main:...` or another key that normalizes to `main` cannot be
misread as clean, and the migration module stays under the max-lines limit.
* test(gateway): stop compaction read-error mocks depending on factory order
src/gateway/server.sessions.compaction-read-errors.test.ts captured the real
loadTranscriptEvents as a side effect of its vi.mock factory, then required it
in beforeEach. The factory runs on first import of the mocked module, so once a
shard shares a worker (--isolate=false) the field could still be unset and all
five tests failed with "transcript reader mock was not initialized".
Resolve the real reader with vi.importActual in beforeAll instead, so the
default implementation no longer depends on whether the factory has run.
Pre-existing on main: 0a8226c fails the same checks-node-compact-small-4 shard
with the identical five tests. Not reproducible locally, including with the
exact 25-file shard composition; CI on Linux runners is the verification.
* test(gateway): load the mocked transcript reader deterministically
src/gateway/server.sessions.compaction-read-errors.test.ts captures the real
loadTranscriptEvents as a side effect of its vi.mock factory and requires it in
beforeEach. The factory only runs when the mocked module is first imported, and
nothing in this file imported it directly, so once a shard shares a worker
(--isolate=false) the capture could still be unset and all five tests failed
with "transcript reader mock was not initialized".
Import the mocked module for its side effect so the factory always runs.
Resolving the reader with vi.importActual instead was wrong: that returns a
separately instantiated, unmocked copy that does not share the module-level
SQLite state the harness sets up, so it read no events, compaction no-opped
successfully and the three rejection tests failed on response.ok. Capturing
through importOriginal keeps the harness's own module instance.
Pre-existing on main: 0a8226c fails the same checks-node-compact-small-4 shard
with the identical five tests.
0 commit comments