Skip to content

fix(file-search): bound dispatcher claims and skip locked rows - #7940

Merged
icecrasher321 merged 1 commit into
stagingfrom
codex/fix-file-search-dispatch-claims
Sep 17, 2026
Merged

icecrasher321 merged 1 commit into
stagingfrom
codex/fix-file-search-dispatch-claims

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

  • Bound dispatcher claim probes to each workspace's available slots and skip locked pending rows, avoiding backlog-wide ranking and waits on busy candidates.
  • Preserve current-file eligibility and global/workspace concurrency caps. Add PostgreSQL coverage for locked rows, concurrent dispatch, a large backlog, and capacity limits.

Type of Change

  • Bug fix

Testing

  • 10 focused unit tests and 6 PostgreSQL 17 integration tests pass. The new locked-candidate regression fails against the previous query and passes with this change.
  • App type-check, repository lint, all 46 repository audits (including API validation), block registry, and docs manifest checks pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 17, 2026 8:09pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations were identified.

Summary

This PR replaces backlog-wide candidate ranking with bounded, per-workspace PostgreSQL probes that lock eligible rows using SKIP LOCKED.

  • Limits each workspace probe to its currently available outstanding slots.
  • Preserves current-file eligibility and global dispatch capacity.
  • Adds PostgreSQL integration coverage for locked candidates, concurrent preparation, large backlogs, and capacity limits.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Acquire dispatcher advisory lock] --> B[Count global active claims]
    B --> C[Select queued workspaces]
    C --> D[Count active claims per workspace]
    D --> E[Probe only available candidate slots]
    E --> F[Lock candidates with SKIP LOCKED]
    F --> G[Apply remaining global-capacity limit]
    G --> H[Set dispatched_at and return payloads]
    H --> I{Eligible undispatched rows remain?}
    I -->|Yes| J[Retain queue row and update dispatch time]
    I -->|No| K[Delete queue row]
Loading

Reviews (1) · Last reviewed commit: "fix(file-search): bound dispatcher claim..."

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321
icecrasher321 merged commit 8508ba1 into staging Sep 17, 2026
34 checks passed
@icecrasher321
icecrasher321 deleted the codex/fix-file-search-dispatch-claims branch September 17, 2026 20:14
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.

1 participant