Skip to content

fix(sidebar): place a runtime-stamped project group on its own host - #24363

Closed
innocarpe wants to merge 3 commits into
stablyai:mainfrom
innocarpe:fix-13944-project-group-host
Closed

innocarpe wants to merge 3 commits into
stablyai:mainfrom
innocarpe:fix-13944-project-group-host

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Description

A project group that belongs to one Orca server was rendered under whichever server was focused. Runtime-owned groups usually carry executionHostId and no SSH connectionId. The sidebar filter already treated that stamp as the group's host, but placement did not, so the group (and its folder workspaces) jumped to the focused server.

Focused fix

In:

  • Folder-workspace placement now uses the same host resolver as the visibility filter, including a connectionless executionHostId.
  • A repo-less project-group header with an explicit runtime stamp or SSH connection is placed on that host.

Out:

  • Creating a project group on a chosen server.
  • Host filters, reveal, and pinned-folder features.

Preserves

Ungrouped, All, and Pinned headers, and any project group with neither stamp, stay in the pending buffer and are still copied onto each following host run. A header that already has a repo still follows that repo's host. SSH folder workspaces still follow their connection.

Evidence

node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts --cache false src/renderer/src/components/sidebar/host-section-rows.runtime-group.test.ts src/renderer/src/components/sidebar/host-section-rows.test.ts

The new file pins three cases: a connectionless runtime group stays on its owner while another server is focused, a connectionless folder workspace follows that stamp, and an unstamped group header stays buffered across host runs. The existing host-section tests still pass.

User-regression-tradeoffs

A runtime-stamped group no longer follows the focused server. That is the reported bug. Groups with no host stamp keep the previous shared-header behavior.

Fixes #13944

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes how project groups are assigned to host sections in the sidebar.

The PR appears safe to merge; no new actionable issue or outstanding finding remains.

Summary

The PR places runtime-stamped project-group headers and their folder workspaces under their owning host while preserving shared-header behavior for unstamped groups. Two added tests cover the filtered and unfiltered project views.

Reviews (2) · Last reviewed commit: "test(sidebar): cover a runtime project g..."

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Header rows now resolve project-group hosts using runtime stamps or connection IDs. Tests cover stamped and unstamped group placement across host runs, folder workspaces under the stamped host, and the unfiltered projects view without host headers.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to 5dcc3

A project-group path can be missing for a repository shown under another server. The affected case is narrow, but preserving the header path should be addressed before merge or accepted as a follow-up.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the bug, scope, behavior, linked issue, and test command. However, it does not follow the repository template and omits required sections or information, including ELI5, What … Update the description to use the required template. Add the missing sections and complete the required checkboxes. For Visual Proof, attach before-and-after evidence or write N/A with a reason if there is no visual or interaction change.
Docstring Coverage Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: placing runtime-stamped project groups on their owning host.
Linked Issues check Passed Issue #13944 requires host placement for runtime-owned project groups and their folder workspaces. At the reviewed head, getHeaderHostId assigns a repo-less group with executionHostId or `connecti…
Out of Scope Changes check Passed The changes stay within issue #13944. They update sidebar host placement and add focused automated tests. The reviewed diff contains no group-creation, host-filter, reveal, or pinned-folder feature ch…
Full details: Linked Issues check

Explanation

Issue #13944 requires host placement for runtime-owned project groups and their folder workspaces. At the reviewed head, getHeaderHostId assigns a repo-less group with executionHostId or connectionId through getProjectGroupExecutionHostIdForRows. getFolderWorkspaceHostId delegates to the shared folder resolver, which honors the group executionHostId before SSH or focused-host fallback. The added tests cover connectionless stamped groups, folder workspaces, and unstamped headers.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #13944. They update sidebar host placement and add focused automated tests. The reviewed diff contains no group-creation, host-filter, reveal, or pinned-folder feature changes.

Full details: Description check

Explanation

The description explains the bug, scope, behavior, linked issue, and test command. However, it does not follow the repository template and omits required sections or information, including ELI5, What Changed, Why, Visual Proof or N/A, Testing checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Update the description to use the required template. Add the missing sections and complete the required checkboxes. For Visual Proof, attach before-and-after evidence or write N/A with a reason if there is no visual or interaction change.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Folder-workspace placement now matches the visibility filter. getFolderWorkspaceHostId (src/renderer/src/components/sidebar/folder-workspace-host-id.ts) delegates to getFolderWorkspaceExecutionHostIdForRows, so an executionHostId-first stamp (including a connectionless runtime stamp) decides the section instead of falling back to the focused host.
  • Repo-less project-group headers get a host. New getHeaderHostId (src/renderer/src/components/sidebar/host-section-rows.ts) places a group header with an explicit runtime/SSH stamp on its owner host, while Ungrouped, All, Pinned, and groups with neither stamp stay pending-buffered (return null); repo headers still resolve through getRepoHostId.
  • Regression tests added. host-section-rows.runtime-group.test.ts pins three cases with exact row arrays; all three fail against the pre-fix buffering path, so they are real coverage rather than theatre.
  • Scope is broader than the title. project-group-catalog.ts stamps every fetched group via projectGroupWithFetchedOwner (local → local, SSH → ssh:<conn>, runtime → runtime:<env>), so in practice nearly every group header becomes host-owned now, not only runtime-stamped ones. The direction is correct — a local group no longer duplicates under remote host sections — and the unstamped branch is reserved for synthetic/transient groups.

Verification: the four host-section/filter files pass (33 tests), the broader folder-workspace/reveal/host-label/grouping set passes (71 tests), the full src/renderer/src/components/sidebar suite passes (2698 tests), tsc -p config/tsconfig.tc.web.json is clean, and check-changed-code-quality.mjs reports 0 new findings.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@innocarpe
innocarpe force-pushed the fix-13944-project-group-host branch from 82741b4 to af9ecb1 Compare October 1, 2026 13:08
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (af9ecb1a32)

The runtime-group cases now call host sectioning the way the sidebar does. An explicit two-host filter still places the stamped group under its owner, and the unfiltered projects view leaves those rows without host headers.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

This run re-reviewed the incremental delta on the PR branch (test-only changes since the prior pullfrog review; production resolver code is unchanged).

  • Added renderedHostFilter test helper matching the production call. It passes visibleWorkspaceHostIds and preferProjectGrouping: true, mirroring use-section-rows.ts:220, so the new cases exercise the path the sidebar actually uses rather than the bare resolver.
  • Added a filtered-both-hosts placement case. Confirms a connectionless runtime-stamped group stays under its owner host when both hosts are visible. This is real coverage: with getHeaderHostId reverted, the unbuffered group duplicates under every host run, so the assertion fails against the pre-fix code.
  • Added an unfiltered-projects-view case. Confirms host headers are not inserted when preferProjectGrouping is set and no host filter is active — it exercises the early pass-through return at host-section-rows.ts:205-211. This one is a guard, not bug coverage (it passes before and after the fix).

This directly addresses the prior greptile review thread on the test helper; that thread is now resolved. The new test file passes (5/5) and pnpm tc:web is clean.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

innocarpe and others added 3 commits October 22, 2026 12:36
A connectionless executionHostId is the group's host. Placement still
fell back to the focused server, so the group moved when focus changed.
Visibility already honored the stamp.

Fixes stablyai#13944
The host-section cases skipped the project-grouping flags the sidebar passes, so they could pass without the filtered view placing the group under its owner.

Co-authored-by: Cursor <[email protected]>
addHostSectionRows now requires localHostLabel. The rebased cases omitted it.
@innocarpe
innocarpe force-pushed the fix-13944-project-group-host branch from af9ecb1 to 5dcc390 Compare October 22, 2026 03:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c039c48-a102-43da-b67a-77238be47c0c
📥 Commits

Reviewing files that changed from the base of the PR and between af9ecb1a32c329c42d012d58f38b73d2d6d4cbc3 and 5dcc390.

📒 Files selected for processing: 2
  • src/renderer/src/components/sidebar/host-section-rows.runtime-group.test.ts
  • src/shared/sidebar-list/host-section-rows.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

if (!normalizeExecutionHostId(projectGroup.executionHostId) && !projectGroup.connectionId) {
return null
}
return getProjectGroupExecutionHostIdForRows(projectGroup, defaultHostId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -o pipefail
printf '%s\n' '--- host-section-rows.ts relevant definitions ---'
nl -ba src/shared/sidebar-list/host-section-rows.ts | sed -n '1,150p;220,340p'
printf '%s\n' '--- project-group-sections.ts relevant definitions ---'
nl -ba src/shared/sidebar-list/project-group-sections.ts | sed -n '1,155p'
printf '%s\n' '--- focused tests and usages ---'
rg -n -F --glob '*.ts' -e 'addHostSectionRows' -e 'getHeaderHostId' -e 'runtime group' -e 'executionHostId' src/shared/sidebar-list src/renderer/src/components/sidebar || test "$?" -eq 1
printf '%s\n' '--- current diff against requested base ---'
git diff --stat 8ba1c9ba09b1a8e4488f67412c6b9eccce2c690b 5dcc390f28653d69f43e87e07f4b8a6f37a35008 -- src/shared/sidebar-list/host-section-rows.ts src/shared/sidebar-list/project-group-sections.ts src/renderer/src/components/sidebar
git diff 8ba1c9ba09b1a8e4488f67412c6b9eccce2c690b 5dcc390f28653d69f43e87e07f4b8a6f37a35008 -- src/shared/sidebar-list/host-section-rows.ts src/shared/sidebar-list/project-group-sections.ts src/renderer/src/components/sidebar

Repository: stablyai/orca

Length of output: 41462


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- host-section-rows.ts middle and helpers ---'
nl -ba src/shared/sidebar-list/host-section-rows.ts | sed -n '140,285p'
printf '%s\n' '--- row types and host-filtering helpers ---'
nl -ba src/shared/sidebar-list/row-types.ts | sed -n '1,240p'
nl -ba src/shared/sidebar-list/host-filtering.ts | sed -n '1,180p'
printf '%s\n' '--- header cloning/localization references ---'
rg -n -F --glob '*.ts' -e 'localizePendingRowsForHost' -e 'hostWorktreeCounts' -e 'hostWorktreeIds' -e '...pending' src/shared/sidebar-list src/renderer/src/components/sidebar || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 20804


Keep the owner header and copy it only for foreign descendants.

A shared projectGroupId can place a repository descendant under a different host. The current host-owned header is not copied to that host, so the descendant loses its project-group path.

Keep the stamped header assigned to its owner. During host sectioning, emit a host-local copy only for each distinct foreign host that has a descendant in that group's path. Do not make the original header unconditionally pending or return null for every host: if the owner has no descendant, pending-header handling can consume the header under another host and leave the owner section without it.

@nwparker

Copy link
Copy Markdown
Contributor

Thank you @innocarpe for working on this. We looked at it closely, and current main already places runtime-stamped folder rows by their host (folder-workspace-host-id.ts), with group headers following their members. With this change, a local group that holds SSH repos showed an extra empty Local section, so we're closing it rather than merging. Thanks again for digging into the sidebar's host placement. The investigation helped confirm the fix.

@nwparker nwparker closed this Oct 26, 2026
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.

Projects sidebar: project group renders under whichever Orca server is focused, not its own host section

2 participants