Repository navigation
fix(testing): refuse an effort on the scripted runtime with UnsupportedOptionError - #846
Closed
TennyZhuang wants to merge 1 commit into
Closed
TennyZhuang wants to merge 1 commit into
TennyZhuang wants to merge 1 commit into
Conversation
…edOptionError `scriptedRuntime` refused `SessionOptions.effort` with a plain `Error`. The contract says a runtime with no effort channel rejects with an `UnsupportedOptionError` on `effort`, as every other option a runtime cannot honor, so a host can tell "not this runtime" from a failure without reading the message. The message is unchanged. It is not declared in `refusedSessionOptions`: `effort` is not a `RefusableSessionOption`, and a host already learns which runtimes take an effort from `listModels`' `effortLevels`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 16, 2026
stamp-build Bot
added a commit
that referenced
this pull request
Nov 16, 2026
…847) <!-- stamp:review:v1 --> <sup><img src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp" width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_b8d81bbbd635dd7c987fb912cf5a57c3"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> Hosts could only make a scripted session exit by disposing it, so they could not exercise an unexpected runtime exit. Add `ScriptedTurn.exit(code?)`: a standalone `exited` response ends an active turn through the existing folds, discards held inputs, aborts the script signal and suppresses later frames and task reports. An exit while idle keeps the previous turn outcome; disposal after exit is accepted without a second exit record. Unchanged cherry-pick of TennyZhuang's #845 (`bc446c43a72f7cf1a779d5141341b805cb50e587`), preserving the original author and commit message. Thanks to TennyZhuang and Airwing for the implementation and regression cases. This Stamp PR supplies the repository CI and review path; the original PR will be closed with thanks after this merges. Validation: full `CI=1 pnpm run check` passed (4,481 unit tests and 18 mock behavior cases); `OAR_TEST=scripted pnpm sea-trial` passed 17 cases with 2 expected skips. Six exit regressions cover active/idle exit, queue dropping, observers, rejected controls, disposal and late task reports. The cherry-picked tree matches the reviewed fork commit byte for byte. Merge before the companion effort-refusal change #848 (from #846). That change will be rebased onto this merge and checked again before merging. Co-authored-by: TennyZhuang <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Nov 16, 2026
…848) <!-- stamp:review:v1 --> <sup><img src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp" width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_bf6910859c4934437f867e22f03d02f8"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> `scriptedRuntime` rejected a requested effort with a plain Error. It now throws `UnsupportedOptionError` with `option: "effort"`, retaining the existing message so hosts can classify the refusal without parsing prose. A regression checks the error type, option and requested level. Unchanged cherry-pick of TennyZhuang's #846 (`87b4d3a48e8e1155262887ffedc8bed58921995a`), preserving the original author and commit message. Thanks to TennyZhuang and Airwing for the fix. This Stamp PR supplies the repository CI and review path; the original PR will be closed with thanks after this merges. Validation: full `CI=1 pnpm run check` passed (4,484 unit tests and 18 mock behavior cases); `OAR_TEST=scripted pnpm sea-trial` passed 17 cases with 2 expected skips. The effort-refusal patch is unchanged from the reviewed fork commit. Based on #847's merged exit fix (`8e7db6503054dfbbb054b4b13efb03e6de41e743`), with full checks rerun on the combined source. No expansion of `RefusableSessionOption` is included. Co-authored-by: TennyZhuang <[email protected]>
Contributor
|
Closed by Otter, an agent of Reason: Thank you, TennyZhuang, for this fix. It has been merged through #848 as 4572f67, preserving your original authorship and patch. All 41 CI checks passed. Closing this original PR now that the change is on main.
|
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.
What changes and why
scriptedRuntimerefusedSessionOptions.effortwith a plainError. The contract onSessionOptions.effortsays a runtime with no effort channel "rejects with anUnsupportedOptionErroroneffort".docs/design/capabilities.md§2 says the same about an option a runtime cannot take at all: the typed error lets a host tell "not this runtime" from a failure without reading prose. The scripted runtime now throwsnew UnsupportedOptionError("effort", …)with the same message as before.Not declared in
refusedSessionOptions:effortis not aRefusableSessionOption, and no built-in runtime declares an effort refusal. Their effort refusals are thrown directly withUnsupportedOptionError("effort", …)(ACPshared/acp/effort.ts, dsh, factory, antigravity).listModels'effortLevels, and the scripted runtime has nolistModels.How it was verified
tests/scripted-runtime.test.tsasserts the open rejects with anUnsupportedOptionErrorcarryingoption: "effort"and the message naming the level. It fails on main.OAR_TEST=scripted pnpm sea-trialpassed (session.effort-never-substitutedpasses; the listModels case skips as before).CI=1 pnpm run checkpassed: 494 test files passed / 120 skipped, 4450 tests passed / 595 skipped, mock behavior 18 passed / 1 skipped. After that run, a comment in the change was shortened by one line so it merges with the exit PR under the 300-line lint limit. Lint, typecheck, the affected test files and the scripted behavior suite were re-run on the final commit and passed.15d762c. The branch has since been rebased onto83efa1e(current main) with no conflicts; on the rebased commit I re-ran typecheck, lint, the scripted test files andOAR_TEST=scripted pnpm sea-trial(17 passed, 2 skipped), all passing. The fullcheckwas not re-run after the rebase.For reviewers to look at closely
refusedSessionOptionsdecision above. If you'd rather makeeffortdeclarable, that is a wider change: the public type,refuseSessionOptions, and the registry tests intests/refused-session-options.test.ts.community/morphalso refuses effort with a plainError(community/morph/session.ts:80). It is left alone here to keep this PR to the scripted runtime; it could follow separately.🤖 Generated with Claude Code