Fix team task claim queue stalls - #5624
Open
vicksiyi wants to merge 1 commit into
Open
Conversation
Co-authored-by: multica-agent <github@multica.ai>
|
@vicksiyi is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a claim-path stall for large team/squad-assigned queues. Team work routes many queued tasks to the same leader agent/runtime; the batch claim endpoint was reading every queued task as a candidate and then dispatching at most one task for that leader per poll. This changes candidate listing to one representative per runtime/agent and lets the batch claim loop reuse remaining free slots for the same agent while still going through
ClaimTaskfor capacity and serialization checks.Related Issue
Closes #3166
Multica issue: ZIC-97
Type of Change
Changes Made
server/pkg/db/queries/agent.sql.ClaimTaskreports capacity/runnable work.How to Test
cd server && go test ./internal/servicecd server && go test ./internal/handler -run 'TestClaimTasksByRuntime|TestClaimTaskByRuntime'make check-worktree(exited 0 locally, but printed Docker unavailable while checking PostgreSQL:Cannot connect to the Docker daemon)Checklist
apps/web/features/landing/i18n/) and relevant docs (apps/docs/content/docs/)apps/docs/content/docs/developers/conventions.zh.mdx(terminology, mixed-rule fortask/issue/skill)AI Disclosure
AI tool used: Multica Agent
Prompt / approach:
Traced GitHub #3166 from the daemon claim timeout logs into the runtime batch claim service and SQL candidate list. Implemented the smallest backend fix with focused service and handler regression tests.
Screenshots (optional)
N/A