Terminal capacity handling: one decision, one button - #538
Draft
catomean wants to merge 6 commits into
Draft
Conversation
- Add TerminalCapacityBanner component to show FleetCrown-branded capacity messages - Integrate capacity detection into TerminalView by scanning terminal buffer - Extract reset time from error messages (e.g. 'resets 1pm (Europe/Zurich)') - Pass current/next agent and switch callback to TerminalView - Use existing AGENT_FALLBACK_ORDER and resolveNextAvailableAgent logic - Auto-switch terminal source when Watch opens with missing session - Show loading state during auto-switch to avoid flashing 'not found' - Capacity banner takes precedence over stalled overlay Closes the loop from capacity detection to one-click agent switch in the terminal, matching the Control surface behavior. When an agent hits a provider limit, the terminal now shows FleetCrown's own messaging with the next available agent as a single obvious action, not buried in a vendor error or dropdown.
…ck chain - Replace simple banner with full fallback chain UI - Show all agents in AGENT_FALLBACK_ORDER with availability status - Allow switching to any available agent, not just the next one - Use listAgentRegistry() for real agent data with availability detection - Display agents as ui-chip-toggle buttons (consistent with mode bar) - Show unavailable agents as disabled with reasons - Handle exhausted fallback case explicitly - Remove hardcoded agent lists - one SSOT in the registry The capacity banner now matches the mode bar's design system and shows the complete ordered path through available agents.
Reduce buffer scan delay from 150ms to 50ms so the capacity overlay appears faster and more prominently replaces the vendor error text. Note: The capacity text is raw PTY output from Claude's CLI. Intercepting it before rendering would require parsing streaming bytes with terminal escape codes, which is fragile and could break TUI applications. The current approach (scan buffer post-render + overlay) is safer and works with any CLI.
- Replace ui-input-compact selects with ui-chip-toggle styled selects - Make Start button ui-btn-xs (matches mode bar sizing) - Make secondary links ui-btn-xs (quiet, not competing primaries) - All controls now same height and consistent with mode bar - Remove 'here' from 'Start here' button text (shorter, clearer) - One row, one obvious action, rest quiet Fixes the 'Frankenstein' layout issue where buttons of different sizes, two primaries, and poor alignment competed for attention.
Reduce cognitive load: one sentence, one button, one decision. Before: - Multiple agent buttons in a menu - Icon + header + explanation + chip grid + micro text - Operator had to choose from several agents - Vendor error visible alongside FleetCrown UI After: - Single sentence: 'Claude hit its limit (resets X).' - One primary button: 'Switch to Cursor' - Full-screen overlay hides vendor error completely - No menu, no puzzle, no cognitive load - We pick the next agent in their order, they confirm The operator shouldn't have to know which side has the session, what the vendor error means, or which of several buttons to press. Pick the side (auto-switch), pick the next agent (their configured order), they confirm.
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
Terminal capacity handling simplified to one decision: a short explanation and one button for the next available agent. Reduces cognitive load, time, and effort.
What This Is
When an agent hits a capacity limit, the operator sees:
Not: a menu of agents, a cloud/local puzzle, and a vendor error at the same time.
Design Principle
Reduce cognitive load. The operator shouldn't have to:
They confirm. We handle the rest.
What Changed
1. One Decision Only
AGENT_FALLBACK_ORDER2. Hide Vendor Error Completely
bg-surface-terminal) covers the terminal3. Auto-Handle Everything
4. Exhausted Fallback Case
When all agents are at capacity:
Clear, actionable, no button when there's nothing to switch to.
Implementation
Before (overcomplicated):
After (minimal):
Code:
Uses Existing Order
No settings tour, no new page. Uses
AGENT_FALLBACK_ORDERfrom the registry — the order they already configured.Verification
npx tsc --noEmitnpm run lintProduction Notes
What Ships
One decision per capacity event:
No menus, no puzzles, no cognitive load. They confirm; we handle the rest.