orca/src/main/runtime
fsdwen 78d2b958bf
fix(issues): replace cursor-based pagination with page-number Search API (#8680)
* fix(issues): replace cursor-based pagination with page-number Search API

Problem
=======
Issue pagination (#8649) had two bugs:
1. Pages 6-16 were unreachable — clicking page 16 highlighted page 5;
   clicking 6/7 did nothing. The old cursor-based approach
   (updated:<CURSOR) broke with Search API's relevance sorting —
   pages after the first few returned no items even though more
   issues existed.
2. Issue numbers appeared out of order on loaded pages (e.g. #1082
   between #1308 and #1499), because client-side sort used
   updatedAt instead of issue number.

Root Cause
==========
The pagination used two separate GitHub API strategies:
- Initial page 0 load: REST endpoints (repos/:owner/:repo/issues,
  repos/:owner/:repo/pulls) sorted by updatedAt
- Subsequent pages: Search API with cursor (updated:<DATE)

These two sources returned items in different orders, causing items
to go missing or appear on wrong pages across page boundaries.

Solution
========
1. Unified on GitHub Search API for all pages — initial load and
   pagination both use search/issues?q=...&page=N, eliminating the
   REST-vs-Search inconsistency.
2. Changed from cursor-based (update:<DATE) to page-number-based
   pagination (page=N), which the Search API supports natively.
3. Switched client-side sort from updatedAt to issue number
   (sortWorkItemsByNumber), matching GitHub's default Issues view.
4. Parallelized page fetches in handleLoadNextPage — clicking page
   16 now fetches all intermediate pages concurrently (~2s) instead
   of sequentially (~30s).
5. Cleaned up dead legacy gh issue list / gh pr list code path,
   extracted quoteForSearch helper, shortened overlong comments.

Files changed: 11 files, +140/-127 lines

Closes #8649

* chore: remove unrelated merge formatting

---------

Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
2026-07-15 18:52:37 -07:00
..
orchestration fix(orchestration): compare stale-dispatch timestamps with julianday (#8514) 2026-07-13 17:46:25 -07:00
relay Add Orca Relay desktop and mobile transport (#8536) 2026-07-14 11:47:05 -07:00
rpc fix(issues): replace cursor-based pagination with page-number Search API (#8680) 2026-07-15 18:52:37 -07:00
claude-agent-teams-pane-layout.ts
claude-agent-teams-pty-exit-leak.test.ts
claude-agent-teams-service.test.ts
claude-agent-teams-service.ts
claude-agent-teams-shim-env.test.ts
claude-agent-teams-shim-env.ts fix(cli): preserve multiline arguments on Windows (#8374) 2026-07-12 02:13:41 -07:00
claude-agent-teams-tmux-dispatcher.ts
claude-agent-teams-types.ts
device-registry.ts Add Orca Relay desktop and mobile transport (#8536) 2026-07-14 11:47:05 -07:00
e2ee-keypair.ts
fetch-remote-cache.test.ts perf(worktrees): avoid auto-maintenance in create fetches (#8039) 2026-07-10 02:31:47 -07:00
file-watcher-host.test.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
file-watcher-host.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
fit-override-integration.test.ts Fix Windows slow startup and multi-minute UI freezes (#7225) (#7266) 2026-07-03 19:40:45 -04:00
headless-tab-group-split-layout.test.ts
headless-tab-group-split-layout.ts
headless-terminal-split-layout.test.ts
headless-terminal-split-layout.ts
mobile-notification-replay.test.ts fix(mobile): resync worktree list + idempotent notification replay on reconnect (#8498 #8129) 2026-07-14 00:23:53 -07:00
mobile-notification-replay.ts fix(mobile): resync worktree list + idempotent notification replay on reconnect (#8498 #8129) 2026-07-14 00:23:53 -07:00
mobile-pairing-files.ts
mobile-pairing-userdata-path.test.ts
mobile-presence-lock.test.ts Fix mobile terminal query reply authority (#8227) 2026-07-11 02:13:15 -07:00
mobile-rpc-allowlist.test.ts
mobile-session-tabs-notify-coalescer.test.ts fix(remote): harden terminal, relay, and SSH reliability (#8141) 2026-07-10 12:56:17 -07:00
mobile-session-tabs-notify-coalescer.ts fix(remote): harden terminal, relay, and SSH reliability (#8141) 2026-07-10 12:56:17 -07:00
mobile-subscribe-integration.test.ts fix(remote): harden terminal, relay, and SSH reliability (#8141) 2026-07-10 12:56:17 -07:00
orca-runtime-automations.test.ts
orca-runtime-browser.test.ts Remove stale max-lines lint disables from files under the limit (#7548) 2026-07-06 02:12:32 -07:00
orca-runtime-browser.ts fix(browser): keep isolated profile storage on its partition (#6958) 2026-07-03 13:58:40 -07:00
orca-runtime-emulator.ts
orca-runtime-files-watch.test.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
orca-runtime-files.test.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
orca-runtime-files.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
orca-runtime-git.test.ts
orca-runtime-git.ts
orca-runtime-path-candidate-history.test.ts perf(runtime): reuse unchanged PTY path history (#8163) 2026-07-10 20:52:17 -07:00
orca-runtime-tail-wait-memo.test.ts perf: skip terminal wait scans for ordinary output (#8169) 2026-07-10 21:10:29 -07:00
orca-runtime-terminal-cwd.test.ts feat(ssh): support file transfers over system ssh (#7804) 2026-07-12 01:29:55 -07:00
orca-runtime.test.ts fix(issues): replace cursor-based pagination with page-number Search API (#8680) 2026-07-15 18:52:37 -07:00
orca-runtime.ts fix(issues): replace cursor-based pagination with page-number Search API (#8680) 2026-07-15 18:52:37 -07:00
orchestration-cli-subprocess.test.ts fix(orchestration): complete tasks on worker_done + coordinator UX fixes (#8030) 2026-07-12 02:15:11 -07:00
pty-transcript-prune-wait-cache.test.ts perf(runtime): memoize onPtyData tail wait scan to halve per-chunk work (#7488) 2026-07-05 23:21:35 -07:00
remote-desktop-driver.test.ts fix(terminal): arbitrate active desktop viewport ownership (#8252) 2026-07-11 03:02:29 -07:00
remote-runtime-request-connection.integration.test.ts Fix restored mobile terminals and workspace visibility parity (#8789) 2026-07-14 19:36:47 -07:00
retained-tail-redraw-window.equivalence.test.ts Terminal performance initiative: pipeline fixes + term-speed-2 revival + PTY flow control (integration branch) (#7214) 2026-07-10 17:27:47 -07:00
runtime-metadata.test.ts
runtime-metadata.ts
runtime-relative-paths.ts
runtime-root-watch-ownership.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
runtime-root-watch-teardown.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
runtime-rpc.test.ts Add Orca Relay desktop and mobile transport (#8536) 2026-07-14 11:47:05 -07:00
runtime-rpc.ts Add Orca Relay desktop and mobile transport (#8536) 2026-07-14 11:47:05 -07:00
runtime-socket-sweep.test.ts
scrollback-limits.ts
terminal-model-query-authority.test.ts Terminal performance initiative: pipeline fixes + term-speed-2 revival + PTY flow control (integration branch) (#7214) 2026-07-10 17:27:47 -07:00
terminal-model-query-authority.ts Terminal performance initiative: pipeline fixes + term-speed-2 revival + PTY flow control (integration branch) (#7214) 2026-07-10 17:27:47 -07:00
terminal-query-responder.test.ts Terminal performance initiative: pipeline fixes + term-speed-2 revival + PTY flow control (integration branch) (#7214) 2026-07-10 17:27:47 -07:00
terminal-subscribe-exit-waiter-leak.test.ts fix(runtime): release terminal.subscribe exit-waiters on teardown (#7490) 2026-07-05 23:08:37 -07:00
terminal-view-attribute-store.ts Terminal performance initiative: pipeline fixes + term-speed-2 revival + PTY flow control (integration branch) (#7214) 2026-07-10 17:27:47 -07:00
tls-certificate.ts
windows-firewall-remote-scope.test.ts Create pr not working for stacked worktree (#8651) 2026-07-13 20:10:50 -07:00
windows-firewall-remote-scope.ts P2 mobile firewall scope (#8639) 2026-07-13 19:02:52 -07:00
windows-mobile-firewall.test.ts fix(mobile): detect and repair overriding Windows Firewall Block rules for pairing (#8846) 2026-07-15 01:40:41 -07:00
windows-mobile-firewall.ts fix(mobile): detect and repair overriding Windows Firewall Block rules for pairing (#8846) 2026-07-15 01:40:41 -07:00
worktree-teardown.test.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00
worktree-teardown.ts fix(runtime): harden watcher and PTY teardown ownership (#8661) 2026-07-15 15:23:35 -07:00