feat: expose taskBudget SDK option as task_budget action input#1376
feat: expose taskBudget SDK option as task_budget action input#1376rsd-darshan wants to merge 1 commit into
Conversation
Wires the SDK's taskBudget.total option through the full stack so users can set an API-side token budget from the action layer. Previously the option was silently ignored even though the SDK has supported it since v0.2.84.
|
Hey @brianatdetections — this PR implements Option B from your request. The |
Thanks! Will update and test later this week, looks good though. |
|
This is ready for maintainer review. I verified all CI checks pass locally against the PR head (
The change is minimal (16 lines, no deletions) and mirrors the existing Closes #1329. @ashwin-ant — since this is an external PR, CI is held pending a maintainer "Approve and run workflows", and the approvals so far are from non-write accounts so they don't satisfy branch protection. Could you approve the workflow run and take a review pass when you get a chance? Happy to address anything. |
Summary
Closes #1329.
The SDK has supported
taskBudgetsince v0.2.84 but there was no way to set it from the action layer — passing--task-budgetviaclaude_argswas silently ignored because the CLI doesn't recognise that flag.task_budgetinput to bothaction.ymlandbase-action/action.ymltaskBudget?: stringtoClaudeOptionsinbase-action/src/run-claude.tsparseSdkOptionsassdkOptions.taskBudget = { total: parseInt(...) }(same pattern asmaxTurns)INPUT_TASK_BUDGETenv var from both action entrypoints (base-action/src/index.tsandsrc/entrypoints/run.ts)Test plan
task_budget: 200000in a workflow using this action and confirm the SDK receivestaskBudget: { total: 200000 }(visible in step debug output withshow_full_output: true)task_budgetleaves the fieldundefined— no change in existing behaviourmaxTurns(parseIntproducesNaN, SDK rejects it at runtime)