fix(console): freeze session identity for chat sends - #7237
Open
zhijianma wants to merge 6 commits into
Open
Conversation
zhijianma
requested a deployment
to
ai-review-approved
August 24, 2026 06:08 — with
GitHub Actions
Waiting
|
Hi @zhijianma, this is your 198th Pull Request. 🙌 Join Developer CommunityThanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page: We truly appreciate your enthusiasm—and look forward to your future contributions! 😊 We'll review your PR soon. |
zhijianma
requested a deployment
to
ai-review-approved
August 24, 2026 07:17 — with
GitHub Actions
Waiting
zhijianma
requested a deployment
to
ai-review-approved
August 24, 2026 08:37 — with
GitHub Actions
Waiting
zhijianma
requested a deployment
to
ai-review-approved
August 24, 2026 09:29 — with
GitHub Actions
Waiting
This was referenced Aug 24, 2026
zhijianma
requested a deployment
to
ai-review-approved
August 24, 2026 10:00 — with
GitHub Actions
Waiting
Member
Author
|
Follow-up |
zhijianma
requested a deployment
to
ai-review-approved
August 24, 2026 10:04 — with
GitHub Actions
Waiting
zhijianma
force-pushed
the
fix/console-session-send-race
branch
from
August 24, 2026 10:17
499c947 to
f4dcdad
Compare
zhijianma
requested a deployment
to
ai-review-approved
August 24, 2026 10:17 — with
GitHub Actions
Waiting
zhijianma
marked this pull request as ready for review
August 24, 2026 10:19
zhijianma
requested a deployment
to
ai-review-approved
August 25, 2026 10:17 — with
GitHub Actions
Waiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fix Console session-identity races that could route a queued message or a stop/cancel action to a different conversation when users switch sessions, pages, agents, or browser tabs while another turn is running.
The root cause was that request identity was reconstructed at send time from mutable shared state (
window.currentSessionId,lastActiveChatId, and the current session list). A late session load, agent switch, queue drain, or another tab could overwrite that state between enqueue and submission.This PR:
{ agent_id, chat_id, sdk_session_id, session_id, user_id, channel }snapshot inbiz_paramsfor every submission and queued item;window.currentSessionId/currentUserId/currentChannelidentity globals;new:${agentId}, so one agent cannot migrate another agent's pending messages;Issues
Closes #7231
Closes #7011
Closes #3254
Type of Change
Component(s) Affected
Security Considerations
No authentication or authorization contract changes. The change strengthens identity isolation by preventing queued requests from combining one agent's identity with another session and by refusing to expose a host/PawApp session outside the active PawApp namespace.
Testing
Focused regression coverage includes:
new:${agentId}isolation across agents;Checklist
pre-commit run --all-fileslocally and it passespytestor as relevant) and they passEvidence
The build reports the repository's existing dynamic-import and large-chunk warnings; all build verification steps pass.
Additional Notes
Legacy persisted queue entries are intentionally discarded rather than migrated because the old records do not contain the immutable
bizParamsidentity required for a safe retry.