Skip to content

Commit 0cf4fad

Browse files
authored
session: emit budget.session for --budget after the server limits rename (#76)
PR ellipsis#5846 renamed the AgentConfig spend-limit field from limits.run to budget.session, and AgentConfig is extra=forbid, so every `agent session start --budget <usd>` now fails with a 400 ("limits: Extra inputs are not permitted"). Map --budget to sugar.budget = { session: N } and update the stale limits.run examples in the help strings, README, and ellipsis skill.
1 parent fc38703 commit 0cf4fad

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ agent host delete beta # remove a host and its stored token
5454
agent session start --config <id> # start a session from a saved config
5555
agent session start --config-file f.json # ...or from an inline config
5656
agent session start --template welcome-to-ellipsis # ...or from a maintained template
57-
agent session start --config <id> --config-override "limits:\n run: 5" # override config fields for this session
57+
agent session start --config <id> --config-override "budget:\n session: 5" # override config fields for this session
5858
agent session start --config <id> --watch # start and immediately stream it
5959
agent session list --limit 20 # list recent sessions (filter by --source, --author, --days, …)
6060
agent session search "webhook retries" # search session history: transcripts, recaps, created PRs, similarity

skills/ellipsis/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ sandbox:
241241
repositories:
242242
- name: api
243243

244-
limits:
245-
run: 5.00
244+
budget:
245+
session: 5.00
246246
```
247247
248248
## Inside an Ellipsis sandbox

src/commands/session.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function registerSession(program: Command): void {
106106
)
107107
.option(
108108
'-o, --config-override <yaml>',
109-
'partial agent config (YAML/JSON) merged onto the chosen config for this session, e.g. "limits:\\n run: 5"',
109+
'partial agent config (YAML/JSON) merged onto the chosen config for this session, e.g. "budget:\\n session: 5"',
110110
)
111111
.option(
112112
'--config-override-file <path>',
@@ -127,7 +127,7 @@ export function registerSession(program: Command): void {
127127
'--rebuild',
128128
'skip the sandbox image cache: fresh full build (image layers, clones, image.setup), whose snapshot refreshes the cache',
129129
)
130-
.option('--budget <usd>', 'per-run spend limit in USD for this session (limits.run)', toNumber)
130+
.option('--budget <usd>', 'spend limit in USD for this session (budget.session)', toNumber)
131131
.option(
132132
'-p, --prompt <text>',
133133
"the session prompt, appended to the agent's initial user query (or pass it positionally)",
@@ -1029,7 +1029,7 @@ export function buildStartOverride(opts: {
10291029
if (opts.repo && opts.repo.length) sandbox.repositories = opts.repo.map(parseRepo)
10301030
if (Object.keys(sandbox).length) sugar.sandbox = sandbox
10311031

1032-
if (opts.budget !== undefined) sugar.limits = { run: opts.budget }
1032+
if (opts.budget !== undefined) sugar.budget = { session: opts.budget }
10331033

10341034
const merged = deepMerge(base, sugar)
10351035
return Object.keys(merged).length ? merged : undefined

test/session.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ describe('readConfigFile', () => {
103103
}
104104

105105
it('parses a .yaml file', () => {
106-
const path = write('cfg.yaml', 'name: demo\nlimits:\n run: 5\n')
107-
expect(readConfigFile(path)).toEqual({ name: 'demo', limits: { run: 5 } })
106+
const path = write('cfg.yaml', 'name: demo\nbudget:\n session: 5\n')
107+
expect(readConfigFile(path)).toEqual({ name: 'demo', budget: { session: 5 } })
108108
})
109109

110110
it('parses a .yml file', () => {
@@ -113,8 +113,8 @@ describe('readConfigFile', () => {
113113
})
114114

115115
it('parses a .json file', () => {
116-
const path = write('cfg.json', '{"name":"demo","limits":{"run":5}}')
117-
expect(readConfigFile(path)).toEqual({ name: 'demo', limits: { run: 5 } })
116+
const path = write('cfg.json', '{"name":"demo","budget":{"session":5}}')
117+
expect(readConfigFile(path)).toEqual({ name: 'demo', budget: { session: 5 } })
118118
})
119119

120120
it('falls back to YAML for unknown extensions (JSON is valid YAML)', () => {
@@ -152,10 +152,10 @@ describe('applyConfigOverride', () => {
152152
})
153153

154154
it('reads and parses a file override into the structured mapping', () => {
155-
const path = write('override.yaml', 'limits:\n run: 5\n')
155+
const path = write('override.yaml', 'budget:\n session: 5\n')
156156
const req: { config_override?: Record<string, unknown>; config_override_yaml?: string } = {}
157157
applyConfigOverride(req, { configOverrideFile: path })
158-
expect(req).toEqual({ config_override: { limits: { run: 5 } } })
158+
expect(req).toEqual({ config_override: { budget: { session: 5 } } })
159159
})
160160

161161
it('rejects passing both inline and file forms', () => {
@@ -214,7 +214,7 @@ describe('buildStartOverride', () => {
214214
compute: { cpu: 2, memory: '8GB', timeout: '30m' },
215215
repositories: [{ owner: 'ellipsis-dev', name: 'ellipsis' }, { name: 'solo' }],
216216
},
217-
limits: { run: 0.5 },
217+
budget: { session: 0.5 },
218218
})
219219
})
220220

@@ -231,9 +231,9 @@ describe('buildStartOverride', () => {
231231
})
232232

233233
it('uses a file override as the base', () => {
234-
const path = write('base.yaml', 'limits:\n run: 1\n')
234+
const path = write('base.yaml', 'budget:\n session: 1\n')
235235
expect(buildStartOverride({ configOverrideFile: path, budget: 5 })).toEqual({
236-
limits: { run: 5 },
236+
budget: { session: 5 },
237237
})
238238
})
239239

0 commit comments

Comments
 (0)