SDK design improvements: fold operator surface into @benchsdk/runner and add ergonomics/observability - #375
Open
dtice25 wants to merge 35 commits into
Open
SDK design improvements: fold operator surface into @benchsdk/runner and add ergonomics/observability#375dtice25 wants to merge 35 commits into
dtice25 wants to merge 35 commits into
Conversation
… bench check, telemetry observability, config validation, and diagnostics Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor License AgreementAll contributors are covered by a CLA. |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
devin/1787847959-benchsdk-operator-runner
branch
from
August 27, 2026 17:01
4094563 to
d43f867
Compare
…and improved error pretty-printing Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Note
This report is out of date. Scroll down for Devin Review's latest report on this PR.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 Scale image build loses dependencies
pnpm install --frozen-lockfile cannot link the omitted runner workspace required by @benchsdk/client. The runner also requires the omitted CLI workspace, so scale image builds stop before bundling.
9 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- runCheck now validates task export, parses providers with parseCliArgs, forwards --config, and supports --base-url/--api-key. - runBenchmarkFile strips --base-url/--api-key before passing flags to runBenchmark. - validateBenchmarkConfig enforces compositeScore defaultMetric requires scoring/onScore. - Telemetry error callbacks are wrapped in try/catch; system-metrics upload errors are reported via handleTelemetryError. - shiftFlag rejects missing values so control flags are not consumed. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
devin/1787847959-benchsdk-operator-runner
branch
from
September 8, 2026 19:43
1d0f630 to
3935de3
Compare
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… --dry-run Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… original error - Stop splicing pending records before a successful send; on API failure the batch is kept so the next flush can retry. - Track the original flush error and rethrow it from the final flush so runWorker still fails with BenchmarkApiError. - Remove the lowercase-slug regex from benchmarkSlug validation so existing benchmarks using DAILY_BENCH_SLUG env values (uppercase/underscores) are not rejected. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add README for @benchsdk/cli documenting auth/config, env vars, and commands. - Make printData honor --format table for objects and add unit tests. - Re-export resolveAuth/createApiClient/AuthError/CliAuth from @benchsdk/runner. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…dard - @benchsdk/cli printData now prints 'No results.' for empty objects. - @benchsdk/runner validates bench.config.ts/.benchrc values and removes apiKey from project config in favor of apiKeyEnv. - @benchsdk/worker invokes onTelemetryError for completeWorker/failWorker failures in the normal completion path. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… and bench check flag parsing - validateBenchmarkConfig no longer crashes when phases/participants/shapes entries are null or primitives - bench check now uses shiftFlag for --base-url/--api-key with required-value semantics - add regression tests for malformed phases, participants, shapes, and valueless check flags Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…requiredEnvVars - Make BaseParticipant.requiredEnvVars optional and normalize missing/non-array values to an empty list. - Add unit tests for filterParticipantsByEnv and selectParticipants. - Update changeset. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ics 'importing' status Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… and reject --config consuming flags Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the SDK-design improvements we discussed:
@benchsdk/runneris now the canonical operator package,@benchsdk/clientis a compatibility re-export shim, and a set of ergonomics/observability/validation fixes round out the surface.Breaking
TaskStepOptions.concurrencyis renamed toparallelInvocationsto avoid ambiguity withconfig.concurrency(max in-flight tasks). The old field is still accepted and logs a one-time deprecation warning.runWorkeris now a free function:runWorker(client, options). The legacycreateBenchmarkClient().runWorker(options)spelling is preserved in@benchsdk/client.Added
runBenchmarkWorker(options)one-shot operator helper in@benchsdk/runner— run a single participant's worker without a*.bench.tsfile.bench check <file.bench.ts>CLI command validates env vars, API connectivity, participant availability, and scoring weights before a run.validateBenchmarkConfig(config)returns structured{ field, message }[];defineBenchmarkConfigthrowsBenchmarkConfigErrorwith the same shape.defineOnComplete(handler)helper for typedonCompletecallbacks.RunWorkerOptions.processKeynow defaults toos.hostname().RunWorkerOptions.onTelemetryError/BenchmarkReporterConfig.onTelemetryErrorcallbacks expose heartbeat/log-upload/artifact telemetry failures.TaskErrornow includesstep,timeoutMs, and participant context for step timeouts.Fixed
console.warnby default instead of failing silently.@benchsdk/clientpublic API contract test now derives the expected type/value surface from@benchsdk/runnerrather than a hand-maintained list.Package boundaries
@benchsdk/clientnow depends only on@benchsdk/runnerand re-exports its entire surface.createBenchmarkClientis a thin wrapper that attaches the legacyrunWorkermethod.@benchsdk/runnerre-exports the low-level worker/API primitives (runWorker,BenchmarkReporter,createBenchmarkClient, etc.) so operators can import from one package.Verification
pnpm typecheckpasses.pnpm --filter @benchsdk/runner testpasses (96 tests).pnpm --filter @benchsdk/client testpasses (122 tests).pnpm exec bench run examples/*.bench.ts --dry-runandpnpm exec bench check examples/*.bench.ts --dry-runpass for all examples.Link to Devin session: https://app.devin.ai/sessions/f67b6ba526fe43619684b90f0d19e045
Open in Devin Desktop: https://app.devin.ai/desktop/session/f67b6ba526fe43619684b90f0d19e045?variant=devin
Requested by: @dtice25