Skip to content

feat(runtime): resolve capacity per eval - #38

Merged
gjtorikian merged 2 commits into
mainfrom
feat/runtime-capacity-per-eval
Oct 16, 2026
Merged

gjtorikian merged 2 commits into
mainfrom
feat/runtime-capacity-per-eval

Conversation

@gjtorikian

Copy link
Copy Markdown
Collaborator

Summary

  • Runtime.capacity accepts a resolver (metadata) => { key, limit } | undefined beside the static { key, limit }. The scheduler asks it per attempt with the eval's metadata, so an eval that consumes no pooled resource answers undefined and never waits for or holds a slot.
  • Why: in workos/evals the WorkOS runtime reserves a workos-pool slot for every attempt in pool mode, including the no-credentials eval that provisions nothing (evals#20 review thread 11). The eval could not opt out because capacity was fixed when the runtime was constructed.
  • A resolver is a capability function, so the run manifest hashes it as absent, the way containerImage and egressHosts resolvers are; the static form stays part of the experiment's identity. RuntimeCapacity is exported for consumers.
  • Tests: static vs resolver vs none in tests/capacity.test.ts, plus a manifest check that a static capacity enters the runtime hash and a resolver does not. Docs: docs/extensions.md.
  • Gates: bun run typecheck, bun run lint, full bun test (one failure is the known Docker-absence case in tests/mcp-proxy.test.ts, which passes with a daemon). No consumer name in harness code.

A runtime's capacity was fixed at construction, so every attempt under it
held a slot in the shared pool, including evals that consume none of the
pooled resource: a consumer's no-credentials eval provisions nothing from
the pool yet still waited for and occupied a pool slot, throttling the
attempts that needed one.

capacity now also accepts a resolver over the eval's metadata, answering
undefined for an eval that needs no slot. The scheduler asks it per
attempt. A resolver is a capability function, so it leaves the experiment
identity like containerImage does; the static form stays identity.
@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the added scheduler test addresses the previous finding.

Summary

Adds per-eval capacity selection through Runtime.capacity.

  • Runtime capacity can now be chosen for each eval.

No new actionable issues were found. Tests were not run during this review.

Reviews (2) · Last reviewed commit: "test(runtime): prove an exempt eval star..." · Reviewed by Greptile

Comment thread tests/capacity.test.ts Resolved
Greptile's finding on #38: the resolver was tested in isolation, so the
scheduler could regress to holding a slot for an exempt eval without a
test noticing. Drive the resolver through schedule() and assert the
exempt attempt runs beside the slot holder while the second pooled
attempt waits.
@gjtorikian
gjtorikian merged commit 21b75b7 into main Oct 16, 2026
13 checks passed
@gjtorikian
gjtorikian deleted the feat/runtime-capacity-per-eval branch October 16, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant