Repository navigation
fix(gateway): preserve stored session addresses across main alias changes - #156109
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 11:12 PM ET / September 23, 2026, 03:12 UTC (Revision 2). ClawSweeper reviewWhat this changesPreserves stored session addresses and runtime metadata after main-session alias changes, and keeps parent relationships consistent across active and archived session views. Merge readiness✅ Ready for maintainer review This remains a useful Gateway fix: current main still reinterprets stored addresses during federation. No actionable introduced defect was found, and the earlier storage repair does not supersede this work. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway combines stored sessions into an in-memory view used by session lists, model selection, and session events. This change separates stored identities from configurable request aliases when building and refreshing that view. flowchart TD
A[Stored session rows] --> C[Gateway session inventory]
B[Current alias configuration] --> D[Literal parent or missing-parent fallback]
C --> D
D --> E[Model and runtime metadata]
D --> F[Active and archived relationships]
E --> G[Session lists and events]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +209, Tests +440. Total +649 across 21 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep stored-address selection with the shared lineage owner while preserving dynamic request aliases and the existing missing-parent compatibility fallback. Do we have a high-confidence way to reproduce the issue? Yes, from source: retain a qualified main session, change its alias configuration, and initialize the Gateway projection; current main's federation rejects the stored key. No runtime execution was performed in this read-only review. Is this the best way to solve the issue? Yes. Reusing the existing stored-address contract and one lineage selector repairs the consumer mismatch without rewriting stored sessions or changing request routing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 516e330fdf63. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…nges (openclaw#156109) * fix(gateway): preserve stored session addresses across main alias changes * refactor(gateway): keep lineage updates with row owners * fix(gateway): complete stored-source usage fixtures Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes cold Gateway initialization failing when a main-session alias change leaves a valid session at its old stored address.
User Impact
Gateway can initialize and keep stored session identity and ACP metadata after main-session alias changes. Existing literal parents retain their model, navigation, and filter relationships across warm and archived views. Public request aliases still follow the current configuration, and historical missing-parent inheritance remains compatible.
A deleted literal parent can still rebind through the shipped missing-parent alias fallback. Distinguishing a formerly literal reference from a historical alias-only reference needs an explicit owner/upgrade decision; that pre-existing ambiguity remains a named follow-up.
Why This Change Was Made
Canonical storage already preserves qualified addresses, but Gateway consumers interpreted those stored addresses again as request aliases. Federation could reject a valid row, and sibling ACP/model/display readers could look up a different session.
One shared lineage selector now chooses an existing literal parent before the current alias. Model inheritance and global display/filter lineage consume the same captured selection after federation completes its inventory. Resident publications converge warm and cold parent indexes and both parents’ child links when a literal parent appears or disappears, without warming archives or acquiring new database facts. Prepared and unprepared ACP reads retain the selected literal address.
The existing absent-parent fallback, removed-default-owner resolution, raw
global/unknownphysical-store ownership, private dispatcher, and per-sender navigation stay intact. Read/admission failures propagate rather than triggering alias fallback. Captured fallback values and misses remain separate from literal-presence evidence.Production: +209 net lines; tests: +440 net lines. The added production code owns shared address selection and cold metadata/index convergence, with topology seeding and cold updates placed in their existing record/archive owners. No schema, request-alias default, process cache, polling, or migration changes.
Evidence
SessionCanonicalKeyMigrationRequiredError. Startup awaits this initialization; this was not a separate full-server run. One selected failure, 12 intentional filtered cases, no suite/unhandled/timeout error, and joined child. This proves the original federation failure only.445a7dad: 75 baseline cases across five full files passed. Candidate53c92aa5/ tree28db9d65: 147 cases across ten full files passed, plus Gateway-root, agents-sessions, and core types. Coverage includes both ACP paths, literal/current-parent collisions, missing-parent compatibility, cross-agent private parents, exact-read errors, and parent-filter selection before cold child materialization.0c3fb250/ treeb9d20d28: 46 cases across the full Worker (13), archived (8), and federation (25) files passed after the reviewed owner extraction and lexical renames. Gateway-root and core types, typed lint on all 19 changed paths, native line-cap ratchet, formatting, and final source guards passed. All eight command children exited zero, with no signal and joined cleanup; no test skips, suite errors, unhandled errors, or timeouts. The unchanged agents-sessions type result carries through the reviewed lexical rename; the earlier 147-case execution remains attributed to its original tree.80dad67d/ tree50dec83donly makes the unused parent selector module-private and completes two usage fixtures with identity source-key resolvers. Independent review confirmed no production behavior or assertion changes; the prior runtime proof remains attributed to0c3fb250. Exact-head CI 35810999211 passed on mergea354c415(base71802788plus this head); all 21 PR file blobs match. The corrected full usage suites passed 38 cases (11 owner-attribution, 27 usage), with no skipped or failed cases in either file. Dependency/export checking, Gateway-methods types, owning lint, formatting, architecture, and the aggregate CI gate passed.Full-file test-command costs, in seconds (
cases / seconds):445a7dad53c92aa50c3fb250The four earlier owner-sibling files passed 44 cases in one 68.258-second command. These are validation costs with different case counts, not a product latency or CPU-speedup claim. Hosted CI finished with 128 successful jobs, 17 intentionally skipped jobs, and no failures. The durable ClawSweeper review covers
80dad67d, finds no actionable issue or remaining rank-up move, and confirms the shared owner repair as the best fix.