You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flow: persists across calls — no automatic reset #6639
In Flow, retry_count accumulates across multiple kickoff() calls. If the state has retry_count: int = 0 and max_retries: int = 3, after one full run (3 attempts) the counter is 3. A second kickoff() call starts from 3, immediately hitting max_retries escalation on the first task.
Steps to reproduce
@persist(...)classTestFlow(Flow[TestState]):
@start()defstart(self):
pass@listen("builder")defbuilder_plan(self):
# retry_count is already 3 from previous runpass@router(builder_code)defbuilder_verify(self, code_output):
self.state.retry_count+=1ifself.state.retry_count>=self.state.max_retries:
return"escalated"return"needs_revision"
Run flow once → retry_count = 3 after max retries
Call flow.kickoff() again → retry_count starts at 3 → immediately escalated
Expected
retry_count should reset to 0 when a flow run starts, or at least when kickoff() is called. Same applies to any counter field used for per-run tracking.
Activity
akrhin commentedon Jul 25, 2026
Closed — intended behavior. Flow state persists across kickoff() calls by design.