Repository navigation
fix(portal): enforce team scheduling limits on retry and answer - #6659
Merged
Lightheartdevs merged 1 commit intoSep 28, 2026
Merged
Conversation
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.
Summary
Apply the existing team admission rules to every entry point that schedules work: start, retry, and answering a pending question. Check before changing persisted state.
Why this matters
Portal exposes Retry on historical failed workers and Continue on pending questions. Those controls call
/api/pixel/agents/retryand/api/pixel/agents/answerrespectively.Two reachable paths bypass the constraints enforced by Start:
The shared admission guard rejects either action with HTTP 409 before consuming a retry, appending an answer, clearing questions, or requeuing workers. It also rejects a duplicate scheduled controller. Waiting/interrupted teams continue to reserve their conversation, as they already do for Start.
Recovery remains an explicit user action: finish or stop the conflicting team, or wait for queue capacity, then retry/submit the preserved answer again. Start request-id replay remains idempotent even when the queue is full. No storage migration or automatic replay is introduced.
Overlap check
Searched open and closed upstream PRs for
pixel_agent_teams.py,pixel_teams, team retry, team queue, and team admission. Inspected the relevant existing changes: #5689 handles corrupted team-store rows; #5945 handles missing conversation history; #6656 concerns tool-limit completion/owner replies. Other results cover protocol field validation and history recovery. None applies scheduling admission to Retry and Answer. This PR changes only the team manager and its existing regression test file.Regression evidence and validation
mainat250f35450a7c66f1af9cd1933e1387242bb81035.python -m pytest tests/test_pixel_agent_teams.py tests/test_portal_goal.py tests/test_pixel_chat_context.py -q --tb=short --disable-warnings— 73 passed.c02ad81ce5c1cb781159048e4fd18d15091e5edd.git diff --check: pass.Validation limits and review
Local backend environment: Windows host, WSL Ubuntu x86_64, Python 3.14. Model output is controlled in the regression harness; this is not a claim of live model/provider validation. No fresh installation or full browser/model journey was completed on this candidate. An earlier isolated Debian 13 installation attempt on main
ee738a9a07454b589555de00bb3e6bb91f215843stopped at preflight because jq was unavailable and the test user lacked package-install privileges; that is not installation evidence for this newer base.The local Windows frontend test attempt failed to start Vitest forks workers (timeout before any tests ran). Retrying with one threads worker passed the three project-helper tests, but the PortalSubagents worker also timed out before running its tests. All frontend CI platforms subsequently passed, including PortalSubagents. No frontend code changes are included. Existing UI code retains answer drafts and displays controller errors.
The guard is process-local, matching the existing scheduler and Start semantics; it does not add cross-process coordination. Reverting restores the old admission behavior without a data migration. Maintainer review should check the admission/recovery policy before merge.