fix(livekit): bound memory background task steps - #1924
Open
zhanba wants to merge 5 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1924 +/- ##
========================================
Coverage 33.32% 33.32%
========================================
Files 778 778
Lines 83120 83119 -1
Branches 4897 4734 -163
========================================
+ Hits 27696 27697 +1
+ Misses 55304 55302 -2
Partials 120 120 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Allow forked background tasks to define task-specific step limits so memory workflows stop before consuming the generic 50-step budget. 🤖 Generated with [Pochi](https://getpochi.com) | [Task](https://app.getpochi.com/share/p-756b25d05481454296b52ae4fcf65ad7) Co-Authored-By: Pochi <noreply@getpochi.com>
zhanba
force-pushed
the
fix/background-task-max-steps
branch
from
August 31, 2026 12:33
8d9cad5 to
565180d
Compare
Task memory extracted on warm-up, again on a token-increment rule, and once more synchronously right before compaction. That burned background forks and shortened the verbatim tail compaction is supposed to preserve, since the tail is whatever sits between the extraction boundary and the compaction point. Extract once when the context reaches 80% of the auto-compact threshold, mark the cycle done on success, and reset the flag when compaction finishes. Only failed attempts retry, capped at two per cycle, so a stale boundary cannot push compaction into its degraded attach path. Compaction no longer triggers an extraction itself and only waits up to 5s for an in-flight one to settle. 🤖 Generated with [Pochi](https://getpochi.com) | [Task](https://app.getpochi.com/share/p-8a63e58579ce42a1a32c7848ee4f84e9) Co-Authored-By: Pochi <noreply@getpochi.com>
Auto-memory forked a full-context extraction agent at every completed turn, and judged success by attemptCompletion alone — so a systematically failing extraction never advanced the watermark and re-ran on every later turn. Require three new user turns before extracting, and treat a successful write by the fork as success while advancing the watermark even on failure. 🤖 Generated with [Pochi](https://getpochi.com) | [Task](https://app.getpochi.com/share/p-8a63e58579ce42a1a32c7848ee4f84e9) Co-Authored-By: Pochi <noreply@getpochi.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.
Summary
Test plan
bun checkbun tscgit diff --check🤖 Generated with Pochi | Task