runtime: carry synthesis-only tool transitions#187
Merged
Conversation
raphael
enabled auto-merge (squash)
July 20, 2026 03:13
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.
Summary
Rationale
A planner may know when its selected tool batch will provide all evidence needed
for the final answer. Previously, applications had to preserve that decision in
process-local state or infer it again from tool results. That is not correct in
a distributed Temporal runtime because the resume activity may execute on a
different worker.
PlanResult.SynthesizeAfterToolsnow records the decision on the selectedworkflow step. The workflow carries it as
PlanActivityInput.SynthesisOnlyandexposes it to
PlanResume. The resume activity rejects additional tool calls ornonterminal output, making the contract deterministic rather than advisory.
This is orthogonal to existing tool metadata:
Bookkeepingcontinues to own tool budget and failure-streak exemptions.TerminalRuncontinues to end the run from the tool result without anotherplanner turn.
continue to run before normal planner resume.
Synthesis-after-tools therefore requires at least one budgeted tool and rejects
terminal tools, ensuring the existing step classifier will produce the required
resume.
Validation
make lintgo test ./runtime/agent/runtime ./runtime/agent/planner ./runtime/agent/apigo test -race ./runtime/agent/engine/temporal -run TestSealRegistrationCanRetryAfterActivationTimeout -count=1make testcompleted all affected packages; one unrelated timing-sensitiveTemporal worker activation test failed in the full parallel suite and passed
when rerun alone under
-race