Skip to content

fix(new-workspace): search and offer Linear on the same host in Create worktree - #33270

Merged
nwparker merged 2 commits into
mainfrom
nwparker/linear-search-host-status
Oct 24, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/linear-search-host-status

Conversation

@nwparker

@nwparker nwparker commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​68 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​31 $\color{#cf222e}{\Huge{\mathbf{−}}}$​30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

Create worktree searches Linear on the machine the selected project lives on. It decided whether to offer the Linear tab by asking a different machine: the one focused in the app. If Linear was connected on your desktop but not on the paired server that holds the project, the tab appeared, and every search came back silently empty. The dialog now asks the same machine it searches.

What Changed

  • Before: with Linear connected only on the desktop, a project on a paired server showed a Linear tab whose searches always said "Start typing to search Linear issues." There was no error and no hint.
  • After: the Linear tab and the Linear workspace used for the search follow the project's own host. If that host has Linear, search works there. If it doesn't, the dialog doesn't offer a Linear search that can't return anything. That matches how saved task sources and Jira already behave.

Mechanism:

  • useWorkItemSourceFoundation reads the Linear connection for the repo-derived source through useLinearSourceConnection, which explicit sources already used, instead of the focused host's store status.
  • useLinearSourceConnection now keys its read by host, not by project. A re-read on the same host (repo switch, workspace change, reconnect) keeps the last status instead of briefly reading as "disconnected", so the tab and the chosen mode don't reset.
  • While the first status read is still pending, a chosen Linear tab stays selected, and a pasted Linear URL still blocks Enter so it isn't accepted as a plain name.

This covers Create worktree and the attach/edit workspace links search, which shares the hook.

Why

The search already ran on the right host (buildTaskSourceContextFromRepo uses the repo's execution host). Only the availability check was on the wrong host. Making both read the same host removes the split. The alternatives were:

ref-oss check: this needed three review rounds, so I compared how editors with per-host integrations model connection state. They keep the last known per-host state while re-checking, and treat "not known yet" as separate from "not connected". The final design does the same, so the approach didn't change; only the pending state got cleaner.

Linked Issue

Fixes #32924

Thanks to the reporter for the detailed trace through use-work-item-source-foundation.ts and the server-side linear_not_connected check.

Visual Proof

N/A: no new UI. The Linear tab now appears only when the searched host can answer, and that is checked by tests rather than a recording.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • New: "reads Linear on the selected repo's host, not the focused one ([Bug]: Create worktree Linear search silently returns nothing when the repo's host has no Linear connection #32924)". The focused host is connected, the repo's server is not; Linear must be read on the repo host and not offered. It fails on origin/main.

  • New: "holds a pasted Linear URL while the repo host's status is still loading". It fails without the presentation change.

  • New: "keeps the loaded status when the selected repo changes on the same host", plus a stale-while-revalidate assertion in the same-host workspace refresh test. Both fail without the hook change.

  • SmartWorkspaceSourceResultList.linear-read-error.test.tsx now stubs the repo host's status read that the credential-error flow depends on.

  • All of src/renderer/src/components/new-workspace/, sidebar/WorkspaceAttachment* and activity/ pass, single-worker (62 files, 494 tests).

  • The full local static job passes, except orcad-terminal-smoke. It ran only because the change-scope check couldn't read the dependency graph here, and it needs an out/mobile-web build. This PR touches only renderer new-workspace files.

  • Not verified live: a paired server without Linear. The behavior is covered by the hook tests above.

Review

Focus: use-linear-source-connection.ts (the per-host, stale-while-revalidate state) and the linearStatusPending mode retention in use-smart-workspace-field-availability.ts.

Known P3 follow-ups:

  • After a reconnect, the previous status (and workspace id) is used until the re-read lands.
  • A disabled field holding a Linear URL stays aria-busy.
  • There is no hint when Linear is hidden because the searched host isn't connected.

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

  • Local, SSH and WSL repos read local Linear status, the same target their search uses. Paired-server repos, including SSH behind a server, read on that server.
  • Folder workspaces are text-only in Create worktree and are unaffected.
  • Mixed versions: no new RPCs. An old server that fails linear.status reads as disconnected, which matches what its search would return.
  • Performance: one status read per host per dialog, not per project.

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)

Create worktree searched Linear on the selected repo's host but offered the
Linear tab from the focused host's status. With Linear connected only on the
desktop and a project on a paired server, the tab appeared and every search
silently came back empty. The repo-derived Linear source now reads its own
host's status, as explicit sources already did, so the tab and the selected
workspace follow the host that will answer.
…d treat loading as unknown

The host status read is keyed by host, not project scope, and a same-host
re-read (repo switch, workspace change, reconnect) keeps the last status
instead of reading as disconnected, so the Linear tab and the chosen mode no
longer reset. While the first read is pending, a chosen Linear tab stays
selected and a pasted Linear URL keeps blocking Enter. The credential-error
test now stubs the repo host's status read it depends on.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 9a926462-b9f8-44f2-8283-91d6fa1f18d3
Commits

Reviewing files that changed from the base of the PR and between 2c500bf and 46b359e.

Files selected for processing: 7
  • src/renderer/src/components/new-workspace/SmartWorkspaceSourceResultList.linear-read-error.test.tsx
  • src/renderer/src/components/new-workspace/use-linear-source-connection.test.tsx
  • src/renderer/src/components/new-workspace/use-linear-source-connection.ts
  • src/renderer/src/components/new-workspace/use-smart-workspace-field-availability.ts
  • src/renderer/src/components/new-workspace/use-smart-workspace-name-field-foundation.source.test.tsx
  • src/renderer/src/components/new-workspace/use-work-item-source-foundation.ts
  • src/renderer/src/components/new-workspace/use-work-item-source-presentation.ts
  • 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
nwparker merged commit c197b9f into main Oct 24, 2026
32 checks passed
nwparker added a commit to SimonSQLML/orca that referenced this pull request Oct 27, 2026
Since stablyai#33270, Create worktree reads Linear status from the repo's host
(linear:status IPC) instead of the store, so the store-only fixture left
Linear disconnected in the composer and the pasted URL was never looked up.
Stub the linear:status handler with the same connected status.
nwparker added a commit that referenced this pull request Oct 27, 2026
…hanges (#30115)

* test(e2e): repair specs that missed intentional product changes

Align still-stale e2e expectations with shipped product behavior:
- the Cmd+J placeholder names workspaces and tasks
- the worktree meta dialog is titled "Workspace details"
- OS-opened CSV/TSV files are editable and render as an ARIA grid
- the delayed-save notice carries the app toaster's close button

Fixes #30114

Co-authored-by: Neil <neil@stably.ai>

* test(e2e): stub host Linear status in linear-url-workspace-entry spec

Since #33270, Create worktree reads Linear status from the repo's host
(linear:status IPC) instead of the store, so the store-only fixture left
Linear disconnected in the composer and the pasted URL was never looked up.
Stub the linear:status handler with the same connected status.

---------

Co-authored-by: Neil <neil@stably.ai>
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]: Create worktree Linear search silently returns nothing when the repo's host has no Linear connection

1 participant