Skip to content

fix(workflows): clear pruned loop history via batched deletes - #12

Open
abcxff wants to merge 1 commit into
stack/feat-workflows-add-batchdelete-to-the-engine-kv-driver-qxxlzyqkfrom
stack/fix-workflows-clear-pruned-loop-history-via-batched-deletes-nputktmr
Open

fix(workflows): clear pruned loop history via batched deletes#12
abcxff wants to merge 1 commit into
stack/feat-workflows-add-batchdelete-to-the-engine-kv-driver-qxxlzyqkfrom
stack/fix-workflows-clear-pruned-loop-history-via-batched-deletes-nputktmr

Conversation

@abcxff

@abcxff abcxff commented Aug 31, 2026

Copy link
Copy Markdown

Loop pruning deleted each metadata key with its own driver.delete via an
unbounded Promise.all. Once a prune exceeded ~128 entries the fan-out overran
the actor SQLite coordinator's 128-permit admission cap and failed long-lived
ctx.loop workflows with 'SQLite transaction queue is full'.

Route pruning through batchDelete, chunking keys at MAX_KV_BATCH_ENTRIES (the
engine's KV_TX_MAX_ROWS per-commit cap) and running prefix/range sweeps and key
batches concurrently, so permit cost drops from N to ceil(N/128).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Loop pruning deleted each metadata key with its own driver.delete via an
unbounded Promise.all. Once a prune exceeded ~128 entries the fan-out overran
the actor SQLite coordinator's 128-permit admission cap and failed long-lived
ctx.loop workflows with 'SQLite transaction queue is full'.

Route pruning through batchDelete, chunking keys at MAX_KV_BATCH_ENTRIES (the
engine's KV_TX_MAX_ROWS per-commit cap) and running prefix/range sweeps and key
batches concurrently, so permit cost drops from N to ceil(N/128).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@abcxff

abcxff commented Aug 31, 2026

Copy link
Copy Markdown
Author

Stack for rivet-dev/workflows

Get stack: forklift get 12
Push local edits: forklift submit
Merge when ready: forklift merge 12

change nputktmr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant