Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat(workflows): make the agent fan-out width configurable

2 months ago

276b4d4
Authored
mweinbach7/26/2026, 4:52:25 PM
`WORKFLOW_MAX_INFLIGHT_AGENTS = 12` suits hosted APIs. Local inference engines
have far smaller request pools and per-model context budgets, where a 12-wide
fan-out fails outright rather than queueing — observed as four children dying
with "context size has been exceeded" at once, and separately as "worker local
total request limit reached (43/32)".

Adds `workflowMaxConcurrentAgents`, resolved from the config tiers and settable
live through the session config patch. Clamped to [1, 16]: below 1 a workflow
could not progress, and above AgentControl's MAX_ACTIVE_CHILDREN_PER_PARENT the
extra slots would only produce spawn errors. Non-finite values fall back to the
default so a corrupted config reads as "unset" rather than maxing out fan-out.

Harness side only; the desktop settings control follows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk98XjGKJrKp5ynbiNFMFu

Parentcb1ef38

11 files changed
  • src/config.ts+10−1
  • src/server/jsonrpc/schema.sessionRuntime.ts+1−0
  • src/server/protocol.ts+2−0
  • src/server/runtime/WorkspaceControl.ts+4−0
  • src/server/session/SessionContext.ts+1−0
  • src/server/session/SessionMetadataManager.ts+15−0
  • src/shared/jsonrpcControlSchemas.ts+1−0
  • src/types.ts+8
−0
  • src/workflows/WorkflowRunner.ts+4−2
  • src/workflows/scheduler.ts+24−0
  • test/workflows/concurrency.test.ts+40−0