Skip to content

fix(agents): serialize new-session resolution per session key#85404

Closed
openperf wants to merge 1 commit into
openclaw:mainfrom
openperf:fix/openai-compat-session-key-serialization-84575
Closed

fix(agents): serialize new-session resolution per session key#85404
openperf wants to merge 1 commit into
openclaw:mainfrom
openperf:fix/openai-compat-session-key-serialization-84575

Conversation

@openperf

@openperf openperf commented May 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Problem: Issue [Bug] /v1/chat/completions: second request with same x-openclaw-session-key during in-flight turn runs in isolated session, loses memory scope #84575 reports that two requests carrying the same x-openclaw-session-key at the OpenAI-compatible endpoints (/v1/chat/completions, /v1/responses) can run in separate sessions when the second arrives while the first is still in flight (e.g. a follow-up message sent before the first turn finishes). The later request starts from an empty session — session_status reports Context: 0/... and memory tools (memory_search) return nothing — so the agent loses all conversation/recall scope for that turn. Multi-user / multi-tab setups and any client that fires a quick follow-up before the previous turn finishes are exposed. Reporter juergenvh added gateway-side evidence on 2026-05-21 confirming the same shape against an embedded runtime.
  • Root Cause: Session identity is resolved by resolveSession (src/agents/command/session.ts) before the per-session execution lane is entered. When a session key has no fresh stored entry, resolveSession mints a brand-new sessionId via crypto.randomUUID(). Two commands for the same key that both reach this point before either persists the key→sessionId mapping each mint their own id. The per-session execution lane is keyed by session key, but it only serializes execution, not identity — so the second command runs against a different transcript and an empty memory scope. The WebChat chat.send path already guards concurrent sends; the agent-command path used by the OpenAI-compatible endpoints had no equivalent, leaving the resolve-then-mint step racy. resolveSession is intentionally synchronous (used by many sync callers), so the lock has to live one layer up at the agent-command async caller.
  • Fix: Add resolveSessionWithReservation (src/agents/command/session-resolution-reservation.ts) and call it from the agent-command pipeline (src/agents/agent-command.ts) in place of resolveSession. It serializes only the brand-new-session path, per session key: the first command persists the key→sessionId mapping inside a short critical section; any concurrent command re-resolves inside the lock, sees the reserved entry, and adopts the same sessionId instead of forking. This enforces the invariant "same session key ⇒ one session id" at the layer that owns session identity (so all ingress surfaces routed through agent-command benefit, not just one endpoint). Established sessions and explicit-sessionId runs skip the lock entirely (no added latency on the steady-state hot path); the critical section is independent of the per-session execution lane and completes before execution, so it cannot deadlock with it; the reserved entry is the same minimal mapping the command already persists moments later, so no new orphaning behavior; and internal handoffs (sessionEffects === "internal") also bypass the lock so they never write a visible store row, preserving the suppressVisibleSessionEffects contract.
  • What changed:
    • src/agents/command/session-resolution-reservation.ts: new resolveSessionWithReservation helper plus a per-session-key serialization queue. ResolveSessionInput declares clone?: boolean (forwarded to resolveSession) and suppressVisibleSessionEffects?: boolean (internal-handoff opt-out).
    • src/agents/command/session-resolution-reservation.test.ts: regression coverage — pre-fix race repro, concurrent-same-key convergence, follow-up reuse, explicit-sessionId passthrough, and the internal-handoff no-visible-row contract.
    • src/agents/agent-command.ts: resolve through resolveSessionWithReservation (one-line replace at prepareAgentCommandExecution); pass clone: false and suppressVisibleSessionEffects: opts.sessionEffects === "internal".
  • What did NOT change (scope boundary):
    • resolveSession semantics, the per-session execution lane, and the session-store schema are untouched. The helper composes existing primitives (resolveSession + persistSessionEntry) inside a per-key async mutex.
    • The explicit-sessionId path, ordinary single requests, established (already-persisted, fresh) sessions, and internal handoffs all bypass the reservation lock entirely.
    • Other prepareAgentCommandExecution regions touched by sibling PRs [Fix] Deliver restart recovery replies #86089 / fix(agents): persist user turn before attempt failures #86764 are in different regions of the function; this PR rebases cleanly on current origin/main with zero conflicts.
    • No config keys, gateway protocol, streaming/delivery behavior, plugin SDK, or session-store schema change.
    • No CHANGELOG.md edit (release-owned); no package.json / lockfile / shrinkwrap edit (Dependency Guard not applicable).

