fix(flows): case_escalation re-fire guard must use status, not the boolean is_escalated#435
Merged
Merged
Conversation
…olean is_escalated The escalation flow fires on `record-after-update` and its action writes back to the same case (`is_escalated=true, status='escalated', …`), which re-triggers record-after-update. The guard `record.is_escalated != true` was meant to stop the second fire, but a `boolean` field persists as integer `1` on SQLite/libsql and CEL `1 != true` is `true`, so the guard never trips and the flow loops forever — on 2026-07-06 this infinite cascade during a new env's first-boot seed wedged the whole per-env kernel build, leaving the workspace unopenable. Gate on `record.status != "escalated"` instead: `status` is a string enum set by the same escalation write, so it reliably suppresses the re-fire regardless of how the driver stores booleans. (The platform also now coerces booleans for flow conditions + guards against self-trigger loops, but the template must not depend on that.) task_urgent_alert also guards on a boolean (`is_completed != true`) but fires on record-after-CREATE with a notify-only body (no self-write), so it cannot loop; left as-is. Co-Authored-By: Claude Opus 4.8 <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.
Why
case_escalationfires onrecord-after-updateand its action writes back to the same case (is_escalated=true, status='escalated', …), re-triggering record-after-update. The guardrecord.is_escalated != truewas meant to stop the second fire, but abooleanpersists as integer1on SQLite/libsql and CEL1 != trueistrue— the guard never trips and the flow loops forever. On 2026-07-06 this wedged a new env's first-boot seed and left the workspace unopenable.What
Gate on
record.status != "escalated"—statusis a string enum set by the same escalation write, so it reliably suppresses the re-fire regardless of how the driver stores booleans. (The platform now also coerces booleans for flow conditions + guards against self-trigger loops — objectstack-ai/objectstack#2661 — but the template must not depend on that.)task_urgent_alertalso guards on a boolean (is_completed != true) but fires on record-after-create with a notify-only body (no self-write), so it cannot loop; left as-is.🤖 Generated with Claude Code