Skip to content

DOS-1588: add hybrid dispatch orchestrator - #18

Draft
mdostal wants to merge 1 commit into
mainfrom
agent/dostal-dev/e8449fe5
Draft

DOS-1588: add hybrid dispatch orchestrator#18
mdostal wants to merge 1 commit into
mainfrom
agent/dostal-dev/e8449fe5

Conversation

@mdostal

@mdostal mdostal commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Implements the DOS-1588 Stage 1 hybrid dispatch/reclaim core selected by DOS-1549 and reviewed in DOS-1587.

  • Adds MULTICA_HYBRID_ORCHESTRATOR=true to switch server startup from the legacy runtime sweeper to a single hybrid dispatcher loop.
  • Moves hybrid daemon claims to an already-dispatched runtime inbox instead of popping queued work directly.
  • Adds DB-backed advisory lease ownership, startup dispatched-lock clear, stale dispatched TTL reap, bounded dispatch pool, per-agent capacity checks, online-runtime admission, and a fast-fail circuit breaker.
  • Keeps rollback immediate: disable the flag and the legacy runtime sweeper/claim path is restored.

Validation

  • go test ./internal/service ./cmd/server
  • go test ./internal/handler -run 'TestClaimTaskByRuntime_HybridDoesNotPopQueuedTask|TestHybridDispatcher_DispatchesWithinBoundedPoolAndClaimInbox|TestHybridDispatcher_ReapsStaleDispatchedWithoutRetryDuplicate|TestHybridDispatcher_CircuitBreakerSkipsFastFailPair|TestClaimTaskByRuntime_ReclaimsStaleDispatchedTask'

Broad go test ./internal/service ./internal/handler ./cmd/server still hits existing local DB fixture failures in unrelated DaemonRegister tests: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification (SQLSTATE 42P10).

Co-authored-by: multica-agent <github@multica.ai>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@mdostal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fa7b45ac-9a9a-4f8c-9dcd-b2cfc453b12e

📥 Commits

Reviewing files that changed from the base of the PR and between 9696a37 and 5619b72.

⛔ Files ignored due to path filters (1)
  • server/pkg/db/generated/agent.sql.go is excluded by !**/generated/**
📒 Files selected for processing (5)
  • server/cmd/server/hybrid_dispatcher.go
  • server/cmd/server/main.go
  • server/internal/handler/daemon_test.go
  • server/internal/service/task.go
  • server/pkg/db/queries/agent.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/dostal-dev/e8449fe5

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.

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