Repository navigation
refactor: share budget and session context projections without raising size limits - #71
Merged
xiaour merged 2 commits intoOct 27, 2026
Conversation
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.
The sync and async budget/context APIs duplicated output transformations and exceeded the architecture limits: tokenBudget.js94 lines (limit72) and sessionMemoryContext.js102 (limit69). Share budget scope/result construction and context turn projection, separating pure execution-context rendering from storage reads. Existing public exports, budget precedence, rolling-day scope, async storage selection and context contents are preserved. The modules are now61 and45 lines. No baseline increases or new skips.
Refreshed against latest main e19d784, including upstream-merged #49–#54; the previous21-test failure set and PG/Docker prerequisite failures described for the old base no longer describe the current head.
Validation:9 focused tests pass, including sync/async budget boundary/scope and context parity. Original independent review found no actionable issues. Combined with the pending fix stack and#73–#75:779 passed,16 skipped,0 failed; architecture guard24 errors (down from28 before#71 and from26 before#74/#75); fixture eval14/14 with2 judgePending. Latest Checks remain authoritative; architecture failures are not hidden or counted as passes.
中文:共享预算和会话上下文结果转换,修复两处规模门禁;已刷新到包含#49–#54的新主分支,保持基线不变。