Skip to content

fix(pixel-agent-teams): validate index range in worker constructor - #5743

Closed
Vishaaallll wants to merge 1 commit into
Osmantic:public-betafrom
Vishaaallll:fix/pixel-agent-teams-worker-index-bound
Closed

Vishaaallll wants to merge 1 commit into
Osmantic:public-betafrom
Vishaaallll:fix/pixel-agent-teams-worker-index-bound

Conversation

@Vishaaallll

Copy link
Copy Markdown
Contributor

Why this matters

In ods/extensions/services/dashboard-api/pixel_agent_teams.py, worker(team_id, index, role) assigns "id": str(index) without checking whether index is within the valid team agent bounds 0..5. Supplying out-of-range numbers, booleans, or strings produces malformed child worker records and violates router pattern constraints Field(pattern=r"^[0-5]$").

This surgical fix validates that index is strictly an int between 0 and 5, raising ValueError on invalid index arguments.

Validation

  • Baseline reproduction: verified that worker(id, -1, "builder") was admitted on baseline.
  • Post-fix behavior: raises ValueError("index must be an integer between 0 and 5").
  • Telemetry: pixel-teams suite: 2 passed. New-test syntax and diff checks pass; new regression wired into Linux CI.

Overlap check

Inspected open/closed PRs. PR #5734 validated roles_for counts; zero overlap with worker index parameter validation.

Risk / AI disclosure

AI-assisted investigation, patch, and regression tests. Strengthens agent worker boundary checks. Independent review remains a gate.

Follow-up integration evidence

Composed locally with public-beta at 4fa6ad170 without conflicts. CI and unit checks pass.

Signed-off-by: Vishaaallll <Vishaaallll@users.noreply.github.com>
@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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.

2 participants