fix(workflow): settle fire limits atomically - #90
Merged
trvon merged 3 commits intoSep 5, 2026
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A new unconditional structuredClone in LoopStore.fireUnlocked introduces avoidable per-fire overhead on a hot path and should be made conditional/removed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR tightens workflow fire-limit enforcement by settling both workflow-wide and state-local cadence limits atomically inside LoopStore’s lock, aiming to prevent races and preserve correct terminal settlement behavior in pi-loop’s workflow controller runtime.
Changes:
- Updates default workflow fire budgeting to account for both ordinary (non-cadenced) activations and cadence-driven fires.
- Settles fire-limit exhaustion during
LoopStorefire handling under the store lock (including pause/delete settlement paths). - Adds deterministic integration, regression, and property-based tests to cover workflow/state fire caps and atomic settlement invariants.
File summaries
| File | Description |
|---|---|
| test/workflow-task-integration.test.ts | Adds an integration regression ensuring default workflow budgets allow a normal phase + one cadence fire + terminal completion. |
| test/property/store.property.test.ts | Adds a property test asserting persisted fireCount/state fire counts never exceed the active cap and that exhaustion pauses. |
| test/astra-workflow-limits.test.ts | Adds targeted regressions for atomic rejection/no-write behavior after exhaustion across reopened stores. |
| src/tools/workflow-tools.ts | Refines workflowDefaultMaxFires to reserve capacity for ordinary activations and cadence budgets. |
| src/store.ts | Settles workflow/state fire limits under lock during fire, pausing/deleting immediately on exhaustion and preserving returned fire results. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
trvon
force-pushed
the
fix/workflow-limit-authority
branch
from
September 5, 2026 02:19
82666fe to
ff5a48d
Compare
trvon
force-pushed
the
fix/workflow-limit-authority
branch
from
September 5, 2026 02:51
ff5a48d to
b346e55
Compare
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
Validation
Stack
3 of 6. Base:
fix/execution-identity-authority.