Skip to content

[Bug]: Remote Windows host can disappear while smart sort repeatedly refreshes it #8272

Closed

Description

@bbingz

Operating system

macOS client connected to a Windows 11 Orca server.

Orca version

v1.4.135 on both hosts.

Details

Short summary

A newly paired Windows runtime can appear in the macOS All hosts sidebar for a few seconds and then lose its host section even though the runtime remains connected and continues returning the same repositories and worktrees. When Smart ordering is active, the macOS renderer can also enter a repeated sort-order persistence/refresh cycle and consume more than one CPU core.

This report is intentionally sanitized: network addresses, usernames, hostnames, repository paths/names, runtime/device IDs, and screenshots have been omitted.

Reproduction

  1. Run Orca on a macOS client and a Windows 11 server using the same release.
  2. Pair the Windows server from the macOS sidebar.
  3. Keep All hosts and Smart workspace ordering enabled, with at least one live terminal session.
  4. Observe that the Windows host section initially appears with its workspaces, then can disappear or be regrouped under the local host.
  5. Observe repeated remote catalog refreshes and sustained renderer CPU usage.

Expected

  • A reachable registered host remains represented by its own workspace rows.
  • Concurrent local and runtime catalog refreshes preserve rows owned by the other host.
  • Persisting an unchanged Smart order does not trigger an endless refresh/persist cycle.

Actual

  • The runtime stays registered and reachable; authenticated RPCs continue succeeding.
  • Repeated repo.list calls return the same non-empty catalog, and worktree.list remains stable.
  • The client/server WebSocket remains established.
  • The Windows profile's sortOrder values are rewritten approximately every 3–5 seconds while the macOS renderer remains busy.

Root-cause evidence

Two related paths are involved:

  1. In v1.4.135, fetchRepos() and fetchRuntimeEnvironmentRepos() both merge a fetched host catalog against get().repos captured before their await, then replace the full repos array. A late local fetch can therefore overwrite runtime rows that a faster runtime fetch just added. A deterministic store-level reproduction produces [remote] after the runtime fetch and [local] after the late local fetch.
  2. Smart ordering persists every newly allocated sortedIds array to the owner host. The runtime rewrites each sortOrder with Date.now() and emits reposChanged; the client refreshes repos/worktrees, treats the new sortOrder as a worktree change, increments sortEpoch, recomputes sortedIds after the settle delay, and persists again.

Current main already merges fetched repo catalogs inside set(state) against the latest state.repos as part of 25ecf2eea, which structurally addresses the stale catalog overwrite. It does not currently have a regression test for the local-vs-runtime overlap, and the unchanged-order Smart persistence loop remains.

Acceptance criteria

  • Add a regression test where a runtime catalog resolves before an older local catalog and both hosts remain in state.
  • Make repeated persistence of the same per-host workspace order a no-op and avoid emitting another broad refresh event.
  • Preserve persistence and notification when the effective order actually changes.
  • Cover macOS-client/Windows-server behavior without platform-specific path assumptions.

Activity

  1. added theissue type on Jul 12, 2026
  2. added
    pending_reproRepro attempted; still pending conclusive reproduction
    on Jul 16, 2026
  3. OrcaWin commented on Jul 17, 2026

    @OrcaWin
    Collaborator

    Agent reproduction package (Windows orchestration 2026-07-16)

    Host context: Windows 11 / Orca 1.4.143.0 / repo path used: docs/bug-reproductions/
    Labels applied: see issue labels (has_repro or cannot_repro).
    Security: Do not run user-uploaded binaries from issue attachments. Recreate fixtures from the steps/scripts below.


    Issue 8272 — Remote Windows host disappears during smart sort

    Status: needs_setup
    Host: Windows 11 only (no macOS client)
    Label: none

    Summary

    Reporter (macOS client ↔ Windows 11 Orca server): newly paired Windows host appears briefly under All hosts, then host section vanishes / regroups under local host while Smart ordering is on; renderer CPU high; sortOrder rewritten every 3–5s.

    Environment gates (this host)

    Need Present
    macOS Orca client No
    Paired Windows remote runtime as server for a second client No environments paired
    Two-host All hosts + Smart sort Not exercisable

    Source notes (main)

    Reporter already identified:

    1. Stale catalog merge: late local fetchRepos overwriting runtime rows (addressed structurally by merging inside set(state) / mergeFetchedRepoCatalog — see src/renderer/src/store/slices/repos.ts, tests under repos-all-hosts*.ts, repos-stale-fetch.test.ts)
    2. Smart sort persistence loop: unchanged order still rewritten with Date.now(), emitting refresh cycles

    Renderer unit tests that would cover (1) failed to load in this environment (Cannot find package '@/i18n/i18n' when running vitest on those files without full web config) — not a product cannot_repro.

    Repro needs (another agent)

    1. macOS client + Windows 11 server, same Orca version.
    2. Pair Windows from macOS sidebar; All hosts + Smart ordering; live terminal.
    3. Observe host section flicker/disappear and CPU.
    4. Optional store-level race: runtime catalog resolves before late local catalog.

    Evidence

    • docs/bug-reproductions/issues/8272.json
    • orca environment list empty on this host
    • Code pointers: repos.ts mergeFetchedRepoCatalog / fetchRuntimeEnvironmentRepos

    Why blocked

    Requires dual-machine macOS↔Windows pairing topology; this host is Windows-only with no remote environments.


    How another agent should use this

    1. Read this comment fully (status, expected vs actual, blockers).
    2. If a script is included above, copy it to a temp file and run it on a Windows 11 host with Orca installed (prefer production install under %LOCALAPPDATA%\Programs\orca).
    3. Capture evidence (CLI --json, screenshots, logs) under a local folder; optionally comment results back here.
    4. If status is cannot_repro / needs_setup, satisfy the listed prerequisites first, then re-attempt and flip labels: remove cannot_repro, add has_repro when conclusive.
  4. nwparker commented on Aug 31, 2026

    @nwparker
    Contributor

    Resolved by merged PR #13662 (commit 84bd306), which avoids no-op worktree sort writes and prevents the disappearing-host refresh loop. Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingos:Windowspending_reproRepro attempted; still pending conclusive reproduction

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions