Skip to content

PUT /api/agents/{name}/capacity returns 500 for any value above 10, even when the fleet ceiling allows it #4564

Open

Description

@jordanallenlewis

Version: v1.0.0 (ef8112e), hosted images, PostgreSQL.

What happens

With the fleet ceiling raised to 32 (PUT /api/settings/max-parallel-tasks-ceiling), setting an agent's capacity to
anything from 11 to 32 fails:

PUT /api/agents/my-agent/capacity {"max_parallel_tasks": 16}
500 {"detail": "Failed to update capacity"}

Values 1-10 work.

Why

#506 moved the router's check to the admin-set ceiling (routers/agent_config.py, "validate against the
admin-configured fleet ceiling, not a hardcoded 10"), but the database layer still has the old hardcoded bound:

# src/backend/db/agent_settings/resources.py, set_max_parallel_tasks
# Validate range
if max_tasks < 1 or max_tasks > 10:
    return False

The router passes 16, the db layer returns False, and the router turns that into a 500.

Expected

Any value from 1 to the fleet ceiling is stored, as the endpoint's docstring and the #506 change describe.

Suggested fix

Drop the upper bound in set_max_parallel_tasks (the router already validates against the ceiling), or check against
get_max_parallel_tasks_ceiling() there too. A regression test: ceiling 32, PUT 16, expect 200 and
effective_max_parallel_tasks == 16.

Workaround we use

Writing agent_ownership.max_parallel_tasks directly; the runtime then honours min(stored, ceiling) as documented.

Activity

  1. added a commit that references this issue on Nov 17, 2026
    53e383b
  2. added
    status-in-dev
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-p2status-in-devtype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions