Skip to content

fix(gateway): preserve raw external session aliases - #86826

Closed
bladin wants to merge 1 commit into
openclaw:mainfrom
bladin:fix/86743-session-key-alias
Closed

bladin wants to merge 1 commit into
openclaw:mainfrom
bladin:fix/86743-session-key-alias

Conversation

@bladin

@bladin bladin commented May 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #86743.

Summary

Implements raw external session alias preservation to prevent session splitting when internal agent activity touches the same logical conversation.

Changes

  • Added src/gateway/session-store-aliases.ts with alias resolution logic
  • Updated migrateAndPruneGatewaySessionStoreKey to sync raw aliases with canonical keys

Related

Fixes openclaw#86743. Implements raw external session alias preservation
during gateway session key canonicalization to prevent session
splitting after internal agent activity.
@clawsweeper

clawsweeper Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask.

Close as stalled and unproven: this external PR has had an expired real-behavior-proof ask, no new head work, and the patch still only covers the migration hook rather than the full session-state writer surface.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #86743
Summary: The canonical remaining problem is the refreshed raw external session-key split issue; this PR is a stalled partial candidate fix, while the broader related PR remains open but conflicting.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again.

Review details

Best possible solution:

Keep the refreshed canonical issue open and land one repaired raw/canonical alias contract at the session storage boundary, with coverage for lookup, patch, reset, delete, compaction, resolver, node-event, and plugin host-hook mutations.

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

Yes, at source level: current main canonicalizes structured raw keys into agent-scoped keys and prunes noncanonical aliases, matching the reported session split path. I did not run a live external-channel replay in this read-only review.

Is this the best way to solve the issue?

No. Migration-only alias preservation is a useful start, but the best fix needs one storage-boundary alias contract that keeps raw and canonical entries synchronized across every persisted mutation path.

Security review:

Security review cleared: No concrete security or supply-chain concern was found; the diff is limited to gateway session-store TypeScript with no workflow, dependency, secret, or third-party execution changes.

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read: Root AGENTS.md and scoped src/gateway/AGENTS.md were read fully; the session-state compatibility and deep gateway review guidance apply to this PR. (AGENTS.md:10, 785ab7477982)
  • Patch scope: The PR diff adds alias helper code and only wires alias sync into migrateAndPruneGatewaySessionStoreKey, leaving sibling persisted mutation paths unchanged. (src/gateway/session-utils.ts:914, a46e3e5c68a4)
  • Proof ask expired: The PR has status: needs proof reapplied on 2026-06-15, a failed Real behavior proof check on 2026-06-15, no later head commit, and no supplied after-fix proof in the PR body or comments. (a46e3e5c68a4)
  • Current main canonicalizes raw keys: Current main still wraps opaque non-agent session keys into the agent-scoped namespace, which creates the raw/canonical identity pair involved in the linked bug. (src/gateway/session-store-key.ts:21, 785ab7477982)
  • Current main prunes noncanonical keys: Current main promotes the freshest candidate to the canonical key and prunes noncanonical store keys, so the underlying source-level split path is still real. (src/gateway/session-utils.ts:1133, 785ab7477982)
  • Sibling writers remain one-key: Session entry projection and lifecycle reset paths still write the selected primary/canonical key only, which is why migration-only alias sync is incomplete. (src/config/sessions/store.ts:1130, 785ab7477982)

Likely related people:

  • Sanjays2402: Current blame on the session-key and migration code points to the recent Discord voice sessionId reuse change, which touched the same session identity boundary. (role: recent adjacent contributor; confidence: medium; commits: 6cc534bbad7b; files: src/gateway/session-store-key.ts, src/gateway/session-utils.ts, src/config/sessions/store.ts)
  • steipete: Peter Steinberger merged the recent adjacent session identity PR and is the most visible current-main routing contact from the available history. (role: recent merger and likely routing owner; confidence: medium; commits: 6cc534bbad7b, 785ab7477982; files: src/gateway/session-store-key.ts, src/gateway/session-utils.ts)
  • stainlu: The broader open raw external alias PR supplies proof and coverage for the same root cause across gateway, compaction, resolver, and plugin host-hook writers. (role: likely follow-up owner; confidence: medium; commits: 1cde6d4a5d22; files: src/gateway/session-store-aliases.ts, src/gateway/session-utils.ts, src/plugins/host-hook-state.ts)

Codex review notes: model internal, reasoning high; reviewed against 785ab7477982.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@BingqingLyu

This comment was marked as spam.

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

@bladin thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: raw external session keys can still split after sessions_send / nested agent canonicalization

3 participants