Skip to content

Auto-expand worker context budget - #219

Merged
pmbstyle merged 2 commits into
mainfrom
fix/worker-context-budget
Jul 23, 2026
Merged

Auto-expand worker context budget#219
pmbstyle merged 2 commits into
mainfrom
fix/worker-context-budget

Conversation

@pmbstyle

Copy link
Copy Markdown
Owner

What changed

  • treat the 6,000-unit worker system-context budget as a soft target
  • automatically expand the effective budget when required prompt sections outgrow it
  • retain 2,000 units of headroom for high-priority optional context
  • keep a 64,000-unit runtime safety limit
  • record the soft budget, hard limit, and expansion decision in the context manifest

Why

Worker startup could fail before inference when required system context grew slightly beyond the fixed 6,000-unit compiler budget. This surfaced infrastructure prompt bookkeeping to the agent and encouraged ineffective template-level workarounds.

Impact

Required worker instructions remain lossless, and normal prompt growth no longer requires an agent or operator to edit worker templates. The reported 6461 > 6000 case now compiles automatically with an effective budget of 8,461.

Validation

  • full pytest suite
  • focused worker context, compiler, and agent-loop tests
  • Ruff
  • Black check
  • git diff --check

@pmbstyle pmbstyle self-assigned this Jul 23, 2026
@pmbstyle
pmbstyle marked this pull request as ready for review July 23, 2026 22:42
…dget

# Conflicts:
#	tests/test_agent_worker_contracts.py
@pmbstyle
pmbstyle merged commit 92e4f13 into main Jul 23, 2026
6 checks passed
@pmbstyle
pmbstyle deleted the fix/worker-context-budget branch July 23, 2026 22:48
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.

1 participant