Skip to content

fix: avoid duplicate automations in web client - #32758

Closed
Pr1p wants to merge 1 commit into
stablyai:mainfrom
Pr1p:codex/fix-web-automation-duplicate-authority
Closed

Pr1p wants to merge 1 commit into
stablyai:mainfrom
Pr1p:codex/fix-web-automation-duplicate-authority

Conversation

@Pr1p

@Pr1p Pr1p commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

ELI5

The web page was asking the same Orca server for automations twice: once through a pretend local connection and once through its paired server connection. It now asks once, so each automation appears once.

What Changed

Before, the web client projected both a Desktop authority and its paired runtime authority. In a browser, both paths use the same paired runtime transport, so the Automations page listed the same scheduler-owned records twice.

Now the web client projects only its paired runtime authority. Desktop Electron clients still project the Desktop authority plus every saved runtime, so records with equal IDs on genuinely different authorities remain distinct. Regression coverage verifies the web client does not issue the redundant local authority list request.

Why

Removing duplicates after listing would hide legitimate records from different hosts and would still make two requests. Selecting the correct authority before the catalog is scheduled fixes both the rendered duplicate and the redundant request while preserving normal multi-host behavior.

Linked Issue

Fixes #32415

Visual Proof

N/A — this is authority catalog and request-routing behavior without a stable visual change to capture; automated regression tests verify the single runtime projection and the absence of the redundant local request.

Testing

  • vitest run src/renderer/src/components/automations/automation-host-catalog.test.ts src/renderer/src/components/automations/use-automation-host-catalog.test.tsx src/renderer/src/components/automations/automation-create-destination.test.ts --config config/vitest.config.ts --reporter=dot

  • pnpm tc:web

  • pnpm run check:code-quality:changed

  • Verified on Windows. The change is transport-agnostic and does not alter SSH or platform path handling.

  • I manually tested these changes locally

  • Automated tests added/updated

AI Disclosure

GPT-5 Codex assisted with investigation, implementation, and verification; the change was reviewed before submission.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: no new permissions, inputs, or network endpoints. Cross-platform: the behavior is selected by the existing web-client marker and does not use platform-specific paths or shortcuts. SSH/remote: remote runtime records remain authority-scoped. Mobile: no mobile code changes. Backwards compatibility: the Desktop catalog is unchanged; web clients retain their paired runtime entry. Performance: removes one redundant authority query and row group.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1aeb7092-292b-4fb2-8e82-1b0d40f7400e
📥 Commits

Reviewing files that changed from the base of the PR and between a4a0e60 and 1409b5f.

📒 Files selected for processing: 5
  • src/renderer/src/components/automations/automation-host-catalog-types.ts
  • src/renderer/src/components/automations/automation-host-catalog.test.ts
  • src/renderer/src/components/automations/automation-host-catalog.ts
  • src/renderer/src/components/automations/use-automation-host-catalog.test.tsx
  • src/renderer/src/components/automations/use-automation-host-catalog.ts

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

📝 Walkthrough

The automation host catalog now supports excluding the desktop authority. The hook excludes it for web clients and retains it for other clients. Tests check that a web client uses the paired runtime authority for automation listing and that the catalog contains the runtime’s Self entry.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 1409b

Web clients should show automations through their paired server without duplicate local rows. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing duplicate automation entries in the web client.
Description check Passed The description covers the required sections, explains the user-facing behavior and implementation, links issue #32415, documents testing and scope considerations, and marks visual proof as not applic…
Linked Issues check Passed The PR addresses [#32415]. useAutomationHostCatalog excludes the desktop authority when isWebClientLocation() is true. The web catalog therefore contains only the paired runtime authority. The reg…
Out of Scope Changes check Passed The changes stay within [#32415]. They add the authority-selection option, apply it only to web catalog construction, update hydration state for the omitted desktop authority, and add focused regressi…
Full details: Description check

Explanation

The description covers the required sections, explains the user-facing behavior and implementation, links issue #32415, documents testing and scope considerations, and marks visual proof as not applicable. The unchecked full validation commands are noted as CI coverage or pending, but this does not make the description incomplete.

Full details: Linked Issues check

Explanation

The PR addresses [#32415]. useAutomationHostCatalog excludes the desktop authority when isWebClientLocation() is true. The web catalog therefore contains only the paired runtime authority. The regression test verifies one runtime entry, calls automation.list on the runtime target, and does not call the desktop scoped-list transport. Desktop clients retain the existing authority projection because the catalog includes the desktop authority by default.

Full details: Out of Scope Changes check

Explanation

The changes stay within [#32415]. They add the authority-selection option, apply it only to web catalog construction, update hydration state for the omitted desktop authority, and add focused regression coverage. No unrelated feature, transport, platform-path, or permission changes are shown.

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

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.

@nwparker

Copy link
Copy Markdown
Contributor

Thank you @Pr1p for digging into this and for the clear write-up! Your diagnosis was exactly right: on a web client the "local" host and the paired server are the same runtime, so the Desktop entry shouldn't be listed separately. We shipped the fix in #33019, built on that same idea and with you as co-author on every commit. We moved the check onto the existing paired-web-client helper and covered a few spots that still pointed at Desktop: a saved "Local" host filter, workspace run links, and the default create host. Closing this in favour of #33019. Really appreciate the contribution!

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

[Bug]: Automations on a headless orca serve host are listed twice in the web client (Local Linux + Orca Server)

2 participants