Skip to content

Terminal capacity handling: one decision, one button - #538

Draft
catomean wants to merge 6 commits into
mainfrom
cursor/terminal-capacity-handling-fc49
Draft

Terminal capacity handling: one decision, one button#538
catomean wants to merge 6 commits into
mainfrom
cursor/terminal-capacity-handling-fc49

Conversation

@catomean

@catomean catomean commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

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:

Claude hit its limit (resets 1pm).
[Switch to Cursor]

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:

  • Know which side (cloud/machine) has the session → We pick it (auto-switch)
  • Understand what the vendor error means → We hide it (full overlay)
  • Choose from several agents → We pick the next one (their configured order)
  • Press the right button among many → One primary action

They confirm. We handle the rest.

What Changed

1. One Decision Only

  • One sentence explaining what happened
  • One button for the next available agent in their AGENT_FALLBACK_ORDER
  • No menu of agents, no chip grid, no multiple choices

2. Hide Vendor Error Completely

  • Full-screen overlay (bg-surface-terminal) covers the terminal
  • Operator never sees Claude's "weekly limit" text
  • No competing messages or visual clutter

3. Auto-Handle Everything

  • Source switching: Automatically try other source when Watch lands on wrong side
  • Agent selection: Pick the next available agent from their configured order
  • Visual hierarchy: One obvious action (primary button)

4. Exhausted Fallback Case

When all agents are at capacity:

Claude hit its limit (resets 1pm).
All agents are at capacity. Wait for the reset time or install additional agents.

Clear, actionable, no button when there's nothing to switch to.

Implementation

Before (overcomplicated):

  • Icon + header + explanation paragraph
  • Grid of agent chips (all remaining agents)
  • Disabled chips with availability reasons
  • Micro text about unavailable agents
  • Multiple primary actions competing

After (minimal):

  • One sentence: current agent + reset time
  • One button: next agent
  • Center-aligned, simple
  • Full overlay hides the error

Code:

<p>Claude hit its limit (resets 1pm).</p>
<button onClick={() => onSwitch(nextAgent.id)}>
  Switch to Cursor
</button>

Uses Existing Order

No settings tour, no new page. Uses AGENT_FALLBACK_ORDER from the registry — the order they already configured.

Verification

  • npx tsc --noEmit
  • npm run lint
  • Manual: Capacity overlay shows one sentence + one button
  • Manual: Clicking button switches to next agent
  • Manual: Vendor error text is hidden by overlay
  • Manual: "All exhausted" case shows no button

Production Notes

  • Migrations: None
  • Deployment: Standard
  • Rollback: Safe
  • Behavioral change: Simpler UI, same backend

What Ships

One decision per capacity event:

  1. Explanation (what happened, when it resets)
  2. Action (switch to the next agent)
  3. Confirmation (click the button)

No menus, no puzzles, no cognitive load. They confirm; we handle the rest.

Open in Web Open in Cursor 

- 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.
@cursor cursor Bot changed the title Terminal capacity detection and auto-source switching Terminal capacity handling with agent fallback chain Sep 9, 2026
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.
@cursor cursor Bot changed the title Terminal capacity handling with agent fallback chain Terminal capacity handling with full agent fallback chain Sep 9, 2026
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.
@cursor cursor Bot changed the title Terminal capacity handling with full agent fallback chain Terminal capacity handling: one decision, one button Sep 9, 2026
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.

2 participants