Skip to content

Fix #93: make interrupt Enter opt-in - #141

Merged
pseudoseed merged 12 commits into
mainfrom
builder/bugfix-93
Aug 25, 2026
Merged

pseudoseed merged 12 commits into
mainfrom
builder/bugfix-93

Conversation

@pseudoseed

Copy link
Copy Markdown
Owner

Summary

afx interrupt no longer sends Enter to an unknown terminal screen by default. It sends ESC alone unless the operator explicitly opts into the queue-processing behavior with --enter.

Fixes #93

Root Cause

The CLI exposed only Commander's negative --no-enter option, so Commander supplied enter: true by default. That became noEnter: false, and Tower's gate-bypassing escape path blindly scheduled a carriage return after ESC without knowing whether a dialog still had a highlighted action.

Fix

  • add explicit --enter opt-in while retaining --no-enter compatibility
  • document the safe default and dialog-selection risk in both framework trees
  • pin default, opt-in, and compatibility behavior at the real CLI parsing boundary

Test Plan

  • Regression test added and mutation-verified
  • pnpm build
  • pnpm test (6,067 Codev tests + 167 v2 tests pass)
  • porch check bugfix-93

@pseudoseed

Copy link
Copy Markdown
Owner Author

Integration review — approved

All 8 checks green. 14 files, but only 4 carry logic — the rest are the afx skill doc in both
trees, the agent-farm command doc in both trees, tests, and porch bookkeeping.

Problem. afx interrupt sent Enter after ESC by default. On a screen showing a dialog,
that Enter activates whatever option happens to be highlighted — including a destructive one.

Fix. The default inverts: ESC alone. --enter is a new explicit opt-in for the case the
Enter was there to serve (letting already-queued messages through once ESC ends the turn), and
--no-enter is retained so existing scripts keep working.

The one thing I want on the record, because it is invisible and load-bearing:

.option('--enter',    'Send Enter after ESC so queued messages process (unsafe at dialogs)')
.option('--no-enter', 'Send ESC alone (default; retained for compatibility)')

The declaration order is what makes the default correct. Commander gives a lone --no-x
a default of true for x, but when --x is declared first, --no-x does not change the
default — so options.enter stays undefined. The unchanged action line
noEnter: !options.enter then yields true, and interrupt.ts's
options.noEnter !== false keeps it true. ESC alone.

Swap those two lines and options.enter defaults to true, noEnter becomes false, and the
default silently reverts to sending Enter — with every test that asserts the flags still
passing, because both explicit flags keep working. I traced all three paths (no flag,
--enter, --no-enter) and all three are correct as written. Worth a comment on those lines
so a future tidy-up doesn't reintroduce #93.

tower-routes.ts is touched but not changed — comment text only, no behavior. That file is
frozen by spec 83's C1, and a comment edit on the send handler is not a v2 routing decision, so
the constraint is intact.

Merge with --merge. Do not squash.

@pseudoseed
pseudoseed merged commit b1373b2 into main Aug 25, 2026
8 checks passed
pseudoseed added a commit that referenced this pull request Aug 25, 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.

afx interrupt sends Enter by default, which selects whatever a dialog has highlighted

1 participant