[STG-2284] fix(evals): default experimental to true on the SDK path - #2372
[STG-2284] fix(evals): default experimental to true on the SDK path#2372miguelg719 wants to merge 1 commit into
Conversation
|
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Extract resolveExperimental() so the SDK-default-ON / API-forced-OFF logic is unit-tested (addresses review: add regression test).
9e17805 to
3248fc3
Compare
|
Superseded by the Stagehand 4.0 retarget stack (#2757–#2762). Main moved to the 4.0 monorepo restructure (packages/core → packages/sdk-ts; evals package restructured), so this 3.x-era diff no longer applies. The OTEL/LangSmith tracing work — plus native-span capture via 4.0's global tracer and claude_code/codex agent spans — is reimplemented additively on 4.0 in the new stack. |
why
Running any agent eval through the verifier backend failed at V3 construction with
ExperimentalNotConfiguredError—Feature "Agent callbacks" is an experimental feature, and cannot be configured when disableAPI: false.initV3defaultedexperimental: falsewhenever a task passed no explicit value, butverifierAdapterinstalls agent callbacks (for trajectory recording) and hybrid agent mode also requires experimental. Core rejects both unless the instance is constructed withexperimental: true. The verifier-carrier instance inbenchHarnessalready sets it; the browser-driving instance did not.what changed
One line in
initV3.ts: when a task passes no explicitexperimentalvalue, default it toprocess.env.USE_API !== "true"instead offalse.This does not enable experimental in API mode. The default is gated on
USE_API, soUSE_API=truestill resolves toexperimental: false— identical to previous behavior. That gating is deliberate: core forbids the combination outright ("experimentalmode cannot be used together with the Stagehand API"), so experimental is only turned on wheredisableAPI: truealready holds, which is the pairing core requires.This flag is unrelated to OTEL tracing. Traces reach LangSmith/Braintrust through the harness-level
tracedSpan→ OTEL exporter path, which never reads V3 config — verified by emitting a full nestedtask → agent.execute → verifier.*tree with no V3 instance at all. What this flag unblocks is whether a verifier-backed run can start in SDK mode; the two only looked coupled because a run that fails at construction produces no spans.Pre-existing limitation this does not address: verifier-backed agent evals still cannot run in API mode, because core rejects experimental features whenever
disableAPI: falseregardless of the flag. Supporting that would need either core accepting agent callbacks in API mode, or the harness reconstructing the trajectory from the API response instead of callbacks.test plan
b:onlineMind2Web, hybrid, gemini-3-flash) which previously failed at init for every task and now completes and scores.USE_API=trueruns (resolves tofalse, as before). Note: an end-to-endUSE_API=truerun has not been exercised on this branch — the reasoning above is from the code path, so worth a confirmation run before relying on API-mode behavior.Stack 7/7 · base: #2371