Repository navigation
Conversation
|
Codex review: needs changes before merge. Reviewed July 1, 2026, 5:38 AM ET / 09:38 UTC. Summary PR surface: Source +377, Tests +918. Total +1295 across 19 files. Reproducibility: yes. at source level. Current main canonicalizes structured non-agent raw keys into agent-scoped keys and still prunes noncanonical target store keys, matching the linked session-split report. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Move raw external alias preservation into Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main canonicalizes structured non-agent raw keys into agent-scoped keys and still prunes noncanonical target store keys, matching the linked session-split report. Is this the best way to solve the issue? No in the current branch shape. The raw-alias behavior is the right direction, but current main moved migrated session writes behind Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cf2efbe5d515. Label changesLabel justifications:
Evidence reviewedPR surface: Source +377, Tests +918. Total +1295 across 19 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
Addressing the ClawSweeper rank-up move:
Current PR-head checks are complete on No code change needed for this comment; this is a CI/proof follow-up on the same one-commit branch. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
d94f20d to
87ecc78
Compare
|
Rebased onto current Current head: After rebase: Also clean: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated the PR description with a @clawsweeper re-review |
|
Updated #83368 for the remaining compact metadata alias gap and rebased onto current Current head: What changed since the last push:
Validation on the rebased head: No screenshots apply here because the changed behavior is backend session-store alias synchronization, not a visual UI surface. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated #83368 for the latest ClawSweeper Signal opaque-ID finding. Current head: What changed since the last push:
Validation on the rebased head: No screenshots apply here because the changed behavior is backend session-store alias synchronization, not a visual UI surface. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated #83368 for the latest canonical-key alias discovery finding. Current head: What changed since the last push:
Validation on the rebased head: No screenshots apply here because the changed behavior is backend session-store alias synchronization, not a visual UI surface. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg 🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress. Hatch commandComment Hatchability rules:
What is this egg doing here?
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated #83368 for ClawSweeper's plugin host-hook alias finding. Current head: What changed since the last push:
Validation on the pushed head: @clawsweeper re-review |
|
Proof fields restored and the Real behavior proof workflow is now green on head @clawsweeper re-review |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Closes #63005.
Behavior addressed
External raw session keys such as
conversation:pair:...and opaque provider keys such asSignal:Group:<mixed-case-id>should survive gateway session-key canonicalization. Any follow-up mutation should keep the raw key and the visibleagent:<id>:canonical key pointing at the same session entry instead of splitting history or plugin-owned state.Root cause
migrateAndPruneGatewaySessionStoreKeycanonicalized raw external keys before preserving the raw-key store entry as an alias of the canonical agent key. The first fix preserved that raw alias, but some write paths still replaced, mutated, or deleted only one key.The later review findings exposed the remaining gaps:
sessions.listhid the raw alias, canonical-key patch/delete/reset/compact flows did not rediscover the hidden raw aliasenqueuePluginNextTurnInjection,drainPluginNextTurnInjections, andpatchPluginSessionExtension) updated onlyloaded.storeKey, leaving hidden raw aliases with stale plugin stateThe canonical-key derivation also has to preserve separators such as
user_a::user_b, so it cannot useparseAgentSessionKeyfor raw-rest extraction because that parser drops empty segments.Fix
The preserved raw-alias logic is now shared in
src/gateway/session-store-aliases.ts, with alias-aware write, sync, and delete helpers.Covered mutation paths now route writes through the shared alias contract:
sessions.patchsessions.deletesessions.resetsessions.compaction.restoresessions.compactmanual metadata updatessessions.compactmaxLines metadata updatesPreserved raw aliases stay internal-only for lookup continuity:
sessions.listfiltering/search/count collapses a raw+canonical alias pair into one visible canonical session row.Canonical visible keys now rediscover an existing hidden raw alias by stripping the
agent:<id>:prefix while preserving the rest of the key exactly. Canonical-only sessions do not grow a new raw alias.Opaque Signal group peer IDs are preserved when deriving raw aliases, so mixed-case group IDs do not create lowercased duplicate logical session rows.
Real Behavior Proof
Behavior or issue addressed: Raw external session aliases are preserved during canonicalization, stay synchronized across direct session mutations, compaction/checkpoint lifecycle writes, canonical visible-key follow-ups, and plugin host-hook writes, while keeping only one visible canonical row in list/search/count.
Real environment tested: Source checkout on PR head
1cde6d4a5d222273ed4c9c69b5d6e4ac402282c9, basef07c87405c3094feceaaf2f0f19a2e765a25e78d, Node 22, repo dependencies installed.Exact steps or command run after this patch:
Also ran the targeted and broader regression commands listed in the Validation section below.
Evidence after fix:
{ "primaryKey": "agent:main:conversation:pair:user_a::user_b:space:space_123", "preservedAliasKeys": [ "conversation:pair:user_a::user_b:space:space_123" ], "afterWrite": { "canonicalSessionId": "sess-write", "rawSessionId": "sess-write", "rawSendPolicy": "deny", "sameEntry": true }, "visible": { "listKeys": [ "agent:main:conversation:pair:user_a::user_b:space:space_123" ], "listCount": 1, "listTotalCount": 1, "searchKeys": [ "agent:main:conversation:pair:user_a::user_b:space:space_123" ], "searchCount": 1, "searchTotalCount": 1 }, "deleted": true, "afterDelete": { "canonicalSessionId": null, "rawSessionId": null }, "canonicalVisibleKeyFlow": { "listedKeys": [ "agent:main:conversation:pair:user_a::user_b:space:space_123" ], "afterWrite": { "visibleKey": "agent:main:conversation:pair:user_a::user_b:space:space_123", "primaryKey": "agent:main:conversation:pair:user_a::user_b:space:space_123", "preservedAliasKeys": [ "conversation:pair:user_a::user_b:space:space_123" ], "canonicalSessionId": "sess-visible-write", "rawSessionId": "sess-visible-write", "rawSendPolicy": "deny", "sameEntry": true }, "deleted": true, "afterDelete": { "canonicalSessionId": null, "rawSessionId": null } } }The command printed local stale-plugin config warnings for
multica; they are unrelated to this PR and did not affect the session-store proof.Observed result after fix: The raw alias and canonical key share the same written entry after replacement, including patched
sendPolicy; list and search return one visible canonical row withtotalCount: 1; delete removes both keys. Starting from the visible canonical list key also rediscovers the hidden raw alias, writes both aliases, and deletes both aliases. The plugin regressions show canonical-key plugin next-turn enqueue/drain and session-extension patch/unset update or clear the hidden raw alias too.What was not tested: No full live external chat-channel round trip was run. No screenshots are attached because this is backend session-store behavior with no visual UI surface.
Regression Coverage
src/gateway/session-utils.test.tscovers raw/canonical alias collapse, mixed-case Signal opaque-ID preservation, canonical-key rediscovery, and canonical-only no-new-raw-alias behavior.src/gateway/server.sessions.store-rpc.test.tscovers list-to-patch/list-to-delete using the visible canonical key while the hidden raw alias follows.src/gateway/server.sessions.reset-cleanup.test.tscovers reset alias synchronization.src/gateway/session-compaction-checkpoints.test.tscovers checkpoint metadata persistence to both aliases.src/gateway/server.sessions.compaction.test.tscovers checkpoint restore, manual compaction metadata, and maxLines compaction metadata alias sync.src/plugins/contracts/host-hooks.contract.test.tscovers canonical-key plugin next-turn injection enqueue and drain syncing the hidden raw alias.src/plugins/contracts/session-entry-projection.contract.test.tscovers canonical-key plugin session-extension patch and unset syncing the hidden raw alias and promoted slot.Validation
Ran on head
1cde6d4a5d222273ed4c9c69b5d6e4ac402282c9:pnpm docs:listwas run before editing. Broad Testbox changed gate was not run because theblacksmithCLI is not installed in this environment; local validation was kept to targeted gateway/plugin proof and GitHub CI is running on the pushed head.Screenshots
No screenshots apply because this is backend session-store alias synchronization, not a visual UI surface.