Commit Graph
6085 Commits
Author SHA1 Message Date
Jinwoo HongandOrca bc84f4b04b Speed up startup with deferred remote catalogs (#7087)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 15:15:15 -07:00
github-actions[bot] 014fd3cf26 release: v1.4.126-rc.0 v1.4.126-rc.0 2026-07-06 22:14:09 +00:00
Brennan BensonandOrca 16439fd499 perf(ai-vault): extend incremental transcript parsing to all append-only JSONL agents (STA-1417) (#7593)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 15:13:00 -07:00
Jinwoo HongandOrca 417723411e perf(source-control): stop gh rate-limit storms and idle git-status spawn churn (#7595)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 15:12:56 -07:00
Jinwoo Hong 377bde351c Bridge WSL Codex sessions into runtime home (#7477) 2026-07-06 15:11:48 -07:00
Brennan BensonandOrca 6aed5c1122 Gate the Gemini GPU fallback on pane-owner evidence instead of raw title text (title evidence plan, PR 1) (#7458)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 15:01:06 -07:00
Dzmitry Bachko 47feae3fb3 fix(settings): portal the IDE Font dropdown outside the settings section
Fixes #7585
2026-07-06 13:46:50 -07:00
NeilandOrca 63384d0497 perf(renderer): gate the jump palette's status-map subscriptions while closed (#7558)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 13:31:08 -07:00
github-actions[bot] 28495f6036 release: v1.4.125 v1.4.125 2026-07-06 20:25:41 +00:00
github-actions[bot] d8ed41f74c release: v1.4.125-rc.2 v1.4.125-rc.2 2026-07-06 18:27:45 +00:00
Brennan BensonandOrca 34a254956e perf(ai-vault): reuse and incrementally parse session transcripts across scans (STA-1278) (#7525)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 11:09:44 -07:00
github-actions[bot] 883b56be6e release: v1.4.125-rc.1 v1.4.125-rc.1 2026-07-06 17:50:35 +00:00
github-actions[bot] 057db5b287 release: v1.4.125-rc.0 v1.4.125-rc.0 2026-07-06 17:14:30 +00:00
Brennan BensonandOrca fbaf3f7d81 Stop terminal flicker during active Claude Code sessions (#7540)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 10:11:27 -07:00
Rod Boev 4f284652c8 fix(orchestration): stop coordinator message auto-submit (#7391) 2026-07-06 10:05:03 -07:00
Trevin ChowandJinjing cd3d0e99db fix: add view file action to file context menu
* fix: add view file context menu action

* Address PR review feedback (#4620)

- Localize the View File context menu label

- Update file explorer virtual row test fixture

* test: cover view file context menu visibility

---------

Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
2026-07-06 10:03:43 -07:00
github-actions[bot] 9d9ebe69af Update README downloads badge 2026-07-06 13:32:45 +00:00
NeilandOrca b41cab1a9e fix(renderer): raise renderer V8 heap toward the 4GB pointer-compression cage (#7531)
* fix(renderer): raise renderer V8 heap toward the 4GB pointer-compression cage

Renderer OOM ('renderer crashed'/'oom', exit 5 / 0xE0000008 / SIGTRAP) is the
dominant crash in the crash channel: the renderer JS heap reaches Chromium's
default V8 old-space ceiling (~RAM/4) and V8 aborts. Two adversarial leak hunts
(13 agents across every renderer subsystem) found no unbounded GB-scale leak, so
this is a capacity ceiling, not a leak.

Chromium sizes the renderer heap at ~RAM/4, leaving 8-15GB machines well under
V8's ~4GB pointer-compression cage (an 8GB machine caps near 2.2GB). Reclaim that
unused headroom via --max-old-space-size in a focused startup module, gated on
physical RAM (>=8GB, ~40% of RAM, floor 3072MB, capped at the real 4096MB cage).
16GB+ machines are already at the cage so this is a no-op for them; low-RAM
machines keep the default to avoid trading a clean OOM for OS memory-pressure
kills.

Overridable with ORCA_RENDERER_HEAP_MB (number to force, default/off/0 to opt
out). Verified on Electron 42.3.3: the main-process js-flags switch propagates to
the renderer V8 and is honored up to the 4096MB cage (5000/12288 -> 4096).

Co-authored-by: Orca <help@stably.ai>

* fix(renderer): address CodeRabbit — floor-to-0 override + Linux 8GB gate

- parseRendererHeapOverrideMb: a fractional override in (0,1) floored to 0 and
  emitted an invalid --max-old-space-size=0; treat floored-to-0 as an opt-out.
- Lower the RAM gate from 8 to 7.5 GiB: os.totalmem() on Linux reports MemTotal
  (excludes kernel/firmware-reserved RAM), so a real 8 GB box reports ~7.7 GiB
  and was wrongly excluded from the headroom — the exact crashing population.
  7.5 still cleanly excludes 6 GB machines (report ~5.7 GiB).

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-06 02:13:10 -07:00
NeilandOrca e33b2006f4 Remove stale max-lines lint disables from files under the limit (#7548)
110 files carried an eslint/oxlint-disable max-lines directive but are
already under the default max-lines budget (300 .ts / 400 .tsx / 600 .mjs
/ 800 test), so the suppression is dead. Removing it restores real
max-lines coverage on these files with zero behavior change.

Each removed directive had max-lines as its only rule; verified via a
full oxlint run (0 max-lines violations, 0 new errors). Diff is pure
deletions (200 lines, 0 additions) — no code touched.

Co-authored-by: Orca <help@stably.ai>
2026-07-06 02:12:32 -07:00
NeilandOrca dfc839fcb5 perf(renderer): gate WorktreeCardAgentsBody's send-target subscriptions (#7545)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 02:01:14 -07:00
NeilandOrca 2e44f72755 perf(main): stop allocating a debug snapshot on every PTY delivery event (#7541)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 02:00:29 -07:00
NeilandOrca b38f5babb4 perf(renderer): pause the shared useNow clock while the window is hidden (#7537)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 01:59:41 -07:00
NeilandOrca 82a59f8822 perf(renderer): purge pane-expand maps on worktree removal (#7534)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 01:58:32 -07:00
JinjingandOrca 3c963dd285 Prepare mobile 0.0.24 (#7546)
Bump marketing version 0.0.22 -> 0.0.24 and Android versionCode 4 -> 5.

The 0.0.22 base was never committed after prior releases, so the Jul 6
builds carrying the show-all-worktrees fix (#7500) regressed below the
0.0.23 already on TestFlight (iOS) and collided with the existing
0.0.22/versionCode 4 APK (Android, no upgrade signal). Committing the
bump makes app.json authoritative again so 0.0.24 supersedes both.

Co-authored-by: Orca <help@stably.ai>
mobile-android-v0.0.24
2026-07-06 01:39:40 -07:00
Brennan BensonandOrca 28fe4df817 Preserve terminal scrollbar position after tab switches (#7472)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 01:33:05 -07:00
Jinwoo Hong 2e5057f341 Fix mobile emulator device rotation (#6326) 2026-07-06 01:26:36 -07:00
Brennan BensonandOrca eb8435950a Clear a worktree's merged pull request after it switches to a different branch (#7460)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 01:26:10 -07:00
github-actions[bot] f2393c9555 release: v1.4.124 v1.4.124 2026-07-06 08:22:48 +00:00
Brennan BensonandOrca 3826169c11 Keep Claude live-PTY refresh gate closed across restarts; recover wiped runtime credentials (STA-1246) (#7483)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 01:16:23 -07:00
Jinwoo Hong 3b081c11e0 Revert "feat(daemon): Phase 0 update-survival groundwork — daemon file log + packaged-update proof harness (#7532)" (#7535)
This reverts commit e9b9836da5.
2026-07-06 01:12:37 -07:00
Jinwoo Hong e9b9836da5 feat(daemon): Phase 0 update-survival groundwork — daemon file log + packaged-update proof harness (#7532)
Two independent pieces, no behavior change to terminal handling:

1. Daemon lifecycle file log. The detached daemon runs with stdio
ignored, so field failures have zero daemon-side evidence. The daemon
now writes rotated NDJSON lifecycle events (startup/ready/hello
accept+reject/session create/attach/exit/kill/shutdown/uncaught
exceptions) to logs/daemon.log via a new optional --log-file fork arg.
Fail-open (any fs error disables logging), adoption-neutral (old
daemons without the arg keep working, protocol untouched), and the
diagnostic bundle collector now includes the file, bounded by the same
lookback window as trace spans.

2. tools/win-update-e2e: a packaged NSIS update proof harness. Installs
version N, drives the installed app (isolated userData), plants a
canary marker session, silently updates to N+1, relaunches, and
asserts an explicit expectations profile: --expect cold-restore
(today's behavior) or --expect survival (the Phase 1 target). Window
flashes are detected by baseline-diffed window enumeration with
canary-title attribution; daemons are identified by command-line
marker, never exe name. Refuses to run when a pre-existing Orca app is
running or (without --allow-existing-install) installed, and only
uninstalls an install it fully owns.
2026-07-06 01:09:54 -07:00
Jinjing 2b5f6af0e9 Respect terminalWindowsShell setting for local Windows agent launches (#7526)
Ensure agent CLI startup and draft launch commands use the correct quoting
format based on the user's configured local Windows shell (e.g., cmd.exe).
This avoids using host settings for remote/SSH targets where local shell
preferences do not apply.
2026-07-06 01:05:56 -07:00
Brennan BensonandNeil be4d963905 test(windows): guard PowerShell setup-runner encoded delivery (#7236) (#7520)
Issue #7236 reported that any non-empty worktree Setup Script failed on
Windows PowerShell with a "missing terminator" parser error, regardless
of content. Root cause: in pre-encoded builds the setup-runner command
(`cmd.exe /c "<runner>"`) was typed into PowerShell as raw stdin, where a
dropped/unbalanced double quote got re-parsed as an open string.

Encoded-command delivery (base64 UTF-16, shipped in v1.4.81) already
fixes this by passing the command as a shell argument with quotes intact.
This adds a regression test tying resolveSetupRunnerCommand to
resolveWindowsShellLaunchArgs: the real setup-runner command must reach
PowerShell via -EncodedCommand (startupCommandDeliveredInShellArgs),
never raw stdin, with its quotes preserved verbatim.

Co-authored-by: Neil <neil@stably.ai>
2026-07-06 00:54:45 -07:00
NeilandOrca 88640ef4c6 docs(runtime): fix stale ps-snapshot factory comment after #7518 (#7529)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 00:44:21 -07:00
Brennan BensonandOrca 39c7bef3d6 Fix latent prefer-array-find lint error breaking verify on every PR (#7523)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 00:33:04 -07:00
Jinwoo HongandOrca d9103d08c1 Revert "fix(terminal): launch prior/default agent when a woken terminal can’t resume" (#7524)
Co-authored-by: Orca <help@stably.ai>
2026-07-06 00:27:32 -07:00
Jinjing 3dd3cc9f68 Clarify Orca orchestration tool boundary and sidebar lineage (#7522)
* Clarify Orca orchestration tool boundary and sidebar lineage

Add a "Tool Boundary" section to the orchestration skill, requiring
explicit Orca runtime state instead of generic subagent tools or
chat-only parallel workers. Also add tests to verify the tool boundary
and clarify sidebar lineage for same-worktree workers.

* Clarify worktree lineage guidance and parent-child boundaries

Update orchestration guidance and tests to clarify when to use child versus
top-level worktree lineages, and when to prefer same-worktree workers.

* Require stating the desired Orca lineage before creating a worktree from
  an active feature branch.
* Limit child worktrees to conceptually stacked or dependent tasks.
* Prefer same-worktree workers unless isolated checkouts are explicitly
  needed and do not require uncommitted changes.
2026-07-06 00:05:49 -07:00
NeilandOrca 27ba95cf31 perf(runtime): cache parsed ps rows on POSIX so panes share one parse (#7518)
getProcessTableSnapshot deduped the ps fork (#6288/#6667) but cached only the
raw stdout string on POSIX, so every concurrent agent pane re-ran parsePsRows
over the identical output within each 500ms TTL window — O(M*P) redundant
tokenization + row allocation. The Windows reader already caches parsed rows;
this makes the POSIX default reader do the same by parsing inside the deduped
scan and returning ProcessTableRow[]. Collapses the duplicate parsePsRows in
the main and relay foreground resolvers into one shared parseProcessTableRows.

Co-authored-by: Orca <help@stably.ai>
2026-07-06 00:03:54 -07:00
NeilandOrca 8348443719 fix(emulator): remove destroyed listener on stream stop to stop webContents leak (#7517)
* fix(emulator): remove destroyed listener on stream stop to stop webContents leak

Both emulator stream IPC handlers register owner.once('destroyed', ...) per
start but never remove it on stop. .once only self-removes when the event
fires (window close), so every emulator tab show/hide cycle leaked a closure
on the long-lived main-window webContents — ~11 cycles trips Node's
MaxListenersExceededWarning and the closures grow unbounded until the window
dies. Store the handler on the session/subscription and removeListener on stop.

Co-authored-by: Orca <help@stably.ai>

* chore(emulator): trim why-comment to 2 lines, drop no-op afterEach

Review polish: honor AGENTS.md 1-2 line comment guidance and remove a
vi.clearAllTimers() that is a no-op without fake timers.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-06 00:03:31 -07:00
NeilandOrca f6954cb5d2 fix(checks): stop Checks tab flip-flopping between 'Branch not published' and 'PR status unavailable' (#7519)
The empty-state copy chooser only handled idle PR-refresh statuses inside the
ambiguous-hosted-review guard. When a background PR refresh went active
(queued/in-flight) or errored, it fell through to the publish-branch branch and
rendered 'Branch not published' on a no-upstream branch. As the refresh cycled,
the panel flip-flopped between the two messages (most visible on Windows, where
local git latency widens the active window).

Resolve the whole empty state inside the ambiguous guard so the copy is stable
across the entire refresh lifecycle: 'error' -> 'Could not refresh pull request',
every other status -> 'Pull request status unavailable'. The ambiguous state can
no longer surface publish guidance.

Co-authored-by: Orca <help@stably.ai>
2026-07-05 23:58:22 -07:00
Neil ce687221d3 lint(unicorn): enable prefer-number-properties, prefer-array-find, prefer-array-index-of (#7516)
Enable three unicorn rules — one correctness, two performance — and fix every
existing violation repo-wide so the rules pass as errors.

prefer-number-properties (76 sites)
- parseInt/parseFloat/NaN -> Number.* : safe aliases (autofixed).
- isNaN -> Number.isNaN (12 sites, hand-converted): global isNaN coerces its
  argument, Number.isNaN does not. Verified every call site already passes a
  number (Number.parseInt results, number-typed fields, Date.getTime()), so the
  conversion is behavior-preserving today and guards against a future non-numeric
  argument silently coercing.

prefer-array-find (26 sites)
- .filter(pred)[0] -> .find(pred); .filter(pred).at(-1) / .pop() -> .findLast(pred).
  Drops the intermediate array and short-circuits.

prefer-array-index-of (5 sites)
- .findIndex(x => x === v) -> .indexOf(v).

Verified: typecheck (node/cli/web) clean, 53 affected suites pass (1679 tests),
oxlint clean repo-wide. mobile/ uses findLast safely (already ships ES2023
.toReversed()); config scripts and e2e helpers run on Node 24.
2026-07-05 23:56:37 -07:00
Brennan Benson 7b7a21e3c7 Give agents access to inline Linear ticket screenshots and media (#7484) 2026-07-05 23:55:56 -07:00
Jinjing 8e16ec1007 Validate ORCA_TERMINAL_HANDLE and remint stale orchestration terminals via pane key (#7514)
* Validate ORCA_TERMINAL_HANDLE and fall back to active terminal if stale

Long-lived shells can retain a stale ORCA_TERMINAL_HANDLE environment
variable after the runtime remints a pane handle. This can cause commands
to bake obsolete terminal handles into coordinator preambles or tasks.

- Check if the environment-provided handle is live via terminal.show before
  using it in dispatch, task-create, or run operations.
- Fall back to resolving the active terminal/implicit sender if the environment
  handle is stale.
- Map raw "no_active_terminal" errors to a helpful user-facing error message
  suggesting the use of the "--from" flag.

* Remint stale orchestration terminals via pane key instead of focus

Resolve stale environment-provided terminal handles using the caller's
pane key (ORCA_PANE_KEY) via terminal.resolvePane instead of falling
back to the active focused terminal. This prevents commands from being
dispatched from or credited to the wrong terminal pane if focus has
changed.

Additionally, handle graph or pane resolution failures gracefully during
task creation since creator handles are best-effort lineage metadata.

* refactor orchestration tests to use helper stubs for stale handles

Consolidate repetitive mocking boilerplate for stale terminal handle
reminting and failure flows using new helper functions.
2026-07-05 23:38:37 -07:00
NeilandOrca 61ecaaf521 perf(runtime): memoize onPtyData tail wait scan to halve per-chunk work (#7488)
* perf(runtime): memoize onPtyData tail wait scan to halve per-chunk work

onPtyData runs per raw PTY chunk (hundreds/sec during verbose builds and
agent token streaming). For any terminal past the 2000-line / 256KB tail
cap it built the full wait text (a map/trim/filter/join over the entire
retained tail) and lower-cased + scanned it twice per chunk — once for the
pre-append tail and once for the post-append tail — producing hundreds of
KB of transient string allocation per chunk and steady main-process GC/CPU
pressure under load.

Cache the post-append wait state (text + lower-cased blocked-signal scan)
on the pty/leaf record and reuse it as the next chunk's pre-append state.
The prior chunk's post-append tail *is* this chunk's pre-append tail, so
the cached scan is exact; reuse is gated on fromTail so the empty-tail
preview fallback (which depends on a value updated after append) is never
reused stale. This drops per-chunk full-tail scans from 2N to N+1.

Adds an equivalence test proving the memoized stamping is byte-for-byte
identical to the recompute-both-sides reference across split prompts,
partial lines, ready-after-blocked demotion, and tail eviction, plus a
count assertion (memoized N+1 vs reference 2N scans).

Co-authored-by: Orca <help@stably.ai>

* fix(runtime): clear memoized wait cache when a disconnected transcript is pruned

pruneDisconnectedPtyTranscript empties a disconnected PTY record's retained
tail but left the new tailWaitState memo untouched. If such a record resumed
output (adoption/reattach while a leaf keeps it alive), onPtyData would reuse
the stale pre-prune wait state (fromTail=true) as the next chunk's previous
state and could miss or mis-time the waitBlockedAt stamp on that first chunk.
Clear tailWaitState in the prune reset so the resumed chunk recomputes from the
emptied tail.

Adds a runtime guard (prune clears the cache) and a sim equivalence test
covering prune-then-resume stamping.

Co-authored-by: Orca <help@stably.ai>

* docs(runtime): reword wait-scan comment that named a removed function

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-05 23:21:35 -07:00
github-actions[bot] ecff85401d release: v1.4.124-rc.9 v1.4.124-rc.9 2026-07-06 06:14:25 +00:00
PrinceandJinjing e172adf191 fix: prefer Claude-generated titles in AI Vault (#7369)
* fix: prefer Claude-generated titles in AI Vault

Agent Session History labeled Claude Code sessions with a truncated
first prompt even when the session already had a Claude-generated name
(the ai-title shown in /status and the tab title). Reserve the top
title slot for a user-set custom-title and rank the generated ai-title
above the first prompt: custom-title > ai-title > first prompt > meta.
New sessions still fall back to the first prompt until the ai-title is
written.

Also prune <session>/subagents/ during discovery via an injected
directoryPredicate so Task subagent transcripts, which share the parent
sessionId and are not independently resumable, stop appearing as
separate untitled history rows. Pruning at the directory level avoids
readdir'ing the excluded subtree and is cross-platform safe.

* Use latest generated Claude title in session scanner

Ensure the scanner updates the generated session title when Claude
revises it, rather than only keeping the first parsed 'ai-title'
record.

---------

Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
2026-07-05 23:12:55 -07:00
JinjingandOrca 430d4b9482 Show all worktrees across all hosts on mobile (#7500)
* Show all worktrees across all hosts on mobile

Avoid honoring desktop's host-filtering settings since mobile lacks the
UI to manage or unhide them. This prevents worktrees from being silently
hidden under certain host scopes.

Additionally, this removes worktree filtering based on repo metadata, which
previously caused worktrees to vanish when same-named repos on different
hosts collapsed to a single ID.

* fix(daemon): preserve promisify.custom type through wrapChildProcessApi

The windows-hidden-console-children test (from #7499, admin-merged with a
failing verify) failed tsgo: promisify(wrapped) resolved to its zero-arg
overload because the wrapper erased its argument to a bare variadic function
and the fake never statically carried promisify.custom. Preserve the wrapped
type via a generic overload (accurate: the wrapper copies the call signature
and symbols verbatim) and build the fake as a real CustomPromisify, so
promisify routes through the custom overload as it does in production.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-05 23:10:48 -07:00
Jinjing c97d3a4977 Replace post-worker_done polling with idle behavior (#7509)
- Instruct workers to stop and idle or exit immediately after sending
  `worker_done`, rather than running a 10-minute polling loop.
- Distinguish instructions based on worker kind: prompt-returning
  agents should remain idle for re-engagement, while bare-shell
  workers should exit.
- Prevent infinite polling overhead since the coordinator re-engages
  workers via fresh terminal input instead of inbox polling.
2026-07-05 23:10:20 -07:00
Neil af98a72f3f refactor(net): use AbortSignal.timeout for fetch timeouts, fix fork-sync clobbered cancel (#7504)
Replace the hand-rolled `AbortController` + `setTimeout(() => controller.abort())`
+ `clearTimeout` in `finally` pattern with `AbortSignal.timeout(ms)` across the
main-process fetchers, updaters, and hosted-provider clients. This removes a
timer-leak footgun (a thrown/early-returned path that skips the finally leaks the
timer) and ~3-4 lines of bookkeeping per site. `AbortSignal.timeout` is Node
17.3+ (Electron main is Node 22+).

Two sites compose a caller-cancel signal with the timeout via `AbortSignal.any`
(Node 20.3+) instead of a manual abort listener:
- git/fork-sync.ts: also fixes a latent bug — the caller's `options.signal` was
  spread into the git options then immediately clobbered by `signal:
  controller.signal`, so caller cancellation was silently dropped. `AbortSignal.any`
  restores it.
- rate-limits/claude-fetcher.ts (fetchViaOAuth external signal).

hosted-review-api-request.ts: `AbortSignal.timeout()` rejects with a
`TimeoutError`, not an `AbortError`, so the timeout-detection branch is updated
(otherwise `timedOut` would never be set).

minimax-fetcher.test.ts: its timeout test drove the abort with fake timers, which
cannot advance `AbortSignal.timeout`'s internal timer. Rewritten to fire the
timeout with an already-aborted signal so it genuinely exercises the abort path.

Deliberately NOT migrated:
- src/relay/git-handler.ts: the relay targets Node 18 (`build-relay.mjs`,
  MIN_NODE_MAJOR = 18); `AbortSignal.any` needs Node 20.3+, and timeout-only would
  drop the request context signal.
- ipc/feedback.ts: its timeout-driven fallback is verified with fake timers, which
  can't advance `AbortSignal.timeout`; kept on the manual pattern.
2026-07-05 23:09:14 -07:00
NeilandOrca 885badba60 perf(linear): fetch issue comments in one request, not N+1 (#7497)
getIssueComments loaded the issue, then its comments, then awaited c.user
inside a for-loop. Accessing .user on the Linear SDK's Comment model lazily
issues a fresh user(id) GraphQL query, so a comment-heavy issue did issue +
comments + N sequential user round-trips — a visible multi-second stall on
open, burning the complexity-based rate limit and holding one of only 4 shared
Linear concurrency slots (acquire/release) for the whole N*latency window.

Replace with a single rawRequest that fetches each comment's author inline
(first: 50, matching the SDK default page the code already relied on), the same
pattern the rest of this file uses. createdAt is passed through as the ISO
string rawRequest already returns (no re-serialization), and null avatarUrl is
normalized to undefined — output shape is unchanged.

Test asserts one request regardless of comment count and correct author
mapping (present user, null avatar, absent user).

Co-authored-by: Orca <help@stably.ai>
2026-07-05 23:08:43 -07:00