Skip to content

Bug: Windows companion app may create a new fork instead of reusing the existing session #952

Closed as not planned

Description

@karkarl

Summary

The Windows companion app appears to sometimes create a new forked session instead of attaching to / reusing the existing session.

Expected

Opening or continuing a session reuses the existing session. Forking only happens on explicit user action.

Actual

A new fork may be created in place of the existing session (session-resolution path picks/creates a new session).

Next steps

  • Reproduce and capture the conditions that trigger the unwanted fork.
  • Root-cause the session-resolution / attach path.

Acceptance criteria

  • Continuing an existing session reuses it (no unintended fork).
  • Forking occurs only when the user explicitly requests it.

Context

Surfaced during chat-session review (2026-07-08).

Activity

  1. clawsweeper commented on Jul 9, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 1, 2026, 6:19 AM ET / 10:19 UTC.

    Summary
    Keep open. Current main now remembers a materialized selected session, restores it when available, and limits companion-side session creation to the explicit /new lifecycle command, but the report has no current-main trace that identifies how an unintended fork still occurs. The existing duplicate-title work addressed the confusing symptom, not session creation itself.

    Likely related people: Caleb Eden (high confidence) introduced the current lifecycle-command path; Karen (medium confidence) recently migrated the chat surface that consumes the selection state.

    Reproducibility: no. Current source shows reuse-oriented selection and explicit /new creation, but the issue provides no current-main steps, session keys, gateway trace, or timing sequence that produces an unintended fork.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    A maintainer or reporter should provide one current-main unintended-fork trace before a repair worker chooses a session-resolution boundary.

    Review details

    Best possible solution:

    Capture one current-main sequence showing the selected session key before and after the unexpected fork, then add a regression test at the proven selection or lifecycle boundary while preserving explicit /new creation.

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

    No. Current source shows reuse-oriented selection and explicit /new creation, but the issue provides no current-main steps, session keys, gateway trace, or timing sequence that produces an unintended fork.

    Is this the best way to solve the issue?

    Unclear. The requested invariant is correct, but the safest repair boundary cannot be selected until evidence distinguishes a companion selection race from gateway-side session creation.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Without a current-main trace, changing selection logic could regress the deliberate /new child-session workflow while missing a gateway-side or timing-specific trigger.

    Codex review notes: model internal, reasoning high; reviewed against 8ac00c5f4977.

    Label changes

    Label justifications:

    • P2: An unintended session fork is a normal-priority companion-chat defect with a bounded but currently unverified blast radius.
    • impact:session-state: The report concerns selecting or creating the wrong conversation session.
    • impact:ux-friction: Duplicate or unexpected conversations make continuation confusing, but the report does not establish a fully blocked user journey.
    Evidence reviewed

    What I checked:

    Likely related people:

    • Caleb Eden: Local history attributes the native Windows chat lifecycle-command introduction to this contributor; that path owns the only companion-side session-create call site found in current source. (role: introduced current lifecycle-command behavior; confidence: high; commits: 2fb1da26c175; files: src/OpenClaw.Tray.WinUI/Chat/ChatLifecycleCommandDispatcher.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs)
    • Karen: Local history shows the recent Reactor migration of the chat surface, which renders the provider's selected-thread and pending-selection state. (role: recent chat-surface contributor; confidence: medium; commits: 9acafa606a4d; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatRoot.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs)
    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.
  2. added
    P2
    impact:session-state
    impact:ux-friction
    issue-rating: 🦪 silver shellfish
    clawsweeper:needs-info
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    on Jul 9, 2026
  3. moved this from Backlog to UX in Windows Companion Appon Jul 13, 2026
  4. github-actions commented on Jul 25, 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.

  5. added
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    and removed
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-info
    on Jul 30, 2026
  6. added
    issue-rating: 🦐 gold shrimp
    clawsweeper:needs-info
    and removed
    issue-rating: 🦪 silver shellfish
    on Jul 31, 2026
  7. clawsweeper commented on Aug 1, 2026

    @clawsweeper

    ClawSweeper status: review started.

    I am starting a fresh review of this issue: Bug: Windows companion app may create a new fork instead of reusing the existing session This is item 1/1 in the current shard. Shard 0/1.

    This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

    Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

  8. bkudiess commented on Aug 2, 2026

    @bkudiess
    Collaborator

    Thanks for flagging this. We traced current main and the July session-selection code but could not reproduce an implicit fork.

    Opening, selecting, reconnecting, and restoring a remembered session do not call sessions.create; the composer also waits for the authoritative session list before sending. The current explicit creation path is /new, which was added after this report. We also confirmed that the older keyless-event issue was timeline misrouting rather than server-side session creation.

    The report does not include the versions, exact actions, session keys, or request trace needed to identify a failing transition, so a code change would be speculative and could alter the intentional /new behavior. We’re closing this as not reproducible.

    If this still occurs on a current build, please open a new report with the Companion and Gateway versions, local/WSL/remote topology, exact actions, selected session key before and after, resulting session key/session ID/parent session key, whether reconnect occurred, and the outbound RPC method (chat.send, sessions.create, or sessions.compaction.branch). A redacted request/response trace is sufficient; do not include chat content or credentials.

  9. locked as resolved and limited conversation to collaborators on Aug 5, 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

    P2clawsweeper:needs-infoclawsweeper:needs-maintainer-reviewclawsweeper:no-new-fix-primpact:session-stateimpact:ux-frictionissue-rating: 🦐 gold shrimp

    Type

    No type

    Fields

    Priority

    Medium

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions