Skip to content

fix(tasks): bound GitLab all-projects fan-out to avoid runtime queue overflow - #30157

Merged
nwparker merged 2 commits into
stablyai:mainfrom
maxmilian:fix/gitlab-tasks-fanout-concurrency
Oct 18, 2026
Merged

nwparker merged 2 commits into
stablyai:mainfrom
maxmilian:fix/gitlab-tasks-fanout-concurrency

Conversation

@maxmilian

Copy link
Copy Markdown
Contributor

ELI5

When "All projects" is selected on the GitLab Tasks page, Orca used to ask the runtime for every project's issues/MRs at the same instant. With ~150+ projects that flood (plus other UI asking at the same time) overflowed the runtime's call queue and the page showed "Remote runtime call queue is full". Now it asks a few projects at a time.

What Changed

  • Before: useTaskPageGitLabLoading started one gitlab.listIssues / gitlab.listMRs runtime RPC per selected repo simultaneously (Promise.allSettled(eligibleRepos.map(fetchItems))). The runtime RPC queue runs 8 foreground calls and holds at most 256 queued calls per selector, then rejects. A large selection on its own stays under 256 (166 repos in the report), but combined with other callers on the same selector (e.g. the sidebar) it overflows and surfaces "Remote runtime call queue is full".
  • After: the per-repo fetches go through the existing mapSettledWithConcurrency helper with GITLAB_TASK_FETCH_CONCURRENCY = 6 (below the queue's foreground concurrency of 8, leaving headroom for other callers). Results are still merged, sorted and error-handled exactly as before.
  • Once the selection goes stale (filter/view/repo change or unmount), repos that have not started yet are skipped instead of issuing calls whose results would be discarded anyway.
  • runtime-rpc-call-queue.ts semantics are unchanged.

Why

The overflow comes from the renderer fanning out unboundedly, not from the queue limits themselves; raising the queue limits would only move the cliff. Bounding the fan-out with the helper the codebase already uses for large RPC collections is the smallest fix and keeps the queue's back-pressure meaningful.

Linked Issue

Fixes #30133

Visual Proof

N/A — no visual or interaction change beyond the error no longer appearing. I could not reproduce 150+ GitLab projects end-to-end locally, so the behavior is proven with unit tests that assert the in-flight RPC bound and the stale-selection short-circuit.

Testing

  • Added two regression tests to use-task-page-gitlab-loading.test.tsx:

    • 20 repos: max concurrent callRuntimeRpc equals the limit (was 20 before the fix), and all 20 repos' items are merged.
    • Selection goes stale after the first batch: no further calls are started (20 calls before the fix) and no items are set.
  • Both tests fail on main and pass with this change.

  • pnpm lint and pnpm typecheck pass locally (macOS). Related vitest subset (task-page / gitlab / map-with-concurrency: 106 files, 1049 tests) passes. The full pnpm test failures on my machine (zsh shell-startup / cross-version e2e / packaged CLI / sqlite) reproduce on main and are unrelated to this change. pnpm build not run.

  • I manually tested these changes locally

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

AI Disclosure

Written with Claude Code (model: claude-opus-5-5). I reviewed the root cause, the diff, and the test output myself.

Review

AI review summary: cross-platform — renderer-only change, no path/shell/OS code; SSH/remote/local — reduces load on remote runtime selectors, local behavior unchanged; agents/integrations — GitLab Tasks list only; performance — caps concurrent per-repo calls at 6, so very large selections take slightly longer overall but no longer fail; UI — no visual change; security — no new inputs or permissions.

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.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • 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 (lint/typecheck pass; full test has pre-existing env failures that reproduce on main; build not run)

…overflow

The GitLab Tasks list started one listIssues/listMRs runtime RPC per selected repo at once. With 150+ projects this, combined with other callers on the same selector, overflowed the runtime RPC call queue and surfaced "Remote runtime call queue is full".

Fetch per-repo lists through mapSettledWithConcurrency with a limit of 6 (below the queue's foreground concurrency of 8), and stop starting new calls once the selection goes stale.

Fixes stablyai#30133
@maxmilian
maxmilian marked this pull request as ready for review October 18, 2026 03:09
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cca86cd2-aa5f-4fad-97bd-6d1fa8e59c09
📥 Commits

Reviewing files that changed from the base of the PR and between 00da613 and 6f88eff.

📒 Files selected for processing: 1
  • src/renderer/src/components/use-task-page-gitlab-loading.test.tsx

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

📝 Walkthrough

The GitLab task loading hook now limits concurrent issue and merge request fetches across selected repositories to six. When the effect becomes stale, the hook skips repository fetches that have not started and discards results from calls already in progress. Tests cover the concurrency limit, results across 20 repositories, and unmounting while requests are pending.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 6f88e

GitLab fetches are bounded while preserving results across repositories. The reviewed stale-request overlap may briefly delay other foreground calls, but no material disruption is established; no actionable merge risk remains.

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 4 functions across 2 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 identifies the main change: limiting GitLab all-projects fan-out to prevent runtime queue overflow.
Description check Passed The description covers the required sections, including the problem, mechanism, rationale, linked issue, visual proof, testing, AI disclosure, review considerations, and checklist. It clearly records …
Linked Issues check Passed Issue #30133 requires GitLab Tasks Issues and MRs to load for large All projects selections without runtime queue overflow. The hook now uses mapSettledWithConcurrency with GITLAB_TASK_FETCH_CONCURREN…
Out of Scope Changes check Passed The changes are limited to the GitLab Tasks loading hook and its regression tests. The concurrency change directly implements issue #30133. The tests support that implementation. No unrelated runtime …
Full details: Description check

Explanation

The description covers the required sections, including the problem, mechanism, rationale, linked issue, visual proof, testing, AI disclosure, review considerations, and checklist. It clearly records that full tests had unrelated local failures and that the build was not run.

Full details: Linked Issues check

Explanation

Issue #30133 requires GitLab Tasks Issues and MRs to load for large All projects selections without runtime queue overflow. The hook now uses mapSettledWithConcurrency with GITLAB_TASK_FETCH_CONCURRENCY set to 6. The code skips not-yet-started repositories after the selection becomes stale and preserves result handling. The added tests verify the concurrency limit, merged results, and stale-selection behavior.

Full details: Out of Scope Changes check

Explanation

The changes are limited to the GitLab Tasks loading hook and its regression tests. The concurrency change directly implements issue #30133. The tests support that implementation. No unrelated runtime queue or product behavior changed.

  • Fix all pre-merge checks with AI
  • 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 c2188f6 into stablyai:main Oct 18, 2026
32 checks passed
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]: GitLab Tasks "All projects" fails with "Remote runtime call queue is full" when ~150+ repos are registered

2 participants