Repository navigation
feat: run bang commands directly in the session workspace - #14008
Conversation
|
This PR lets a person type The terminal panel is the chosen output surface. Each command opens a fresh shell; a detached terminal returns to the main window first. Remote sessions and standalone embed/chat-popout windows do not execute this action. Existing operator terminal permissions still apply. The PR body includes seven screenshots and two demo videos from an isolated gateway with a real PTY. Browser tracing observed no agent send/steer/continue requests for terminal commands. Local validation notes distinguish the passing feature checks from inherited host-dependent backend failures reproduced on the base branch. |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS This UI feature also carries backend terminal changes that alter every terminal caller, and the Watch
[DESIGN-REVIEWED] aef3b45 Description read[DESCRIPTION-READ] 5d2d0f07bf0a445c43fdeab9c54e5d9940c0920fa0da179ff3bb478b6ffa3610 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The cold reader could not identify the Watch
Suggestions
[UX-REVIEWED] aef3b45 Description read[DESCRIPTION-READ] 95367be14d212ca2eb92db2d411722ef74ba57be12635fd92af36928195074bf That sha256 names everything this verdict read: the PR description, plus the 23 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ human override accepted@Zedmor overrode this lane for |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
20b1a17 to
77ee731
Compare
|
|
|
|
|
|
|
|
|
|
|
|
|
self-added: yes
|
|
|
|
|
|
|
|
|
Run reviewed shell commands in the selected workspace terminal without an agent turn, including while the agent is busy or stopped. Keep command and pasted-content drafts, and never replay a command on reconnect. Follow-up chip sends that consume the draft take the same review. Place ! command beside the existing composer shortcuts in every locale. Keep terminal setup owned until it settles, and cover deliberate keyboard approval, interactive input, directory recovery and cancelled startup.
|
@bolichen97 one more head. CI on The override request now applies to this head:
Also: approve, or dismiss the Sep 29 changes-requested review, once CI is green. Sorry for the churn. |
|
|
|
|
|
|
|
|
|
|
|
Human judgment recorded@Zedmor marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
|
@bolichen97 all 94 checks on For transparency: I recorded the First Principles override on this head myself (comment). Its reason cites your acceptances of the identical The only thing left is your Sep 29 changes-requested review. M1–M4 are fixed in the code, and M5 is covered by your acceptances. Could you approve, or dismiss it? Thanks. |
Problem / Motivation
Goal: Let people run commands directly in their selected workspace’s interactive terminal from the session composer, including while the agent is stopped.
The user requested this shortcut to run commands directly in the selected workspace while an agent is stopped, with interactive output in the session terminal panel. Today that requires opening the terminal separately and entering the command there.
Why it matters
Users can inspect files, run checks, and repair their workspace from the composer while the agent is idle, busy, or stopped.
Not a goal
What changed (motivation → approach → change)
Type
! git status, choose Review terminal command, inspect the command and workspace, then choose Run. A fresh interactive terminal opens in that workspace without calling the agent. The draft stays in the composer. The inline! shell commandhint sits beside/command,@file, and$skill.Review has its own row so the full label fits narrow screens while the agent’s Stop button stays available. Cancel is initially focused. Attachments and unavailable terminal sessions show a refusal instead of sending the command as chat. A follow-up chip's Send that consumes the current draft goes through the same review, so a draft edited into
! cmdafter picking a chip never reaches the agent. When the project chip is compact or absent, the hint names the workspace folder (full path on hover and in review), and a bare!refusal says the command is reviewed before it runs. Use terminal starting directory has a tooltip naming where the new shell opens (dashboard.terminal.cwd, then the server's home directory).A missing workspace produces an explicit error. Long error text scrolls while Ask the agent, Reconnect, and Use terminal starting directory remain reachable. Recovery requires a fresh command confirmation. Startup errors, expired handoffs, and closed tabs discard pending delivery; code-block startup failures also retain a persistent error notice.
ChatInput.tsxandChatPane.tsxsharehooks/useTerminalCommand.ts;App.tsxreturns detached terminals to the main dashboard before handoff.utils/terminalRegistry.tsconsumes failed deliveries, andhandlers/terminal.pybounds requested-directory probes and descriptor cleanup.CliPanel.tsxandErrorNotice.tsxkeep recovery actions visible independently of long error text.The
website/src/i18ncatalogs,learn-cron-dashboard.md, terminal feature map, andwebsite/src/testregressions cover both composers and the shared terminal callers.Backwards compatibility
Breaking: bare
!and leading!followed by whitespace are reserved in both composers, including remote, pending and terminal-disabled sessions. Those sessions refuse execution and retain the draft. A literal! hellocan no longer be sent unchanged as agent chat. Removing the prefix returns to ordinary chat editing; leading indentation is not an escape. No literal-chat escape is included.!!,!ls, Markdown images and other nonmatching text retain their chat behavior.The author Zedmor's authorized acceptance applied to
24b944c69245. Maintainer bolichen97 independently accepted the grammar atea75a107. The bot rejected a later command at7b344533because its reason exceeded 500 characters. bolichen97 re-accepted the grammar at60cc7928. These decisions remain commit-scoped; a current-head acceptance is still required.Breaking: a missing or uncheckable requested terminal
cwdproducesterminal_invalid_cwdinstead of opening another directory. This applies to the shared docked, Activity and code-block terminal callers. Reconnect retries the captured directory; Use terminal starting directory explicitly selects the server's configured default. It does not replay the failed command or change the selected workspace. Existing live shells retain their directory.~, make the path absolute, and start there.terminal_invalid_cwd; release the opening reservation./; retain the existing ConPTY home fallback for an invalid unrequested default.Breaking: DELETE
/api/terminal/sessions/{id}returns 409 while setup owns the id. It preserves the reservation and records the refused API access. The existing deletion mutation used byBottomTerminalPanel.tsx,SidePanel.tsxandChatPage.tsxshows its failure notice without retry. Missing ids retain 404. Closing a tab does not cancel unfinished setup; a shell that subsequently publishes remains tracked and eligible for orphan cleanup.Writer sweep against the fetched
origin/mainsnapshot atd5bdff64e0eb0f4f09c6b31492786b4fff4156a6covers the dashboard and split-pane composers, docked and Activity terminal hosts, code-block command delivery, path-completion input, and terminal deletion callers. Direct typing and path completion retain their existing input path; command delivery waits for shell readiness and consumes pending delivery on failure. Requested directories fail explicitly across the shared terminal endpoint; unrequested defaults and existing live shells keep their established behavior.Each bang submission starts a fresh shell; later input in that terminal retains its environment. Code-block confirmations initially focus Cancel too. A local WebSocket send establishes delivery acceptance, not successful command execution. A transient transport redial can complete the original approved handoff while its six-second readiness deadline is still open; a reported terminal error, timeout or disposal consumes that handoff. Descriptor deadlines bound coroutine waits, not an uninterruptible OS close or executor-thread shutdown.
Tests
Current head
aef3b4544bis rebased onto4576a298af, which includes test(website): update two frontend tests left red on main #16227's repair of the two frontend tests main had left red. It also moves the Hindi empty-command refusal to the informal तुम register thathiStyle.test.tsenforces on changed values (I18N_BASE_REFset, as CI runs it). bolichen97's rebases993da3077band04d5e31d05carried8fdba513e5unchanged; this head adds the review fixes below on top of them. On top of8fdba513e5it answers that head's reviews: a worker-descriptor close that fails after a failed spawn no longer replaces the spawn's error, and a timed-out close reports a non-empty message (test_setup_closes_off_loop_before_publication[spawn_close_error]andtest_setup_deadline_keeps_close_owned[False-*-worker]fail without the fix); the compact hint shows the folder name; the empty refusal names the review step in every catalog; the starting-directory recovery button gains a translated tooltip.test_terminal_handler.pypasses 461 cases; the one host failure isenv --default-signal, missing from this box's coreutils 8.22 and untouched here. mypy, flake8,tsc -b, ESLint,i18n:checkand docs lint pass, and the PR's full frontend related set passed 15,896 cases across 644 files withI18N_BASE_REFset.8fdba513e5added the follow-up-send repair on top of bolichen97's rebase60cc7928(base3d465a6066). Its three regressions failed on60cc7928and pass with the fix. The frontend related set passed 10,192 cases across 358 files; TypeScript, ESLint, i18n-string lint, jscpd, docs lint and 478 spec-referencing backend cases pass. New cases also pin the compaction anddashboard.terminal.reuse_currentinterplay from that rebase.All 58 local profile entries were validated for
e1fa8b9c7d4f0b362660e23645f01ea404f03ad4. Subsequent base updates follow the repository's scoped rebase check rule. All 46 feature patches remain unchanged in4937373f4a802080a96635c1a9efc566fa6d9437; completed broader-selection results and their original failures/corrections remain recorded with their execution revisions.Current scoped validation passed 599 backend cases with two skips across five files and 234 frontend cases across six files. This covers the upstream sandbox fixture integration, terminal handler, both composers, and changed crew-log, browser-settings and decisions-provider panels. Every sandbox assertion remains intact; the upstream fixture adds its two
_launcher_nondumpablesetup values.Fresh documentation, catalog, production-build/TypeScript and analyzed-bundle size/cycle checks passed. Other local-gate results are retained with the unchanged-feature-patch proof. Translation rendering passed on the preceding fully checked candidate; the terminal hint and locale feature edits are unchanged.
The preceding scoped update passed 2,101 backend cases with two skips and 199 frontend cases. Before that, keyboard integration passed 510 frontend cases and TypeScript, followed by 24 frontend cases and 2,448 backend cases with four skips. Empty-composer edit-last handling and terminal-draft optimizer suppression remain covered.
The sandbox test fixture and its
platform-compat.mdnote were removed from this PR as unrelated to its goal;test_sandbox_mount_pinned_target.pymatches main. Forty-five earlier backend cases failed because of host tool, process-visibility or service-filesystem differences; every exact case passed under the recorded isolated environment without weakening assertions.ChatInput.lexical.test.tsxmatches main.Independent local reviews applied the extracted GPT and Opus contracts, with GPT 6 requested as the available fallback; served models are unverified. They found no qualifying issues on
0bf1975a593d685980e2f400e589782c7f0fb91c, and focused verifiers cleared45fc1770c8270ff693b0ebb6f5b5a913b4deda45and2f914fa919898e0bf2146479f555fc9ffa2f0be6. A final focused verifier cleared4937373f4a802080a96635c1a9efc566fa6d9437, including the upstream sandbox fixture integration and unchanged feature patches. GitHub's pinned reviews remain authoritative.Regressions cover parsing, both composers and busy states, captured confirmation context, cancellation, attachment refusal, workspace propagation, readiness/error/disposal handling, no replay, explicit directory recovery, terminal capacity, and narrow error controls. Backend tests cover path-probe admission and timeout, early reservation release, cancellation, successor identity, DELETE audit, and descriptor cleanup deadlines. The terminal probe test accepts launcher-owned metadata while rejecting inherited parent values.
Manual verification
Scripted Playwright drove the production SPA and an isolated Linux gateway with real bash PTYs. A deterministic ACP fixture creates the setup conversation and busy/stopped state. The terminal feature windows sent zero agent requests. Windows/macOS behavior is not demonstrated by these recordings.
From a stopped session,
! ./ask-name.shexecuted once in the selected workspace, accepted an interactive answer, and allowedpwdand command history in the same shell. The composer retained the draft. Review and Stop remained visible at desktop and narrow widths. Plain, sensitive, and no-workspace confirmations showed the exact command and initially focused Cancel; the sensitive/no-workspace previews were cancelled.Removing the selected workspace just before Run produced the typed error in under one second. At 320×844 and 320×480, all three actions—Ask the agent, Reconnect, and Use terminal starting directory—were unclipped and passed browser hit testing. Every line of the long workspace path remained reachable by scrolling the message. Explicit fallback opened a real PTY without replay; a fresh confirmation then executed once in a valid workspace.
Real-browser refusal checks passed for empty commands, file/folder attachments, detached chat windows, remote sessions, disabled terminals, and terminal capacity. The full panel queued no ninth command; closing a tab and confirming again executed once. Stop remained accessible during cancellation at 320px. The split-pane pending-metadata check retained
! pwd, disabled Review, and sent no command. Releasing genuine metadata enabled Review without clearing the draft. A code-block command in a workspace removed before Run showed the persistent error for over nine seconds, kept the terminal tab, and sent no command.The pending-metadata fixture delays native fetch responses and WebSocket metadata delivery. It releases the original HTTP Response objects and fresh untrusted MessageEvents carrying the original data and origin unchanged. Other UI state, API bodies, and terminal traffic are not fabricated.
Every completed capture cleaned up its owned processes and restored the staged static files exactly. Failed fixture attempts remain separate and are not evidence of a passing flow.
Screenshots / video
These captures use candidate tree
88b94ba4e47d90dba2704e628197dcbdcc74d337and website tree9275c7e285c6760a10b2a7b0d41cd992704203f3. Their watermark shows the pre-amend local commit5a38ed320b898498ee0579738e827e5fe720f578. The feature implementation and translated hints remain unchanged in4937373f4a802080a96635c1a9efc566fa6d9437: all 28 production patches match the reviewed revision. These captures predate upstream additions to phone navigation, feature previews, sidebar interactions, empty-composer keyboard shortcuts, the mobile session menu, the task dashboard dock, crew-log panel, and browser settings. The recordings retain their original scope; the rebase tests check the overlapping composer and session behavior. Captures with a compact or absent project chip show the full workspace path in the hint; the hint now shows the folder name. The capture retains its original source binding. The recovery video omits only a viewport-resize QA excursion; the unedited narrow screenshots show that layout check, and all command/failure/recovery events remain in order.Interactive terminal demo (27 seconds):
demo-interactive-final-terminal-command.mp4
Missing-directory recovery and fresh confirmation (30 seconds):
demo-recovery-terminal-command.mp4
Confirmation, recovery, and refusal checks
Historical screenshots and videos retain their original capture bindings. The previously published media are retained with their original source bindings.
Related Issues
Part of #8399: its first use, running your own commands in a terminal scoped to the active project while the chat continues, is what this composer shortcut delivers. The issue stays open for its other modes. The direct request is recorded in this PR.
The existing sensitivity-warning heuristic is tracked separately in #15620 (assignee Zedmor; due 2026-10-15).
Checklist