fix(logs-cleanup): listing active workspaces into mem + download time streaming lims#4692
fix(logs-cleanup): listing active workspaces into mem + download time streaming lims#4692icecrasher321 wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates Refactors retention job dispatch to page active workspaces (avoiding loading all into memory), adds per-job Adds execution-log compaction to keep stored Reviewed by Cursor Bugbot for commit 0b28132. Configure here. |
Greptile SummaryThis PR introduces a new
Confidence Score: 4/5The stream-limiting changes are generally safe to merge; the cleanup dispatcher still carries previously flagged unresolved concerns around execution order and sequential enqueue performance. The core stream-limit plumbing is well-structured and the cleanup-logs workspace scoping is correct. The previously noted issues in cleanup-dispatcher.ts (inline-runner precedence inversion, sequential chunk enqueue, always-extra housekeeping chunk) remain in the code and affect production cleanup job behavior. apps/sim/lib/billing/cleanup-dispatcher.ts warrants another pass; apps/sim/lib/core/utils/stream-limits.ts has the body-already-read risk on the arrayBuffer→text fallback path. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tool Request] --> B{Internal Route?}
B -- Yes --> C[fetch internal URL]
B -- No --> D[secureFetchWithPinnedIP\nwith maxResponseBytes]
C --> E{nullBody or\nshouldRetryWithout\nReadingBody?}
D --> F{nullBody or\nshouldRetryWithout\nReadingBody?}
E -- Yes --> G[cancel body\nResponse null]
E -- No --> H[readToolResponseBody\nmax 10MB]
F -- Yes --> I[cancel body\nResponse null]
F -- No --> J[readToolResponseBody\nmax 10MB]
G --> K{Retryable & not\nlast attempt?}
I --> K
H --> K
J --> K
K -- Yes --> L[sleep & retry]
L --> B
K -- No --> M{response.ok?}
M -- No --> N[Parse error body\nfrom buffered response]
M -- Yes --> O[Build success result]
H -- PayloadSizeLimitError --> P[handleResponseSizeLimitError\nuser-friendly message]
J -- PayloadSizeLimitError --> P
Reviews (3): Last reviewed commit: "address comments" | Re-trigger Greptile |
|
@greptile |
|
bugbot run |
|
@greptile |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0b28132. Configure here.
Summary
WIP
Fixes #(issue)
Type of Change
Testing
Tested manually
Checklist