Reproduction

  1. Configure an agent reachable through the OpenAI-compatible endpoint with a stable x-openclaw-session-key.
  2. Send a long, multi-tool request for that session key.
  3. While it is still streaming, send a second request with the same x-openclaw-session-key.
  • Before: the second turn runs in an isolated session (session_status shows Context: 0/...); it has no recall of the in-flight conversation. On-disk session store ends up with two agent:main:<key> entries pointing at different sessionIds, and the sessions directory has two transcript files.
  • After: both turns share one session — the second adopts the first request's sessionId and retains conversation/recall scope. On-disk session store has a single agent:main:<key> entry; the sessions directory has exactly one transcript file.

Real behavior proof

  • Behavior addressed: concurrent commands carrying the same x-openclaw-session-key must converge on one sessionId and one transcript; once the first command persists the key→sessionId mapping, any concurrent same-key command re-resolves inside the lock and adopts the same id instead of forking an isolated, memory-less session.
  • Real environment tested: Linux x64, Node 22.22, OpenClaw Gateway built from this branch serving POST /v1/chat/completions, routed to a local OpenAI-compatible model endpoint with an isolated on-disk session store. Real curl requests, real on-disk session-store JSON, real session transcript files.
  • Exact steps or command run after this patch: launched openclaw gateway run (this branch) bound to the OpenAI-compatible endpoints; fired two concurrent curl calls to /v1/chat/completions carrying an identical x-openclaw-session-key: final-1779465436; inspected the on-disk session store and the per-session transcript files. Unit-level regression: node scripts/run-vitest.mjs src/agents/command/session-resolution-reservation.test.ts.
  • Evidence after fix (verbatim live console output):
two concurrent requests, identical x-openclaw-session-key=final-1779465436 (23:57:16 start -> 23:57:32 done)
$ curl .../v1/chat/completions -H 'x-openclaw-session-key: final-1779465436' -d '{"model":"openclaw","messages":[{"role":"user","content":"first turn"}]}' &
$ curl .../v1/chat/completions -H 'x-openclaw-session-key: final-1779465436' -d '{"model":"openclaw","messages":[{"role":"user","content":"second turn concurrent"}]}' &
A: {"id":"chatcmpl_189760ea-7315-4873-a704-bd3bc6b51fa7", ... "choices":[{"message":{"role":"assistant","content":"ok"},"finish_reason":"stop"}]}
B: {"id":"chatcmpl_9408b3a5-f114-45ba-aa49-f8d5e8ff3940", ... "choices":[{"message":{"role":"assistant","content":"ok"},"finish_reason":"stop"}]}

resolved session for that key (single store entry, single id):
agent:main:final-1779465436 -> sessionId bc472c1b-9cbb-4a8e-b337-51a53d3e2aef

session transcripts for that id (exactly one, so no fork):
bc472c1b-9cbb-4a8e-b337-51a53d3e2aef.jsonl
  • Observed result after fix: two distinct concurrent runs against one session key converged on one sessionId and one transcript file — the second request joined the in-flight session instead of forking an isolated, memory-less one. The on-disk session store recorded a single reservation-shaped entry { sessionId, updatedAt, sessionStartedAt } written by resolveSessionWithReservation. The explicit-sessionId path and steady-state established-session path are visibly unchanged (no lock entered).
  • Code-path coverage: node scripts/run-vitest.mjs src/agents/command/session-resolution-reservation.test.ts (10 passed across 2 files) covers the pre-fix race repro (two resolveSession calls fork distinct sessionIds), concurrent same-key convergence, follow-up reuse of the reserved id, explicit-sessionId passthrough, and the new internal-handoff contract (suppressVisibleSessionEffects: true does not write a visible session-store row).
  • What was not tested: a multi-hour production deployment and a third-party hosted model provider were not exercised; the live run used a local OpenAI-compatible model endpoint and an isolated session store. Cross-PR merge order with [Fix] Deliver restart recovery replies #86089 / fix(agents): persist user turn before attempt failures #86764 was not simulated end-to-end, but the branch rebases cleanly on current origin/main with zero conflicts.

