Skip to content

Keep Direct Chat controls scoped to the selected session - #928

Closed
Y1fe1Zh0u wants to merge 1 commit into
dataelement:mainfrom
Y1fe1Zh0u:agent/fix-direct-chat-session-isolation
Closed

Keep Direct Chat controls scoped to the selected session#928
Y1fe1Zh0u wants to merge 1 commit into
dataelement:mainfrom
Y1fe1Zh0u:agent/fix-direct-chat-session-isolation

Conversation

@Y1fe1Zh0u

Copy link
Copy Markdown
Collaborator

What changed

  • Project Direct Chat runtime controls through the currently selected Session.
  • Prevent delayed sends from a background Session from mutating the visible composer or message list.
  • Add regression coverage for Session-scoped controls and delayed WebSocket sends.

Why

When one Session was still running, switching to another Session could retain the first Session's blocked-input state and stop button. The component had both per-Session runtime caches and a component-wide activeRun, so stale or delayed state could leak across the selection boundary.

After this change, background Sessions continue running, but only the selected Agent/Session pair may update the visible chat controls.

Validation

  • cd frontend && npm test — 90 passed
  • cd frontend && npm run build — passed
  • git diff --check — passed

Not tested

  • Live backend-connected multi-Session browser flow

Direct Chat kept both per-session runtime caches and component-wide active
state. Project controls through the selected session identity and keep delayed
background sends from mutating the visible conversation.

Constraint: Preserve background Session execution and WebSocket delivery
Rejected: Close the previous Session socket on navigation | long-running Sessions must continue after the user switches away
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Never let background Session events update the visible composer without matching Agent and Session identities
Tested: Frontend node tests 90 passed; TypeScript and Vite production build passed
Not-tested: Live backend-connected multi-Session browser flow
@Y1fe1Zh0u

Copy link
Copy Markdown
Collaborator Author

Superseded by #929 using an upstream-head branch so Drone can read the commit tree. The code commit is identical: e00b05e.

@Y1fe1Zh0u

Copy link
Copy Markdown
Collaborator Author

Closing the fork-head PR after replacing it with #929; build 485 failed only because Drone could not read the fork commit tree.

@Y1fe1Zh0u Y1fe1Zh0u closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant