Skip to content

Fix V2 New chat carrying over a busy conversation's state - #1620

Merged
Paul Lizer (paullizer) merged 3 commits into
paullizer-react-v2-uifrom
paullizer-v2-new-chat-reset
Oct 2, 2026
Merged

Paul Lizer (paullizer) merged 3 commits into
paullizer-react-v2-uifrom
paullizer-v2-new-chat-reset

Conversation

@paullizer

@paullizer Paul Lizer (paullizer) commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In V2, clicking New chat while chat orchestration was planning or running did not give a clean conversation. The new chat kept the old turn's Thinking bubble and a Stop button that did nothing. It never showed its empty state and wouldn't send until the page was reloaded. V1 always starts a fresh conversation.

  • Stuck streaming state: an orchestration turn sets the chat store's streaming flag but has no chat-stream controller, so detachActiveStream() never clears it. settleOrchestrationTurn doesn't clear it either once the conversation is off screen. chatStore now tracks which conversations have an orchestration turn showing as in progress. New chat clears streaming and messagesLoading. Opening a conversation shows Thinking and Stop again only if its own turn is still running in this tab.
  • First-message race: a counter that advances whenever New chat starts or a conversation opens now guards the step where a first message takes over the new chat. The guard applies in sendMessage, generateImageFromReference and orchestration ensureConversation. Clicking New chat while a first message is still creating its conversation keeps the new chat empty. The message is still sent and saved in its own conversation, which appears in the rail.
  • Hand-offs: workspace Chat on selected documents or a tag, and Start chatting on the home page, now start a brand-new conversation instead of reopening the last one. The documents or tag arrive as context chips.
  • Unchanged on purpose:
    • Leaving a busy conversation still detaches rather than cancels, and only Stop cancels. The previous answer keeps generating and is saved.
    • Unsent composer text and chips survive New chat.
    • The rail's Chats link still returns to a reply that is streaming.

Worth a careful look: if you reopen a conversation whose orchestration turn is still running, Thinking and Stop come back and later reasoning steps appear as usual. Steps that arrived while you were away are not replayed into the live bubble. The plan card and step progress are unaffected.

Linked issue

Fixes #1617

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only (0.261.225 -> 0.261.226)
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

The latest paullizer-react-v2-ui (through #1612) has been merged in. The base had already used 0.261.218 through 0.261.225, so this fix was renumbered to 0.261.226.

  • config.py: set to the next free version.
  • release_notes.md: every base section is kept as-is, including the base's own v0.261.218 entry, and this fix's entry sits in a new v0.261.226 section at the top.
  • Test headers, the minimum version in test_v2_new_chat_reset.py, the fix doc, the feature doc and the guide now say 0.261.226.

Testing / validation

On the merged head:

  • npm run typecheck in application/v2_ui: passed.
  • npm --prefix .\application\v2_ui run build -- --outDir ..\..\ui_tests\artifacts\orchestration-plan-editor and npm --prefix .\application\v2_ui run build: passed.
  • One combined python -m pytest run over 13 UI test files: 212 passed, 112 errors.
    • The 212 passed across 10 files: test_v2_new_chat_reset.py, test_v2_orchestration_planning_retry.py, test_v2_chat_context_selection.py, test_v2_orchestration_streaming_bubble.py, the base's new test_v2_inline_maps.py, test_v2_orchestration_plan_editor.py, test_v2_orchestration_recovery.py, test_v2_orchestration_dependency_plans.py, test_v2_orchestration_workflow_proposal_card.py and test_v2_elicitation_composer.py.
    • The 112 errors were every test in the 3 remaining suites, which check for the default SPA build. They error only when collected in one process with the other Playwright suites, as they also did before the merge. Each passes in its own process:
      • python -m pytest .\ui_tests\test_v2_reasoning_controls.py -q: 33 passed.
      • python -m pytest .\ui_tests\test_v2_orchestration_approval_persistence.py -q: 23 passed.
      • python -m pytest .\ui_tests\test_v2_prompt_composer_experience.py -q: 56 passed.
    • In total, 324 browser tests pass.
  • python -m pytest test_v2_new_chat_reset.py test_v2_stream_leave_without_cancel.py test_v2_new_chat_scoping.py test_v2_chat_context_picker.py test_v2_conversation_deep_link.py test_v2_inline_maps.py test_v2_inline_media_players.py test_v2_rich_rendering.py test_v2_enhanced_citations.py -q (run in functional_tests): 79 passed, 2 failed.
    • Both failures were already failing before this PR and are unrelated: test_v2_chat_context_picker.py::test_the_composer_no_longer_carries_a_write_only_selection and test_v2_conversation_deep_link.py::test_incoming_link_is_captured_before_any_effect_runs. They cover Composer.tsx and ChatPage.tsx, which neither this PR nor the merged base touches.
  • python .\functional_tests\test_v2_new_chat_reset.py: 6/6 passed.
  • python .\functional_tests\test_docs_app_surface_coverage.py: 7/7 passed. python .\functional_tests\test_docs_site_quality.py: 6/6 passed.
  • python .\functional_tests\test_docs_release_notes_integrity.py: 0/1, failed. This was already failing before this PR because the generated release-notes pages are stale. The base also added its v0.261.218 to v0.261.224 sections without regenerating them, so about 131 earlier versions are now stale.

Before the merge:

  • With only the application/v2_ui/src changes stashed, python -m pytest .\ui_tests\test_v2_new_chat_reset.py -q gave 6 failed, 1 passed. The plain chat-stream case already worked and is kept as a regression guard. The 3 updated tests in test_v2_orchestration_planning_retry.py and test_v2_chat_context_selection.py also fail with the source changes stashed.
  • Broad V2 UI regression sweep: 446 passed across 22 files with python -m pytest .\ui_tests\<file> -q. A further 39/39 passed across 7 suites run directly with python .\ui_tests\<file>, as those files' headers direct. Per-file results are below.
  • Not run because of local environment problems:
    • ui_tests/test_chat_saved_analysis.py: pyOpenSSL/cryptography import error during test collection.
    • ui_tests/test_v2_orchestration_plan_editor_backend.py and ui_tests/test_v2_orchestration_recovery_backend.py: ModuleNotFoundError: No module named 'content_screening'.

The pytest runs also passed -p no:cacheprovider and a -W ignore warning filter.

Pre-merge UI regression sweep per file

python -m pytest .\ui_tests\<file> -q, all passed:

File Passed
test_v2_orchestration_actions.py 16
test_v2_orchestration_approval_persistence.py 23
test_v2_orchestration_auto_open.py 5
test_v2_orchestration_conversation_context.py 5
test_v2_orchestration_dependency_plans.py 32
test_v2_orchestration_generated_images.py 3
test_v2_orchestration_model_picker.py 11
test_v2_orchestration_outputs.py 68
test_v2_orchestration_plan_editor.py 35
test_v2_orchestration_planning_retry.py 15
test_v2_orchestration_recovery.py 32
test_v2_orchestration_streaming_bubble.py 3
test_v2_orchestration_workflow_proposal_card.py 22
test_v2_orchestration_workflow_results_input.py 5
test_v2_orchestration_workflow_run_floor.py 9
test_v2_orchestration_workflow_run_links.py 29
test_v2_group_participant_invites.py 7
test_v2_elicitation_composer.py 18
test_v2_reasoning_controls.py 33
test_v2_prompt_composer_experience.py 56
test_v2_chat_image_uploads.py 15
test_v2_image_reference_generation.py 4

python .\ui_tests\<file>, all passed:

File Result
test_v2_orchestration_composer.py 6/6
test_v2_orchestration_drawer_views.py 3/3
test_v2_orchestration_elicitation.py 6/6
test_v2_orchestration_pending_approval_resume.py 5/5
test_v2_orchestration_plan_card.py 7/7
test_v2_orchestration_plan_editing.py 5/5
test_v2_orchestration_run_hydration.py 7/7

Documentation

  • Release notes updated, or not needed (Bug Fixes entry under v0.261.226)
  • Feature documentation updated, or not needed (chat hand-off section of V2_GROUP_DOCUMENT_BROWSING.md, and docs/guides/manage-group-workspaces.md)
  • Fix documentation updated, or not needed (docs/explanation/fixes/V2_NEW_CHAT_RESET_FIX.md)

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security()) (N/A: no routes added or changed)
  • Settings sent to non-admin frontends use sanitize_settings_for_user() (N/A: no settings payloads changed)
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS (no new browser assets)
  • No secrets, keys, connection strings, or local-only artifacts are included (build outputs and the test harness bundle are git-ignored)

Paul Lizer (paullizer) and others added 3 commits October 2, 2026 17:19
Clicking New chat while chat orchestration was planning or running kept
the old turn's Thinking bubble and a Stop button that did nothing. The
empty state never appeared and sending stayed blocked until a reload.
Orchestration turns hold the chat store's streaming flag without the
chat-stream controller that detachActiveStream clears, and their settle
is skipped once the conversation is off screen.

- Track each conversation's orchestration streaming surface. New chat
  clears streaming and messagesLoading, and opening a conversation
  restores Thinking and Stop only for a turn still running there.
- Guard the first-message conversation claim (sendMessage,
  generateImageFromReference, ensureConversation) with a conversation
  epoch, so a New chat clicked during creation keeps its empty chat.
- Workspace Chat on documents or tags, and Home's Start chatting, now
  start a brand-new conversation.
- Add UI and functional regression tests, refresh stale New chat and
  Stop source pins, and add a fix doc, guide wording and release notes.
  Bump the version to 0.261.218.

Fixes #1617

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Brings in the 17 commits that landed on the V2 branch since this branch
was cut (inline media and maps, GPT-6 catalog fixes, workflow background
identity and others).

The base already used 0.261.218 through 0.261.225, so the two conflicts
are version collisions:
- application/single_app/config.py: VERSION set to 0.261.226, the next
  free version after the base's 0.261.225.
- docs/explanation/release_notes.md: every base section is kept as-is,
  including its own v0.261.218 entry, and this branch's New chat entry
  moves to a new v0.261.226 section at the top.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The merged base already used 0.261.218, so this fix now ships as
0.261.226. Its version references in tests and docs follow: test
headers, the functional test's minimum version, the fix doc (including
its config.py row, now 0.261.225 -> 0.261.226), the group documents
feature doc and the group workspaces guide.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit 1524eeb into paullizer-react-v2-ui Oct 2, 2026
10 checks passed
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Oct 2, 2026
Merged with rerere disabled. microsoft#1620 also moved V2 to 0.261.226, the number
this branch had just taken, so config.py merged without a conflict (both
sides made the same VERSION change); the next commit renumbers this branch
to 0.261.227.

docs/explanation/release_notes.md conflicted because both sides added a
0.261.226 section at the top. This branch's section stays on top, then
microsoft#1620's section under its own heading, unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Oct 2, 2026
microsoft#1620 moved V2 to 0.261.226 while this branch held it, so this branch takes
the next version. Mechanical change only: the same 51 lines in 21 files
that the previous renumber touched. V2's own 0.261.226 lines from microsoft#1620 are
unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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