Skip to content

0.132.0: An OpenAI participant's closing report reads the prompt cache

Choose a tag to compare

@danielgwilson danielgwilson released this 13 Oct 21:40
· 149 commits to main since this release
11463da

humanish 0.132.0 cuts the cost of an OpenAI computer-use participant's closing report. The closing
report and impressions requests set text.format, which is part of the prompt cache's prefix, so
each one was billed as a fresh write of the whole session: 25% to 42% of a run's model spend in the
8 runs measured on 0.131.0. They now send the schema in their input instead and read the session
from the cache. In two live 12-minute runs the closing request cost $0.026 and $0.025 where it
would have cost $0.14. A reply that does not match the schema is asked once more with the strict
schema, after the same budget and time checks.

Added

  • CuaTurn.closingRetry: a computer-use provider may set it on a closing reply that was not the JSON its request asked for. The loop then calls the same closing method once more, after the budget and time checks the first request passed and with a time bound of its own, and counts.debriefCalls counts each request. A provider that never sets it keeps one closing request. (#1862, #1865)

Fixes

  • An OpenAI computer-use participant's closing report and impressions requests now read the session from the prompt cache. They set text.format, which is part of the cached prefix, so the closing request read 0 cached input tokens in all 8 measured 0.131.0 runs and was 25% to 42% of each run's model spend. They now send no text.format and state the JSON Schema in their input. The reply's JSON is checked locally against the stated schema, so a report without outcome or impressions does not pass, and it may sit in a code fence or follow a message of its own. A completed reply that does not match, apart from a refusal, is asked once more with the strict schema, after the same budget and time checks as the first and with a time bound of its own. If that second request is skipped or fails, the first reply stands and the debrief reason says why. Each closing request that reports usage has its own tokenUsage.turns row, and counts.debriefCalls counts each request. (#1862, #1865)

Measured before and after

The same study (one participant watching a static page for 12 minutes until its scheduled end, then giving its closing report) ran on 0.131.1 and on the 0.132.0 tarball at the same time:

0.131.1 0.132.0
Closing request input tokens 27,320 27,275
Read from the cache 0 25,056
Closing request cost $0.142 $0.026
Closing share of the run's model spend 41.8% 11.3%
Run model spend $0.341 $0.234

Both reports were complete (outcome reached, summary, friction, impressions), and each needed one request. On try-live, the impressions request read 18,067 of its 18,561 input tokens from the cache.

Checked before release

  • CI on this PR is the gate of record. pnpm gate on the release commit passed.
  • The post-publish check rehearsed on the release tarball (pnpm packed:check): 124 of 125 rows passed. Row 44 (Ctrl-C at the watch prompt) failed on the check's own transcript parse: the terminal echoed ^C before the prompt's line break, so the line read watching: press Ctrl-C to stop^Cwatch stopped. watch and observe printed their stopped lines in 6 of 6 runs. The parse is fixed in a separate PR.
  • pnpm release:dogfood: a participant installed the tarball and ran the offline first-run study (share_ready, 16 of 16 checks, $0).
  • Live on the release tarball, on hosted E2B desktops: the before/after study above, and try-live with analysis. Each run passed humanish verify (local_only) and humanish reclaim --check.
  • Before merge (#1865): a Claude review and two Codex reviews found 10 defects in the first versions, each fixed with a test that failed first. Two live 12-minute runs from source read 25,114 of 27,338 and 24,810 of 27,019 closing input tokens from the cache.

Not verified

  • The strict retry live: every live closing so far parsed on the first request, so how often gpt-5.6-sol misses the JSON without text.format is unmeasured.
  • Sessions longer than 12 minutes, and closing latency against the 30 s bound on a long session.
  • ZDR explicit context and requireReportedUsageForSpendCap live (unit tests only).
  • A third-party CuaProvider port that sets closingRetry.

Package

humanish@0.132.0: 1012 files, shasum bb013977257e32f52666b472bda69a8239c22c95 (the local tarball has the same shasum).

🤖 Generated with Claude Code