Repository navigation
Poll the PR through observe_pr's retry policy instead of a workflow timer - #45
Merged
Merged
Conversation
…imer
A quiet PR used to add an observe_pr activity and a timer to the history
every poll_minutes, drawing a staircase on the Temporal UI timeline that hid
the real work. Now observe_pr fails (retryably) while decide() would WAIT and
the workflow calls it once with a fixed-interval retry policy, so the whole
wait is one activity row and retries add no events (Temporal's "infrequent
polling" pattern).
- ObserveInput carries the decision context (handled, revisions,
max_revisions, escalated) so the activity can run decide() itself.
- decide() treats an escalation already raised for the same reason and head
as WAIT; IssueInput.escalated records it, so an escalated PR polls quietly
instead of re-commenting every round.
- The old loop stays behind workflow.patched("observe-by-retry") so in-flight
runs replay; drop it once they have rolled over.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Problem
A quiet PR added an
observe_practivity and a timer to the history everypoll_minutes, drawing a staircase on the Temporal UI timeline that hid the real work (the agent rounds, merges and escalations).Change
Temporal's "infrequent polling" pattern:
observe_prfails (retryably) whiledecide()would WAIT, and the workflow calls it once with a fixed-interval retry policy. Retries add no history events, so the whole wait is one activity row on the timeline. A revision round still shows as its own cluster of activities between two long observe bars.ObserveInputcarries the decision context (handled,revisions,max_revisions,escalated) so the activity can rundecide()itself.decide()treats an escalation already raised for the same reason and head as WAIT;IssueInput.escalatedrecords it, so an escalated PR polls quietly instead of hot-looping on the same escalation.workflow.patched("observe-by-retry")so in-flight runs replay. Those runs get an unbounded retry budget onobserve_prso they do not fail after six quiet hours. Drop the old branch once pre-change runs have rolled over.Only
IssueWorkflowpolled with a timer;PollWorkflowand the mia_data workflows are unaffected.Tests
330 passed, ruff clean.
Behaviour notes
A transient GitHub error during a poll now waits a full poll interval before retrying instead of backing off from one second. Acceptable at a two-minute poll.
🤖 Generated with Claude Code