Skip to content

fix(workflow-tool): drop the host-chosen budget argument - #63

Merged
timbrinded merged 1 commit into
masterfrom
fix/workflow-tool-budget
Oct 23, 2026
Merged

timbrinded merged 1 commit into
masterfrom
fix/workflow-tool-budget

Conversation

@timbrinded

@timbrinded timbrinded commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Problem

The workflow tool's budget parameter let the host model choose a run's output-token ceiling. In real host-orchestrated (dynamax) review runs the host guessed ceilings of 65k–75k output tokens. The run's own find/verify fan-out spent those before the final synthesize stage, so agent() threw WorkflowBudgetExceededError for synthesis and the run ended without its report. A stage was refused this way in 3 of 28 runs over two rounds (1 + 2). The hosts then rebuilt reports by hand from the journal, which cost them extra turns. With the argument removed, a third round of 14 runs had no budget refusals.

Change

  • Remove budget from the workflow tool's parameter schema. Only the user sets a budget:

    • a +N directive in the prompt, the turn pool that already caps every tool run in its turn;
    • /workflow --budget=;
    • PI_WORKFLOW_BUDGET.

    The last two are unchanged.

  • resolveTurnBudget drops its explicit-budget parameter:

    • with no pool it adds no budget;
    • with a pool the budget is the remainder, clamped to the run range;
    • a pool with less than the minimum left is spent.
  • A host that still sends budget has it ignored rather than rejected, because TypeBox objects allow extra properties. The tool test covers this: under a +5k pool, a stray budget: 1234 runs at 5000.

  • USAGE.md (turn budget directive section and runtime-knobs table) and the workflow-authoring skill's Budget section now say the tool takes no budget.

Notes

  • /workflow:runs relaunch still reapplies a record's own options.budget, so records written before this change keep any ceiling their host chose.
  • The existing /budget null/ assertion at the end of the turn-budget tool test fails when PI_WORKFLOW_BUDGET is set in the shell. That dependency predates this PR, so I left it alone.

Verification

  • bun run typecheck: clean
  • bun run test: 669 pass, 0 fail

The workflow tool's `budget` parameter let the host model pick a run's
output-token ceiling. Ceilings it guessed were often spent by the run's own
fan-out, so `agent()` refused the final synthesize stage and the run ended
without its report.

Only the user sets a budget now: a `+N` directive in the prompt caps every
tool run in that turn, and `/workflow --budget=` and `PI_WORKFLOW_BUDGET`
are unchanged. `resolveTurnBudget` loses its explicit-budget parameter. A
host that still sends `budget` has it ignored, since TypeBox objects allow
extra properties.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 08:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-23T08:04:40.648589Z 0a8c594 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@timbrinded
timbrinded merged commit 0a8c594 into master Oct 23, 2026
3 of 4 checks passed
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