diff --git a/src/commands/run.tsx b/src/commands/run.tsx index 457a5ab..7657037 100644 --- a/src/commands/run.tsx +++ b/src/commands/run.tsx @@ -43,7 +43,11 @@ export function registerRun(program: Command): void { '-t, --template ', 'start from a maintained run template (e.g. welcome-to-ellipsis)', ) - .option('-b, --budget ', 'per-run budget override in USD', parseFloat) + .option( + '-b, --budget ', + "per-run budget override in USD (sets the config's limits.run for this run)", + parseFloat, + ) .option( '-m, --metadata ', 'attach metadata (repeatable)', @@ -81,7 +85,11 @@ export function registerRun(program: Command): void { if (opts.config) req.config_id = opts.config if (opts.configFile) req.config = readJsonFile(opts.configFile) if (opts.template) req.template_id = opts.template - if (opts.budget !== undefined) req.budget_usd = opts.budget + // A budget is expressed as a config override of limits.run (the server + // merges it onto the chosen config and re-validates). + if (opts.budget !== undefined) { + req.config_override_yaml = `limits:\n run: ${opts.budget}` + } const api = new ApiClient() const run = await api.startAgentRun(req) diff --git a/src/lib/types.ts b/src/lib/types.ts index f24a353..aa214bc 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -132,7 +132,10 @@ export interface StartAgentRunRequest { template_id?: string source?: AgentRunSource metadata?: Record - budget_usd?: number + // A partial agent config (YAML) merged onto the chosen config and re-validated + // server-side, e.g. "limits:\n run: 5.0" to set just this run's budget. Only + // meaningful with config_id/template_id. + config_override_yaml?: string } export interface ListAgentRunsResponse {