Repository navigation
chore: release v0.59.1 - #373
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Nov 20, 2026
…sAt (#1068) <!-- stamp:review:v1 --> <sup><img src="https://api.raft.build/api/avatars/pixel/ZXll.svg" width="16" height="16" align="absmiddle" alt=""> <b>Lookout</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup>opened from existing branch <code>agent/lookout/antigravity-midturn-quota</code> @ <code>e15e9e6fd2ba</code>, which the agent did not push</sup><br><sup><a href="https://stamp.build/review?receipt=prc_079bd7ce2960e5bdc9581d2c6bea4ff1"><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 --> ## Summary Classify Antigravity (`agy`) individual-quota notices that arrive mid-turn after earlier tool work as `{ kind: "failed", failure: "quota", reason, resetsAt }` instead of `completed`, while preserving earlier whole-turn token spend and keeping normal model text that quotes or echoes the notice classified as `completed`. Fixes the class reported in `#core:#373`. ## Measured Distinguishing Signal Inspected all 42 recorded turns with assistant text across 18 Harbor `agy 1.5.12`/`1.5.13` voyages (2026-11-19) and ran local loopback Gemini provider controls against `agy 1.5.13` (no real quota spent): 1. **Recorded Harbor voyages (42 turns: 37 normal + 5 real quota hits):** - **37 / 37 normal turns** emitted a trailing `usage_update` frame after the final `agent_message_chunk` (including after native context compaction), right before `session/prompt`. - **5 / 5 real quota turns** (1 turn-start without `usage`, 3 mid-turn after tool work with prior `usage` on `session/prompt`, and 1 mid-turn after a superseded `steer` + tools without `usage` on the final `session/prompt`) emitted `"\n⚠ Individual quota reached. Please upgrade your subscription to increase your limits. Resets in <countdown>.\n"` as the entire assistant text after the last tool call / `session/prompt`, with **no** `agent_thought_chunk` in that final step and **no** `usage_update` after the notice. 2. **Local `agy 1.5.13` loopback controls (`GOOGLE_GEMINI_BASE_URL` on `127.0.0.1`):** - Model echoes exact notice directly (`echo-direct`): emits trailing `usage_update` after `agent_message_chunk` and `usage` on `session/prompt`. - Model thinks then echoes exact notice (`echo-with-thought`): emits `agent_thought_chunk`, `agent_message_chunk`, trailing `usage_update`, and `usage` on `session/prompt`. - Model runs `mcp_echo_echo`, then echoes exact notice with growing `totalTokenCount` (`108 -> 158`, `echo-after-tool-growing-usage`): emits trailing `usage_update` (`used: 158`) after `agent_message_chunk`. - **Known wire-level boundary (`echo-after-tool-same-usage`):** `agy` deduplicates `usage_update` when `totalTokenCount` is unchanged (`108 -> 108`). A synthetic model reply after a tool call that emits zero thought chunks, outputs the exact `\n⚠ ...\n` boilerplate with no other characters, and returns the exact same context token count as the previous step produces identical ACP frames and cannot be distinguished on the wire. Documented explicitly in `docs/runtimes/antigravity.md`. ## Changes - `packages/oar/src/runtimes/antigravity/quota.ts`: - Evaluate the trailing assistant text segment after the last `tool_call` / `tool_call_update` / superseded `session/prompt` in the root turn. - Reject when any `usage_update` arrives after the notice text, when any `agent_thought_chunk` / `toApp` request / unknown frame appears in that final step, or when no prior tool ran in the current prompt window and `session/prompt` carries `usage`. - Reset the prompt-usage window (`priorTool = false`) on a superseded `session/prompt` frame so steer turns only allow `usage` on the final prompt when tool work ran after the superseded prompt. - `tests/acp/acp-antigravity-quota.test.ts`: - Added recorded mid-turn quota tests (with prior `usage` verifying earlier spend is still accumulated in `session.usage()` and `session.contextUsage()`, after earlier assistant text + tool call, and without `usage` after steer + tool call). - Added mid-turn model-echo negative controls (trailing `usage_update`, final-step `agent_thought_chunk`, surrounding text, notice followed by a tool call, and echoed notice with `usage` after a superseded `session/prompt`). - `docs/runtimes/antigravity.md`: - Updated the quota-notice section and Failures table with mid-turn behavior, measured frame signals, earlier-spend preservation, and the same-context-count wire boundary. ## Call-Site Audit Grepped all references to `antigravityQuotaNotice`, `antigravityQuotaError`, and `promptOutcome`: - **Changed:** `packages/oar/src/runtimes/antigravity/quota.ts` (`antigravityQuotaNotice`, invoked via `antigravityAcpProfile.promptOutcome` in `packages/oar/src/runtimes/antigravity/session.ts:44`). - **Unchanged (verified):** - `packages/oar/src/shared/acp/turns.ts:146-154`: passes `rootTurnRecords` to `profile.promptOutcome` and still emits `frame.context` (`promptUsage(result)`) alongside a failed `turn_ended` outcome, so earlier mid-turn spend is preserved automatically. - `packages/oar/src/runtimes/antigravity/quota.ts` (`antigravityQuotaError`): handles RPC error envelopes (`session/prompt/error`), unaffected by mid-turn `end_turn` notices. - `packages/oar/src/runtimes/codebuddy/session.ts:19` (`codebuddyPromptOutcome`): classifies native `_meta["codebuddy.ai/errorMessage"]` / `refusal`, unrelated. - `packages/oar/src/runtimes/grok/session.ts:190` (`grokPromptOutcome`): classifies structured-output refusal, unrelated. ## Verification - Replayed `antigravityQuotaNotice` against all 42 recorded Harbor turns: `5/5` real quota turns classified as `failed: quota` with `resetsAt`, `37/37` normal turns returned `null` (`completed`), and `0` superseded `session/prompt` frames matched. - Ran `CI=1 pnpm run check` locally (typecheck, oxlint, full vitest suite, and mock sea-trial suite). Co-authored-by: Lookout <[email protected]>
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.
Release OAR and CLI 0.59.1. This PR changes only the two package version fields.
Fixed: invalid session names are an
UnsupportedOptionError(#372)SessionOptions.name, or one with a NUL character, now rejects withUnsupportedOptionErroronnamebefore anything starts, as invalidadditionalDirectoriesalready do. This applies on claude, codex and pi, the runtimes that take a name.Error, which a host catching by type missed. A name with a NUL reached claude's command line and failed in Node's spawn.Behavior change
UnsupportedOptionErrorinstead of a plainError.Validation: #372 passed all 17 checks on its final head, and its merged tree equals its CI tree. Found by Lookout's daily inspection of 0.59.0. After this PR passes CI and merges, tag its exact squash commit as
v0.59.1to trigger npm trusted publishing.🤖 Generated with Claude Code