Raise terminal history/scrollback/buffer defaults (50k→100k, 2MB→32MB)#138
Merged
Merged
Conversation
Bump the centralized terminal-history defaults: tmux scrollback 50k->100k and PTY buffer cap 2MB->32MB (trim 1.5MB->24MB). Both remain env/settings overridable and bounds-clamped. Worst-case 20-session buffer budget rises 40MB->640MB. Stacked on the terminal-history config commit.
… raise (PR Ark0N#138) - UNBOUNDED-MEMORY: DEFAULT_TERMINAL_BUFFER_TRIM_BYTES from CODEMAN_TRIM_TERMINAL_TO had no relation to DEFAULT_TERMINAL_BUFFER_MAX_BYTES — setting only CODEMAN_MAX_TERMINAL_BUFFER=2097152 left the 24MB trim default in force, making BufferAccumulator.trim() (slice(-trimSize)) a no-op: unbounded growth past the cap plus a full string re-join on every append (O(n²)). Trim default is now clamped to 75% of the resolved max (the 24MB/32MB default ratio, preserved as hysteresis); regression test re-evaluates the module under the env via vi.resetModules. - OVERCLAIM: reverted DEFAULT_TERMINAL_SCROLLBACK_LINES 100k -> 50k — it has zero consumers; browser xterm scrollback is the separate hardcoded DEFAULT_SCROLLBACK (50k) in constants.js and deliberately stays 50k (mobile-memory hazard). The tmux history-limit raise (50k -> 100k) and PTY 32MB/24MB raise remain (those are wired). Module docstring now claims only what is wired; fixed the stale tmux-manager.ts comment saying the tmux limit "matches the xterm-side default in constants.js". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
|
Merged — thank you @aakhter! The raised tmux history (100k) and PTY buffer caps (32MB/24MB) land in the next release. During review we appended one commit: the env-path trim default is now clamped below the max (an operator setting only |
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
Raises the centralized terminal-history defaults introduced in #137:
history-limitAll values remain env- and settings-overridable (
CODEMAN_MAX_TERMINAL_BUFFER/CODEMAN_TRIM_TERMINAL_TO) and bounds-clamped viaresolveTerminalHistoryConfig().Why split from #137
#137 introduced the config mechanism with no behavior change (defaults kept at the prior hardcoded values), so the plumbing could be reviewed on its own. This PR is the follow-up policy change: larger defaults so a full default scrollback is retained and replayable. Keeping them separate lets the larger memory budget be weighed independently.
Trade-off
Worst-case terminal-buffer budget for 20 concurrent sessions rises 40 MB → 640 MB (comment updated to match). Operators who want the smaller footprint can set
CODEMAN_MAX_TERMINAL_BUFFER/CODEMAN_TRIM_TERMINAL_TO.Tests
test/terminal-history.test.tsupdated to assert the raised defaults;tsc --noEmit, the terminal-history + schema tests, andnpm run buildall pass.