Repository navigation
feat(cache-warming): Warm after a Turn that ends with noReply - #3162
Merged
Merged
Conversation
A noReply call stops the run after its tool batch, so no final response starts an idle period. Start it from the request of the noReply call, outside Automation runs. Add app.cache_warming.turn_ending (reply or no_reply) to the warmup span and the returned log. Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
marked this pull request as ready for review
November 11, 2026 09:13
BYK
approved these changes
Nov 11, 2026
Contributor
|
13 screenshot changes — 13 changed · 0 added · 0 removed Review screenshots in Frameshift Show 7 more changed screenshots |
BYK
enabled auto-merge (squash)
November 11, 2026 09:40
…-reply Co-Authored-By: BYK <[email protected]> # Conflicts: # packages/junior/src/chat/cache-warming/warmup.ts
23 tasks done
BYK
added a commit
that referenced
this pull request
Nov 11, 2026
**Cause.** A run that ends with `reportBlocked` stops right after that tool batch, as `noReply` does. No final response comes, so the Turn starts no idle period. A child agent that ends blocked never warms, even though its parent often answers. **Change** - The recorder method `noReplyEnded()` becomes `answerToolEnded(toolName, gated)`. The agent calls it for every answer tool that ends the run. The recorder maps the core tool names: `noReply` gives `no_reply`, `reportBlocked` gives `blocked`. Gated Automation runs still start no idle period. The decision now lives in the recorder, so the scenario test covers it. - `stop()` starts the idle period from the `reportBlocked` request, the same way it does for `noReply` (#3162). That request holds the prefix that the next Turn reads: the next request appends the assistant tool call, its result and the new input to it. - `app.cache_warming.turn_ending` gets a new value, `blocked`. That keeps `no_reply` meaning `noReply` only. It is documented in the `runCacheWarmup` JSDoc. **Tests** (`cache-warming-segments.test.ts`): the #3162 case now runs for both `noReply` and `reportBlocked`. - A gated run schedules nothing. - A non-gated run schedules a warmup and records the return gap. - Without the `reportBlocked` mapping, the `reportBlocked` case fails. No UI change. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A062fdc35bb40fd08d6b121c930cdc7fb --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A062fdc35bb40fd08d6b121c930cdc7fb) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A062fdc35bb40fd08d6b121c930cdc7fb/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
This branch was successfully deployed
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.
Cause: a
noReplycall ends the run after its tool batch. An idle period starts only from a final response (stopReason: "stop"), so a Turn that ends withnoReplynever starts one. Its next Turn writes the whole prefix again.Change:
noReplyends the run, the agent marks this on the cache warming recorder.stop()then starts the normal idle period from the request that callednoReply: same snapshot, segment, work state, parent prior and system prompt check. The gap is recorded on return like any other.noReplystarts no idle period, because an ended run almost never gets a reply. Since feat(automations): Answer Automation runs with reply, noReply and reportBlocked #3145,noReplyreplacesfinishAutomationRunin Automation runs, so the gate isbehavior.gated.noReplyrequest even when earlier calls came first in the Turn.app.cache_warming.turn_ending(replyorno_reply) on thecache_warming.warmupspan and thecache_warming.conversation.returnedlog, so reports can group warmups, skips and returns by it.Prefix: the snapshot is the input of the
noReplyrequest, and that request wrote or read the cache for it. Next Turn's input adds thenoReplycall, its result and the new message to that input. History keepsnoReplycalls unchanged, so the warmup refreshes the same prefix that the next Turn reads. A final response works the same way.Before merge: check the gain against the 11-17 full-week backtest.
No UI change.
via @BYK.
--
View Session [Sentry]