Repository navigation
fix(dream): re-ask a oneshot prose skip for the JSON contract so it is banked (#9648) - #9651
Masashi-Ono0611 wants to merge 2 commits into
Conversation
…s banked (garrytan#9648) Related to garrytan#9648 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thanks for this pull request, @Masashi-Ono0611. Here is how we handle outside pull requests, so you know what to expect:
When we rebuild a change, we close this PR with a link to the PR that landed it. When we don't take one, we close it with a short note saying why and what would change our answer. So apart from documentation, "closed, not merged" is the normal outcome and doesn't mean your work was turned down. For a larger change, show us:
A limit of 3 open pull requests applies only to someone whose recent pull requests have mostly been closed without being taken. It never applies to anyone who has had a pull request taken (merged or rebuilt) in the last 90 days. More in CONTRIBUTING.md, "How an outside pull request is handled": https://github.com/garrytan/gbrain/blob/master/CONTRIBUTING.md#how-an-outside-pull-request-is-handled This comment comes from the fix-wave gate check. It is red on every outside pull request by design, and a maintainer clears it when merging a documentation change. |
…ytan#9648) Related to garrytan#9648 Hold the oneshot child to the JSON contract with one re-ask so a prose skip is banked instead of dead-lettering. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for this, @Masashi-Ono0611. It gives the oneshot dream synthesis one re-ask for the JSON skip when the model answers in prose, so the skip is recorded and the transcript isn't paid for again every cycle (#9648). That was fixed on the main branch in #9840, which takes the same approach of asking once more for the JSON skip, and it's in v0.60.749.0 and later. So I'm closing this one. If a prose skip still dead-letters on a release with that change, reply here with what you see. |
Related to #9648
When the oneshot synthesize child decides nothing meets the bar but answers in prose instead of the skip JSON,
parseOneshotResponsereturns null, the job falls through to the agentic loop, and underrequire_writesit dead-letters with no skip banked, so the same transcript is re-synthesized every cycle.This change gives an unparseable, non-truncated, non-empty reply one bounded re-ask that restates the JSON contract (the call goes through the same rate lease and sub-budget). A parsed re-ask (skip or pages) continues through the existing validation and skip-banking path. If the re-ask is still unparseable, behavior is unchanged: the same
unparseablefallback with the original attempt's token rollup (the re-ask's usage is still charged to the job). Truncated (length) and refused outputs are not re-asked.The diff is mostly indentation: the lease + chat call moved into a local
callOnceclosure so it can run twice.Test:
test/minions/subagent-oneshot-prose-skip.test.ts(fails on base with a failed expect: outcome isfallback; passes with the fix). Existing oneshot and subagent-handler suites pass.Siblings checked: the agentic-loop prose ending is untouched; no prose-to-skip heuristic is introduced.
Discrimination test
Discrimination test: reverted
src/core/minions/handlers/subagent-oneshot.tstodd2f111a4e17, ranbun test test/minions/subagent-oneshot-prose-skip.test.ts→ fails without the fix. Restored → passes with the fix (T-0 recheck: proceed at master dd2f111; pass/fail counts were not captured by the T-0 runner).Reproduced on latest master dd2f111 right before submission.
Verification
Tests
test/minions/subagent-oneshot-prose-skip.test.ts(added or changed by this PR)bun test test/minions/subagent-oneshot-prose-skip.test.ts: fails without the fix, passes with it (T-0 recheck: proceed at master dd2f111; pass/fail counts not captured)