Skip to content

Add ! bash mode with live shell output - #1654

Merged
AbirAbbas merged 14 commits into
devfrom
zeropoint95/bash-mode
Sep 28, 2026
Merged

AbirAbbas merged 14 commits into
devfrom
zeropoint95/bash-mode

Conversation

@ZeroPoint95

@ZeroPoint95 ZeroPoint95 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Bash mode via !

  • model does NOT respond until next message
1654

Changelog

  • Run non-interactive ! commands in the conversation’s project.
  • Show an amber $ prompt and live, literal shell output; retain output in chat history.
  • Wait for the next message before the model responds. Keep shell commands separate from automated input and honor explicit denies.

Validation: terminal checks, bash regressions, and the full UI suite passed. make pr-ready remains blocked by three existing macOS session failures and a UI test race, reproduced on clean dev.

@ZeroPoint95
ZeroPoint95 marked this pull request as ready for review September 28, 2026 15:53
ZeroPoint95 and others added 5 commits September 28, 2026 11:53
Enter was treated as consent for every decision short of an explicit deny,
so `! rm -rf /`, `! mkfs…`, a reboot or the fork bomb ran without the
question the model's own bash call always raises, under --yolo and a
blanket allow alike. The floor's manual page promised it asks "whichever
way your settings are set".

The person's command now goes through the same approval question as a
model call when it matches the critical table: refused, interrupted or
unattended, it does not run; allowed, it runs as before. Ordinary !
commands still run on Enter with no question, explicit denies still
refuse, and no memo or guardian model is consulted on this door.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row composed its bound from the 30-second background-after clock, but
a command the person ran never joins the job registry and runs until the
shell timeout (10 minutes unless it says otherwise). `! sleep 33` read
`30s · 0s left` and then kept running. The row now counts against the
timeout the runner actually armed; a model's foreground bash row is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The background gesture skips a command the person ran (background.go's
promotableEntry), but the page listing when it is absent did not say so,
and the chat told a person that ctrl+g backgrounds a running ! command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@santoshkumarradha santoshkumarradha added the feature Work that adds a capability; developers break it into tasks label Sep 28, 2026
@santoshkumarradha santoshkumarradha added this to the Chat & connections milestone Sep 28, 2026
@santoshkumarradha santoshkumarradha added area:chat The v3 surface a person sits in front of (internal/tui3) area:tools The tool layer: built-in tools, registries, belts labels Sep 28, 2026
@AbirAbbas

Copy link
Copy Markdown
Collaborator

Taking this over to land it (Abir asked in the Slack thread). Everything in the description holds in the real binary:

  • The command runs in the project, with the amber $.
  • Output is live and literal, and stays in history after reopening, on both roads.
  • The model waits and then sees the output with the next message.
  • Denies are honored.
  • An old dev engine and the v20 surface handle each other cleanly.

One blocker, fixed. A ! command skipped the critical floor: ! rm -rf /, mkfs, reboot and the fork bomb ran with no question in every posture, including --yolo, while the model's own bash call always asks and permissions.md promises it does. A critical ! command now puts the same question as a model call. Refused, interrupted or unattended, it does not run. Ordinary ! commands still run on Enter with no question. Four failing-first tests are included, and it was re-checked by hand on both roads.

Two smaller fixes:

  • A ! row showed 30s · 0s left and kept running. It now counts against the runner's 10-minute timeout (30s / 10m).
  • The manual now says ctrl+g cannot background a ! command. The chat was telling people it could.

Worth a follow-up, not blocking:

  • A conversation that opens with a ! command is titled from the shell line (e.g. ! Pwd, ! Echo SKEW-1 > Skew1.txt). title.go could skip a message answered by a user_bash_ call.
  • A manual search for "what does ! do" finds nothing, because the tokenizer drops !.
  • The thinking flavour line draws above a running ! command.
  • Answering "always" on the floor card writes the ordinary session bash memo. That matches the model's own floor card, but it may be worth leaving off here.

#1431 gave home a tray of its own, so the bash refusal and the
update-stops-turn check in homeStartWithProject read a.home.chips; a.chips
is now the conversation behind home.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@AbirAbbas AbirAbbas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified in the real binary and merged by the takeover; see the comment above.

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

Labels

area:chat The v3 surface a person sits in front of (internal/tui3) area:tools The tool layer: built-in tools, registries, belts feature Work that adds a capability; developers break it into tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants