Repository navigation
fix(core): bound capture turns and the queue, make the run report counters exact (#1666) - #1680
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
Uteke::capturerefuses a turn over[capture] max_turn_bytes(default 1 MiB) on every surface;uteke capturereads stdin only up to that size; HTTP uses the same setting (413).max_queue_turns(100000) ormax_queue_bytes(512 MiB).extract-queue status/GET /capture/statusshowpending_bytesand awarningfrom 80% of a limit.UPDATE ... RETURNING, soreclaimedcounts batches handed back, batches failed by an expired lease go tosessions_failed, andfacts_refusedis only added when the attempt stands (not on a rolled-back retry).Why
A hook passing a huge message stored it whole and sent it in one extraction request, and a stuck extraction let the queue grow without bound. Closes #1666
Testing
New unit tests in
capture.rs(size limit by role and bytes, default/zero, queue turn and byte limits, duplicate still a no-op, done turns not counted, 80% warning, reclaim vs failed counts, refused not double counted on retry), a CLI stdin bound test and an HTTP 413 / full-queue test.cargo test -p uteke-core -p uteke-cli -p uteke-server -p uteke-mcp, clippy and fmt are clean.