Skip to content

Chat can return to the first message instead of the tail when switching back to a populated session #1437

Closed as not planned

Description

@shanselman

Summary

A new fixture-backed real-application smoke test intermittently catches a session-return scrolling failure in the production-shaped Release app. After selecting a 240-message session A, selecting session B, and returning to A, the selected conversation is correct but the viewport remains at messages 1-3 instead of the final message.

The screenshot confirms the failed visibility assertion. The exact cause is not established: investigate application scroll/lifecycle behavior and possible UI Automation timing effects before changing production code. Do not weaken the assertion or add a blind retry to obtain a green run.

Related: #1424 (Track WinUI ItemsView fix and retire Reactor preview.12 Markdown workaround) and #1426 (fix(chat): avoid session-switch crashes without clipping Markdown lists).

Reproduction

The new harness currently lives in the local feature/gateway-fixture-harness working tree and has not been published yet. Its files and proof are being handed to the fix agent separately. It launches the real application against an authenticated loopback WebSocket Gateway with synthetic data, not a mock chat provider. No real Gateway, WSL installation, provider, or AI call is required.

  1. Build an unpackaged Release app with DevBuild=false.
  2. Run scripts\test-gateway-fixture.ps1 -AppPath '<current Release OpenClaw.Tray.WinUI.exe>' -Configuration Release -Screenshots.
  3. In GatewayFixtureUiTests.SessionPickerSwitchesRealHistoriesAndShowsMessage240AtBothWidths, select Fixture: 240-message conversation through the actual composer session-picker flyout.
  4. Verify its final line, FIXTURE LONG END 240, is naturally visible before issuing any manual scroll command.
  5. Select Fixture: research conversation, verify that conversation's content, then select the long session again.
  6. On the failing repeat, the long conversation stays at its beginning for the 20-second visibility deadline.

Expected behavior

Returning to the long conversation after it was at the tail should show the actual final message, without requiring a manual scroll repair. Session identity, transcript content, and the user's intended scroll position must remain coherent. Preserve row-targeted navigation and virtualization; checking only the current scroll extent is insufficient.

Observed evidence

  • Screenshot shows the connected app, the long session selected, and FIXTURE LONG BEGIN: message 001. followed by messages 002 and 003. The final marker is not visible.
  • Gateway trace reports successful handshake, session/model/supporting reads, and successful chat.history for agent:main:main, agent:main:fixture-long, and agent:research:fixture-other. There are no unsupported requests in this run. The return to the long conversation uses already loaded history.
  • Latest Release smoke: 22/22 profile/app tests passed; 3/4 native UI tests passed; this natural-tail test failed. Earlier Release runs passed, so the failure is intermittent and earlier successes must not replace the failed result.
  • Latest Debug smoke passed 26/26. An earlier Debug run also became unresponsive while inspecting the long transcript; its cause is unconfirmed and may be separate. The harness now bounds UI tests and cleans up owned processes even when a synchronous UI Automation call stalls.
  • Required repository build, Shared tests (4,034 passed, 32 skipped), Tray tests (3,006 passed), and WinNode CLI tests (127 passed) passed.

Environment: Windows x64, .NET runtime 10.0.12, Windows App SDK 2.4.0, Reactor preview.12. The failing Release runtime configuration has System.Diagnostics.Debugger.IsSupported=false and no attached debugger.

Proof bundle identifiers for the coordinating maintainer/agent:

  • Failing run: 3270bac7f7854ca8a2737baec345be85, including failure.png, run.json, gateway-requests.jsonl, and the redacted app log.
  • Final Release TRX bundle: e5404722239f4afa961258b7b5582204.
  • Earlier Debug hang: ba6aa16080e340ab98bb98811d9821f6.

Artifacts are retained in the coordinating session and will be supplied to the fix session. These identifiers are not public download links.

Investigation boundaries

Start with the real session-selection path and ReactorItemsViewScrollController / InitialTailPositioner: request-key transitions, layout readiness, cached-session returns, and pending bring-into-view lifetime. Rule out test-driver side effects before assigning the cause.

Keep the fixture harness and the product fix in separate PR scopes. Add focused regression coverage, preserve normal scrolling and scroll-away behavior, and use the populated fixture for native runtime proof when safely available. Do not introduce extent-only scrolling, remove virtualization, replace the real provider, or weaken the 240-message test.

Isolation requirement

Do not use installed pairing data, existing Gateway credentials, or the default WSL distro. Fixture runs require owned profiles, ports and identities plus the explicit host-side-effect isolation guards. Do not launch a main-branch/older app with only OPENCLAW_TRAY_DATA_DIR: loopback WSL keepalive and OS registration paths are not fully isolated by that variable alone.

Activity

  1. added
    status: 🚢 actively landingA maintainer or agent is actively driving this item through implementation, validation, or merge.
    on Sep 17, 2026
  2. added
    P2Normal priority bug or improvement with limited blast radius.
    impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    on Sep 17, 2026
  3. clawsweeper commented on Sep 17, 2026

    @clawsweeper

    Codex review: this still needs some work. Reviewed September 22, 2026, 6:27 PM ET / 22:27 UTC.

    Summary
    Keep open: current main still documents this failure, and the paired investigation PR explicitly rejects its candidate after controlled testing. The merged fixture harness supplies reproduction infrastructure, not a scrolling fix.

    Reproducibility: yes. a concrete investigation path exists: the merged guarded Release fixture exercises A-to-B-to-A selection and natural message-240 visibility. Current-main failure was not reproduced in this read-only review, and the historical failure is intermittent.

    Root-cause cluster
    Relationship: canonical
    Canonical: #1437
    Summary: This issue owns the observed tail-restoration failure; the open paired PR remains an investigation, while merged harness and dependency work address separate boundaries.

    Members:

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

    Next step
    Continue through #1438 (fix(chat): restore the tail when switching conversations); the paired investigation and no-new-fix-pr label preclude a competing repair.

    Review details

    Best possible solution:

    Restore reliable row-targeted tail positioning across cached-session returns while preserving virtualization, streaming follow, and the reader's scroll-away position.

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

    Yes, a concrete investigation path exists: the merged guarded Release fixture exercises A-to-B-to-A selection and natural message-240 visibility. Current-main failure was not reproduced in this read-only review, and the historical failure is intermittent.

    Is this the best way to solve the issue?

    No, the existing candidate is not a verified solution: its controlled comparison worsened failures. Trace request, reconciliation, mount and disposal behavior before selecting another production change.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The native lifecycle cause and possible UI Automation timing contribution remain unresolved; historical failures have not been rerun against the current main revision.

    Codex review notes: model internal, reasoning medium; reviewed against c7063081a2a5.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P1: Preserves the September 22 human escalation for an unresolved native chat navigation failure that hides the latest messages on session return.
    • impact:ux-friction: The correct conversation loads, but users can be returned to its beginning instead of the recent messages.
    Evidence reviewed

    What I checked:

    Likely related people:

    • shanselman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • karkarl: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • bkudiess: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    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.
  4. added
    status: 🚢 actively landingA maintainer or agent is actively driving this item through implementation, validation, or merge.
    and removed
    status: 🚢 actively landingA maintainer or agent is actively driving this item through implementation, validation, or merge.
    on Sep 17, 2026
  5. added
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    on Sep 17, 2026
  6. added
    status: 🚢 actively landingA maintainer or agent is actively driving this item through implementation, validation, or merge.
    and removed
    status: 🚢 actively landingA maintainer or agent is actively driving this item through implementation, validation, or merge.
    on Sep 17, 2026
  7. added
    P1Urgent regression or broken agent/channel workflow affecting real users now.
    and removed
    P2Normal priority bug or improvement with limited blast radius.
    on Sep 22, 2026
  8. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.
    Please add updated OpenClaw Windows details or it will be closed.

  9. github-actions commented on Oct 15, 2026

    @github-actions
    Contributor

    Closing due to inactivity.
    If this still affects OpenClaw Windows, open a new issue with the current version, logs, and fresh reproduction details.

  10. locked as resolved and limited conversation to collaborators on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.stale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions