Repository navigation
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
289f93b to
3434d80
Compare
de37977 to
d2db32f
Compare
3434d80 to
abca188
Compare
d2db32f to
a5b5d00
Compare
abca188 to
542f4c2
Compare
a5b5d00 to
10af0ac
Compare
542f4c2 to
1e2f3e7
Compare
10af0ac to
039a3b1
Compare
A whole-step activity holds the provider attempt and every tool under one timeout and one retry policy, so a tool waiting on a human or hanging takes the attempt with it. Behind `OPENCODE_TEMPORAL_STEPPED=1` the workflow drives the three units itself, under one owner token per step, with the tool arguments read off the log and a stop closing the step it cut short.
039a3b1 to
c5cfa3b
Compare
827a2fc to
a497d3b
Compare
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
This PR splits one step of a session turn into three activities instead of one, behind
OPENCODE_TEMPORAL_STEPPED=1. Off by default.Until now the smallest durable unit was a step: one model call plus every tool it asked for, in a single activity. Nothing could sit between the model asking for a tool and the tool running, so per-tool retry policies, per-tool timeouts, approval gates and budgets had nowhere to live.
SessionRunner.runModelCallperforms the attempt, records each call asTool.Called, and hands the calls back instead of running them.runToolCallsettles one call.sealSteptakes the end snapshot, diffs it against the start, and publishesStep.Ended. The loop between them is workflow code (stepped-turn.ts). The supervisor is untouched: it only ever called onerunTurnStep, so the stepped mode supplies a different one.What has to hold, and has a test for it:
runModelCallclaims; the tool and seal activities publish under the token it returns. Claiming is a compare-and-set, because two attempts of one activity can be alive at once and a paused attempt 1 resuming after attempt 2 must not take the log back.runToolCallpublishesTool.Calledbefore it runs the tool, so a call the log shows as running is one a dispatch was already inside. Only a tool declaringidempotentruns again; anything else reaches the model as an unknown outcome. One admission event, with an id derived from the call, admits one dispatch under overlapping attempts.OPENCODE_TEMPORAL_SERIAL_TOOLS, on by default only with a shared store).Verified live against a Temporal dev server and
gpt-5-mini: a one-tool turn recorded five activities and the tool ran once; four concurrentreadcalls ran as four overlappingrunToolCallactivities with no fenced write; a serve killed mid-tool came back on a fresh worker with the interrupted call reported unknown and the model recovering; an interrupt closed the in-flight call by itself. TheSessionExecutionconformance suite passes in both Temporal modes and in the local coordinator, and gained the two scenarios the split changes: a tool round trip, and an interrupt with a tool in flight.Worker affinity, the live event tick, the worktree freshness rule and the fork CI workflow, which used to ride in this PR, are their own PRs in the stack now.