Skip to content

🤖 fix: stop the previous workspace's queued message and questions staying on screen after a switch - #7716

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/fix-queued-message-workspace-switch
Oct 29, 2026
Merged

ibetitsmike merged 5 commits into
mainfrom
mike/fix-queued-message-workspace-switch

Conversation

@ibetitsmike

Copy link
Copy Markdown
Contributor

Summary

Switching workspaces left the previous workspace's composer decorations on screen: its queued message, its docked ask_user_question forms, and other notices above the composer (for example a "Handoff target" line repeated once per leaked copy). This PR gives WaitingOnYouProvider a key of its own, so React stops leaking those copies.

Background

#7687 wrapped the composer decoration stack in <WaitingOnYouProvider key={props.workspaceId}>. In the same fragment, ChatInput already had key={props.workspaceId}. Two siblings with the same key are unsupported in React. It logs "Encountered two children with the same key", and when the key changes it does not always delete the old subtree. In a real browser, switching A -> B -> A -> B left several ChatInputDecorationStack nodes in one composer dock, so B showed A's queued message.

Implementation

The provider's key is now waiting-on-you:${workspaceId}. It still remounts per workspace, and its key no longer collides with ChatInput's. ChatInput's key is unchanged.

Validation

  • New UI test tests/ui/chat/workspaceSwitchDecorations.test.ts: it queues a message in A behind a held turn and switches A -> B -> A -> B. It then checks that B shows no queued banner, A still shows its own, the dock has one decoration stack, and React logged no duplicate-key error. With the old key restored the test fails on the duplicate-key check. In happy-dom the DOM leak itself does not show, so that check is the one that catches the regression.
  • Reproduced and verified by hand in Chromium against a mock-AI dev server. Before the fix: 3 decoration stacks and A's queued message on B. After: 1 stack, and B is clean on every switch.
  • Remote dogfood UAT passed against the pushed SHA, with a pre-fix control run that reproduced the leak.
  • Polish and the test audit only touched files in the implementation diff (the new test file). No new dependencies.

Risks

Low. The change is one key string. The decoration stack still remounts on every workspace switch, as before.

WaitingOnYouProvider and ChatInput were same-keyed siblings, so React left
the previous workspace's decoration stack (queued message, questions) in the
composer dock after a workspace switch. Give the provider a distinct key.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T01:00:42.098948Z d3f2a99 Manual request
🔒 Security Review ✅ Completed 2026-10-29T01:01:27.745736Z d3f2a99 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: ea081682ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: ea081682ba

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

22 agent steps · 7 replayed from cache · 15 model calls · 46.3k tokens (24% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 5.8s
🟢 a chat survives a restart of the server 1 step · 1 call 5.8s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.7s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.7s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 9.3s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 9.3s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 8.8s
🟢 a chat survives trips through Settings 2 steps · 1 call 8.8s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.2s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.2s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.5s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.5s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 7.1s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 7.1s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 3.4s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 3.4s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 22.7s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 4.3s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.0s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.5s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.0s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.9s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 2.9s

e2e 0.20.0 · 1m 12s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 8.0k tokens (22% cached)
Spend: $0.02 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 6.2s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 6.2s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 5.9s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 5.9s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 6.4s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 6.4s

e2e 0.20.0 · 20.7s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.4s · 2 targets (web, phone) · run artifacts

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: d3f2a997a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: d3f2a997a8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ibetitsmike
ibetitsmike added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 6b425f5 Oct 29, 2026
33 of 34 checks passed
@ibetitsmike
ibetitsmike deleted the mike/fix-queued-message-workspace-switch branch October 29, 2026 01:21
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