Risk / Mitigation

  • Risk: per-key serialization could add latency or deadlock with the per-session execution lane. Mitigation: only the brand-new-session path takes the lock; established sessions, explicit-sessionId runs, and internal handoffs bypass it, so the steady-state hot path is unchanged. The critical section is resolveSession (sync) + one store write and completes before the execution lane is entered, so it cannot deadlock with it.
  • Risk: an early-reserved entry could orphan if the run aborts immediately after reservation. Mitigation: the reserved entry is the same minimal sessionId mapping the command persists moments later anyway; the orphan window matches the pre-fix crypto.randomUUID() + persistSessionEntry window — no new orphaning shape.
  • Risk: cross-PR conflict with [Fix] Deliver restart recovery replies #86089 (restart recovery) and fix(agents): persist user turn before attempt failures #86764 (persist user turn) inside prepareAgentCommandExecution. Mitigation: codegraph reports function-level overlap; actual diff regions do not collide. This PR rebases cleanly onto current origin/main (zero conflict). Merge order is independent.
  • Risk: ClawSweeper's prior P1 blockers — (1) ResolveSessionInput omitted clone, which the call site still passes; (2) reservation wrote a visible session-store row before agentCommandInternal derived suppressVisibleSessionEffects from opts.sessionEffects === "internal", breaking the documented internal-handoff contract. Mitigation: both addressed — clone?: boolean added to ResolveSessionInput and forwarded to resolveSession; suppressVisibleSessionEffects?: boolean added and short-circuits the lock+persist for internal runs; the call site computes the flag inline from opts.sessionEffects; a new test asserts internal handoffs do not write a visible row.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Gateway / orchestration
  • Sessions / storage

Linked Issue/PR

Fixes #84575

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 6:21 AM ET / 10:21 UTC.

Summary
The PR adds a per-session-key reservation wrapper for agent-command session resolution, wires it into prepareAgentCommandExecution, and adds regression tests for concurrent same-key session convergence.

PR surface: Source +109, Tests +147. Total +256 across 3 files.

Reproducibility: yes. Current main still resolves and mints a session UUID before any reservation step, and two first-use same-key callers can each hit that path before a session entry exists; I did not rerun the live two-request HTTP race in this read-only pass.

Review metrics: 1 noteworthy metric.

  • Pre-execution session-store writes: 1 added. The new reservation helper writes the key-to-session mapping before attempt execution, which is the central session-state timing change maintainers should notice.

Stored data model
Persistent data-model change detected: persistent cache schema: src/agents/command/session-resolution-reservation.test.ts, serialized state: src/agents/command/session-resolution-reservation.test.ts, serialized state: src/agents/command/session-resolution-reservation.ts, unknown-data-model-change: src/agents/command/session-resolution-reservation.test.ts, unknown-data-model-change: src/agents/command/session-resolution-reservation.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #84575
Summary: This PR is the open candidate fix for the canonical OpenAI-compatible same-session-key identity race.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] The PR intentionally writes a minimal session mapping before execution for brand-new keyed sessions; that appears correct for identity convergence, but it changes session-state timing for first-use sessions.
  • [P1] The adjacent open PR at fix(agents): persist user turn before attempt failures #86764 also changes prepareAgentCommandExecution; whichever PR lands second should be refreshed and rechecked against the final merged session persistence flow.

Maintainer options:

  1. Confirm Final Session Semantics (recommended)
    Before merge, review the final merged prepareAgentCommandExecution path and rerun the focused reservation test so the reservation, internal-handoff bypass, and rebind-adoption invariants still hold.
  2. Refresh After Adjacent PR
    If fix(agents): persist user turn before attempt failures #86764 lands first, rebase this branch and repeat the focused reservation validation before merging.
  3. Pause For Wider Identity Design
    Pause only if maintainers decide first-use session identity should be redesigned more broadly instead of fixed with this narrow reservation wrapper.

Next step before merge

  • [P2] No narrow automated repair blocker remains; the next action is maintainer merge judgment for session-state timing and composition with adjacent agent-command PRs.

Security
Cleared: The diff adds in-process session reservation code and focused tests only; no dependency, workflow, secret, auth, package, or external code-execution change was found.

Review details

Best possible solution:

Land this PR after maintainer session-state composition review confirms the final merged agent-command path preserves reservation, internal-handoff bypass, and concurrent-rebind adoption; then close #84575.

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

Yes. Current main still resolves and mints a session UUID before any reservation step, and two first-use same-key callers can each hit that path before a session entry exists; I did not rerun the live two-request HTTP race in this read-only pass.

Is this the best way to solve the issue?

Yes. The shared agent-command session identity boundary is the narrowest maintainable fix because it covers both OpenAI-compatible ingress paths without pushing queuing into every client, while bypassing established sessions, explicit session ids, and internal handoffs.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded but user-visible session-continuity bug fix for OpenAI-compatible agent-command ingress.
  • merge-risk: 🚨 session-state: The diff changes when same-key session mappings are persisted, which can affect transcript and memory association for a logical session.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from real curl requests through /v1/chat/completions, plus on-disk session-store and transcript inspection for the changed behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from real curl requests through /v1/chat/completions, plus on-disk session-store and transcript inspection for the changed behavior.
Evidence reviewed

PR surface:

Source +109, Tests +147. Total +256 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 111 2 +109
Tests 1 147 0 +147
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 258 2 +256

What I checked:

  • Repository policy read: Root and scoped agents policy were read and applied; the relevant guidance requires reading beyond the diff and treating session-state timing as merge-sensitive. (AGENTS.md:1, e9720c27fa69)
  • Live PR state: Live GitHub data shows the PR is open, cleanly mergeable, authored by a repository member, and not present on current main. (30a2edfd5cb6)
  • Current main source: Current main still resolves session identity by calling resolveSession directly before execution setup can serialize the first-use same-key path. (src/agents/agent-command.ts:718, e9720c27fa69)
  • Source-level race: When no fresh stored entry or explicit session id exists, resolveSession falls through to crypto.randomUUID(), so concurrent first-use same-key callers can mint distinct session ids before persistence. (src/agents/command/session.ts:402, e9720c27fa69)
  • Endpoint path: The OpenAI-compatible chat handler passes the resolved session key into the shared agent-command path, and the docs define x-openclaw-session-key as explicit session routing. (src/gateway/openai-http.ts:1067, e9720c27fa69)
  • Responses path: The OpenResponses path derives stable user-based session keys and forwards them through runResponsesAgentCommand into agentCommandFromIngress. (src/gateway/openresponses-http.ts:666, e9720c27fa69)

Likely related people:

  • openperf: The PR head implements the reservation helper and prior merged same-area commits under the openperf handle touched agent-command/session behavior. (role: current candidate fix author and prior affected-path contributor; confidence: high; commits: 30a2edfd5cb6, 17f086c02180, 2c8c4e45f185; files: src/agents/agent-command.ts, src/agents/command/session-resolution-reservation.ts, src/agents/command/session-resolution-reservation.test.ts)
  • vincentkoc: Blame for the current direct resolveSession call and UUID fallback points to a recent commit carrying these affected files on main. (role: recent current-main affected-path contributor; confidence: medium; commits: 2ad2e4f2dc6c; files: src/agents/agent-command.ts, src/agents/command/session.ts)
  • osolmaz: Live PR metadata shows this PR is assigned to osolmaz, making them the current routing contact even though the code history is shared. (role: assigned follow-up reviewer; confidence: medium; files: src/agents/agent-command.ts, src/agents/command/session.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Clockwork Shellbean

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: sleeps inside passing CI.
Image traits: location proof lagoon; accessory tiny test log scroll; palette cobalt, lime, and pearl; mood mischievous; pose peeking out from the egg shell; shell smooth pearl shell; lighting subtle sparkle highlights; background soft code-shaped tiles.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Clockwork Shellbean in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. proof: supplied External PR includes structured after-fix real behavior proof. labels May 22, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 22, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 22, 2026
@openperf
openperf force-pushed the fix/openai-compat-session-key-serialization-84575 branch from 3d89040 to 5d6b9ca Compare May 22, 2026 16:50
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 22, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 22, 2026
@openperf
openperf force-pushed the fix/openai-compat-session-key-serialization-84575 branch from 5d6b9ca to 8fde49f Compare May 23, 2026 00:54
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 23, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 23, 2026
@osolmaz osolmaz self-assigned this May 28, 2026
@BingqingLyu

This comment was marked as spam.

@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@openperf
openperf force-pushed the fix/openai-compat-session-key-serialization-84575 branch from 8fde49f to 005ffbb Compare May 29, 2026 06:29
@clawsweeper clawsweeper Bot removed the status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. label May 29, 2026
@openperf
openperf force-pushed the fix/openai-compat-session-key-serialization-84575 branch from 60bce25 to 573096e Compare May 29, 2026 13:17
@openperf
openperf force-pushed the fix/openai-compat-session-key-serialization-84575 branch from 573096e to 3b1a3b2 Compare May 29, 2026 13:59
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 15, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 19, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
Concurrent commands for the same session key minted separate sessionIds
because resolveSession ran before the per-session execution lane, so a
second OpenAI-compatible request that arrived mid-turn forked an isolated,
memory-less session. Reserve the brand-new-session path per session key so
concurrent commands adopt one sessionId.

Fixes openclaw#84575
@openperf
openperf force-pushed the fix/openai-compat-session-key-serialization-84575 branch from 3b1a3b2 to 30a2edf Compare June 19, 2026 23:52
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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

Labels

agents Agent runtime and tooling merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] /v1/chat/completions: second request with same x-openclaw-session-key during in-flight turn runs in isolated session, loses memory scope

4 participants