Skip to content

[Bugfix #1180] Raise per-window terminal cap + expose as codev.maxTerminals (default 25)#1181

Merged
amrmelsayed merged 7 commits into
mainfrom
builder/bugfix-1180
Jul 15, 2026
Merged

[Bugfix #1180] Raise per-window terminal cap + expose as codev.maxTerminals (default 25)#1181
amrmelsayed merged 7 commits into
mainfrom
builder/bugfix-1180

Conversation

@amrmelsayed

Copy link
Copy Markdown
Collaborator

Summary

The VS Code extension capped concurrent terminals at 10 via a static MAX_TERMINALS = 10 constant. 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.maxTerminals setting (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 own maxSessions: 100 server-side backstop.

Root Cause

Static constant MAX_TERMINALS = 10 at packages/vscode/src/terminal-manager.ts:10, enforced in openTerminal (: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: replace MAX_TERMINALS = 10 with DEFAULT_MAX_TERMINALS = 25; openTerminal reads codev.maxTerminals via the config getter (falling back to the default). The over-cap toast now reads Too many terminals (N max) — close unused terminals or raise codev.maxTerminals so users know the knob exists. Two doc-comment references updated to codev.maxTerminals.
  • package.json: new codev.maxTerminals number 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

  • Added #1180 source-level guards in terminal-manager.test.ts (matching the file's existing source-guard harness, since a full TerminalManager needs heavy vscode mocking): verify the setting is read via getConfiguration('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.
  • Added a package.json schema assertion for the new setting's default/min/max.
  • Full vscode vitest suite green: 632 tests / 53 files pass. check-types clean. Porch build + test checks pass.

Fixes #1180

…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.
@amrmelsayed

Copy link
Copy Markdown
Collaborator Author

CMAP review (3-way, --type pr)

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
amrmelsayed merged commit c3bb262 into main Jul 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vscode: raise per-window terminal cap + expose as codev.maxTerminals setting (default 25, up from 10)

1 participant