components C4: bash-mode (!) input - #296
Merged
Merged
Conversation
Port of TS processBashCommand: a user-typed !command runs DIRECTLY
through the Bash tool call (no registry permission flow — user-typed
commands aren't model-initiated; the tool's defense-in-depth
dangerous-pattern guard still applies and is pinned by a test that
also asserts the permission handler is NEVER consulted), produces no
agent turn, and feeds <bash-input>/<bash-stdout|stderr> user messages
into the conversation so the model sees them next turn.
- conversation integrity (review B1): texts route through the new
AgentBridge.append_user_texts — deferred while a run is in flight
(mid-run appends could interleave a tool_use/result pair, durably
via the persister) and drained in _finish() before the durable
flush, plus at the top of submit() so teardown-window stragglers
land BEFORE the next prompt; this also replaces the app's
_persister reach-in
- UI: echo row mounts synchronously ("running…"), the worker fills
the output in place; BOTH streams render (git/npm write to stderr
with exit 0); shared truncate_body() so panel/stash limits can
never drift; ctrl+o-expandable; sequential-only with honest
refusals (busy agent / bash already running); magenta input accent
on the ! prefix
- divergences documented: no caveat message, both streams escaped,
no PowerShell branch, no live progress/ESC cancel yet (follow-up)
15 tests incl. deferral through a real bridge, exit-143 timeout via
env shrink, !cd cwd-persistence pinned as deliberate TS parity, and
repl dispatch (bash called, agent NOT). Suite baseline-identical.
Critic-approved after one REQUEST CHANGES round.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
singlaamitesh
pushed a commit
to singlaamitesh/clawcodex
that referenced
this pull request
Jul 7, 2026
…-bash-mode components C4: bash-mode (!) input
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
!commandruns directly through the Bash tool (no permission prompt — pinned by test; the tool's own dangerous-pattern guard still applies), no agent turn, and<bash-input>/<bash-stdout|stderr>user messages reach the conversation (TSprocessBashCommandparity)AgentBridge.append_user_textsdefers mid-run texts and drains them at run end + before the next prompt — a bash completion can never interleave atool_use/tool_resultpair (review blocking find)truncate_body; sequential-only with honest refusals;!input accentTest plan
!cdcwd parity pin, stderr-on-success render, repl dispatch, busy refusal + history🤖 Generated with Claude Code