Skip to content

mecatui: queued steer card implies Esc cancels the steer, but it cancels the run and falsely shows the steer as applied #1708

Description

@danbarr

Bug description

When a steer is queued during an active mecatui run, its card says esc cancel. Pressing Escape does not cancel/retract the steer: it cancels the active run.

The resulting state is also misleading. Run termination records the pending steer into session history and the TUI renders the steer echo as steer applied, even though the cancelled run performs no subsequent model turn that could process it. The steer is only available in history for a later run.

Steps to reproduce

  1. Start a prompt in mecatui that keeps the run active long enough to steer.
  2. Submit another prompt while the run is active.
  3. Wait for the steer queued · ↑ edit · esc cancel card.
  4. Press Escape.
  5. Observe that the active run is cancelled and the steer appears to have been applied, although the model did not process it.

Expected behavior

The contextual action and resulting status should distinguish clearly between retracting the queued steer and cancelling the active run.

If Escape is intended to cancel the run, the card should say so explicitly, and a steer captured at cancellation should be presented as saved for a future run rather than applied. Alternatively, if esc cancel refers to the card's queued steer, Escape should retract that steer without cancelling the run.

Actual behavior

  • The queued-steer card says esc cancel without identifying the run as the cancellation target.
  • Escape sends a run Cancel frame and deliberately sends no steer_cancel frame.
  • The pending steer is recorded at terminal close and emitted as a steer echo.
  • Mecatui renders that echo as a user message with steer applied, but the cancelled run does not process it.

Environment (if relevant)

  • mecatl commit: ad1cfe3c89a640905b88fb69f9905df498ba5c9c (origin/main on 2026-09-18)
  • Deployment shape: mecatui

Additional context

Current tests explicitly pin both sides of this behavior:

  • cmd/mecatui/ui/steer_test.go: esc cancels without retracting a pending steer
  • engine/agent/steer_test.go: TestSteer_NeverClosedParked records the steer at cancellation so a future run can replay it

The card changed from esc retract to esc cancel when direct run cancellation was introduced in #887.

Focused verification:

go test ./cmd/mecatui/ui -run TestSteer_TUIRendersAuthoritativeState -count=1
cd engine && go test ./agent -run TestSteer_NeverClosedParked -count=1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions