fix(logs,workspace): prevent cancelled status overwrite on race and move impersonation banner#4617
Conversation
…ove impersonation banner - Guard completeWithError against overwriting a cancelled execution status — cancel route writes cancelled to DB optimistically, but a block error racing the 500ms Redis check could finalize with failed before the engine detects cancellation - Add tests covering the guard: cancelled DB status skips the write, non-cancelled proceeds normally, DB failure falls through to cost-only fallback, and subsequent attempts are deduped after guard marks session complete - Move ImpersonationBanner from workspace root into components/ folder
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds a focused test suite covering the new guard behavior (cancelled skip, running/empty proceed, guard dedupes later completions, and DB read failure falling back to the existing cost-only path). Separately updates workspace layout to import Reviewed by Cursor Bugbot for commit 112e028. Configure here. |
Greptile SummaryThis PR fixes a race condition in the workflow execution logging where pressing cancel could briefly show
Confidence Score: 5/5Safe to merge — the change is surgical, well-tested, and consistent with the existing cancellation guard pattern. The new DB status guard in No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CancelRoute
participant DB
participant Engine
participant completeWithError
User->>CancelRoute: Press Cancel
CancelRoute->>DB: "Write status = 'cancelled'"
Note over Engine: Block errors simultaneously
Engine->>completeWithError: safeCompleteWithError(blockError)
completeWithError->>DB: "SELECT status WHERE executionId = ?"
DB-->>completeWithError: "status = 'cancelled'"
completeWithError->>completeWithError: "Guard fires → set completed=true, return"
Note over completeWithError: Skips writing 'failed' ✓
Reviews (1): Last reviewed commit: "fix(logs,workspace): prevent cancelled s..." | Re-trigger Greptile |
Summary
Type of Change
Testing
Checklist