[Bugfix #1180] Raise per-window terminal cap + expose as codev.maxTerminals (default 25)#1181
Merged
Conversation
…als (default 25) Replace the static MAX_TERMINALS = 10 constant with a configurable codev.maxTerminals setting (default 25, min 5, max 100). The 10-terminal cap dated from single-architect workspaces; multi-architect rosters now consume several slots before any builder terminal opens. Tower's own backstop is 100, so the low client cap was the binding constraint. The enforcement path in openTerminal reads the setting; the toast now points users at codev.maxTerminals so they know they can raise it. Test: source-level guards verify the setting is read and enforced at the configured value, plus a package.json schema assertion for the new setting's default/min/max.
Reword the DEFAULT_MAX_TERMINALS rationale: the prior '~10 architects + ~20 builders' example summed to 30, not the default of 25. Now describes the sizing qualitatively (several architect terminals plus one per active builder) to avoid misleading future readers.
Collaborator
Author
CMAP review (3-way,
|
| Model | Verdict | Confidence |
|---|---|---|
| gemini | APPROVE | HIGH |
| codex | COMMENT | HIGH |
| claude | APPROVE | HIGH |
No REQUEST_CHANGES. One non-blocking nit from codex: the DEFAULT_MAX_TERMINALS code comment previously sized the default via "~10 architects + ~20 builders" (=30), which didn't add up to the default of 25. Addressed in eef5e9d8 by rewording the rationale qualitatively (no misleading arithmetic). Implementation itself was flagged as correct by all three.
amrmelsayed
added a commit
that referenced
this pull request
Jul 15, 2026
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
The VS Code extension capped concurrent terminals at 10 via a static
MAX_TERMINALS = 10constant. In multi-architect workspaces this is impractical: main + sibling architects consume several slots before any builder terminal opens, and architect terminals are the least-closeable type (closing one loses AI conversation state until the next reconciliation).This exposes the cap as a
codev.maxTerminalssetting (default 25, min 5, max 100) so users can tune it. 25 accommodates ~10 architects + ~20 builders, well above realistic demand and comfortably below Tower's ownmaxSessions: 100server-side backstop.Root Cause
Static constant
MAX_TERMINALS = 10atpackages/vscode/src/terminal-manager.ts:10, enforced inopenTerminal(:465), with no configuration surface. The cap dates from Spec 0602 (single-architect era); sibling architects arrived later (Spec 755/786) but the cap was never re-scoped. The client-side 10 was the binding constraint — Tower already backstops at 100.Fix
terminal-manager.ts: replaceMAX_TERMINALS = 10withDEFAULT_MAX_TERMINALS = 25;openTerminalreadscodev.maxTerminalsvia the config getter (falling back to the default). The over-cap toast now readsToo many terminals (N max) — close unused terminals or raise codev.maxTerminalsso users know the knob exists. Two doc-comment references updated tocodev.maxTerminals.package.json: newcodev.maxTerminalsnumber setting (default 25, min 5, max 100) with a markdownDescription explaining the memory-vs-capacity trade-off.Net diff: ~67 lines across 3 files. No change to Tower's server-side cap (out of scope).
Test Plan
#1180source-level guards interminal-manager.test.ts(matching the file's existing source-guard harness, since a fullTerminalManagerneeds heavy vscode mocking): verify the setting is read viagetConfiguration('codev').get<number>('maxTerminals', DEFAULT_MAX_TERMINALS), that enforcement uses the configured value (not a hardcoded 10), that the toast points at the setting, and that the pre-vscode: raise per-window terminal cap + expose as codev.maxTerminals setting (default 25, up from 10) #1180 constant is gone.package.jsonschema assertion for the new setting's default/min/max.check-typesclean. Porch build + test checks pass.Fixes #1180