Skip to content

feat: run bang commands directly in the session workspace - #14008

Merged
bolichen97 merged 1 commit into
mainfrom
worktree/exclamation_mark
Oct 4, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
worktree/exclamation_mark

Conversation

@Zedmor

@Zedmor Zedmor commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Execute these commands through an agent turn.
  • Add terminal execution for remote workspace sessions.

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 command hint 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 ! cmd after 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.tsx and ChatPane.tsx share hooks/useTerminalCommand.ts; App.tsx returns detached terminals to the main dashboard before handoff. utils/terminalRegistry.ts consumes failed deliveries, and handlers/terminal.py bounds requested-directory probes and descriptor cleanup. CliPanel.tsx and ErrorNotice.tsx keep recovery actions visible independently of long error text.

The website/src/i18n catalogs, learn-cron-dashboard.md, terminal feature map, and website/src/test regressions 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 ! hello can 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 at ea75a107. The bot rejected a later command at 7b344533 because its reason exceeded 500 characters. bolichen97 re-accepted the grammar at 60cc7928. These decisions remain commit-scoped; a current-head acceptance is still required.

Breaking: a missing or uncheckable requested terminal cwd produces terminal_invalid_cwd instead 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.

Directory input Terminal behavior
Existing requested path Expand ~, make the path absolute, and start there.
Missing, non-directory or uncheckable request Refuse with terminal_invalid_cwd; release the opening reservation.
No requested path Use configured cwd, then server HOME, then /; retain the existing ConPTY home fallback for an invalid unrequested default.
Reconnect to a live shell Keep that shell’s directory.
Explicit starting-directory recovery Clear the refused request and use the normal default; leave the failed command unsent.

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 by BottomTerminalPanel.tsx, SidePanel.tsx and ChatPage.tsx shows 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/main snapshot at d5bdff64e0eb0f4f09c6b31492786b4fff4156a6 covers 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 aef3b4544b is rebased onto 4576a298af, 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 that hiStyle.test.ts enforces on changed values (I18N_BASE_REF set, as CI runs it). bolichen97's rebases 993da3077b and 04d5e31d05 carried 8fdba513e5 unchanged; this head adds the review fixes below on top of them. On top of 8fdba513e5 it 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] and test_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.py passes 461 cases; the one host failure is env --default-signal, missing from this box's coreutils 8.22 and untouched here. mypy, flake8, tsc -b, ESLint, i18n:check and docs lint pass, and the PR's full frontend related set passed 15,896 cases across 644 files with I18N_BASE_REF set.

  • 8fdba513e5 added the follow-up-send repair on top of bolichen97's rebase 60cc7928 (base 3d465a6066). Its three regressions failed on 60cc7928 and 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 and dashboard.terminal.reuse_current interplay 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 in 4937373f4a802080a96635c1a9efc566fa6d9437; 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_nondumpable setup 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.md note were removed from this PR as unrelated to its goal; test_sandbox_mount_pinned_target.py matches 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.tsx matches 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 cleared 45fc1770c8270ff693b0ebb6f5b5a913b4deda45 and 2f914fa919898e0bf2146479f555fc9ffa2f0be6. A final focused verifier cleared 4937373f4a802080a96635c1a9efc566fa6d9437, 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.sh executed once in the selected workspace, accepted an interactive answer, and allowed pwd and 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 88b94ba4e47d90dba2704e628197dcbdcc74d337 and website tree 9275c7e285c6760a10b2a7b0d41cd992704203f3. Their watermark shows the pre-amend local commit 5a38ed320b898498ee0579738e827e5fe720f578. The feature implementation and translated hints remain unchanged in 4937373f4a802080a96635c1a9efc566fa6d9437: 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.

Inline shell shortcut beside the existing composer shortcuts

Interactive command output in the selected workspace, with the draft retained

Missing workspace at 320px: the draft and all three error actions remain accessible

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

Busy composer at 320px keeps Review and Stop accessible

Plain command confirmation with native Cancel focus

Sensitive command preview; cancelled without execution

No workspace selected: single-line preview

No workspace selected: multiline preview

Missing workspace with terminal and composer visible

All three error actions remain accessible in a short 320px panel

Empty command is refused

File attachment is refused and retained

Folder attachment is refused and retained

Detached chat directs the user to the main window

Actual remote session refuses local terminal execution

Disabled terminal refuses execution

Full terminal panel queues no extra command

Stop remains accessible while cancellation is pending

Code-block startup failure keeps a persistent notice and leaves the command unsent

New split pane refuses the command until its session metadata arrives

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

  • One clean feature commit with a Conventional Commits title
  • Required local checks and related tests pass
  • Self-review and independent final-revision reviews complete
  • Owning documentation updated
  • No secrets, credentials or internal references introduced in the diff

@Zedmor
Zedmor requested review from a team and dwu96 September 25, 2026 23:01
@Zedmor

Zedmor commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

This PR lets a person type ! <command> in a workspace chat and run it directly in an interactive terminal, including after stopping an agent. The selected workspace is the execution directory, and the command never sends, resumes, queues, or steers an agent turn. A failed launch keeps the draft.

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.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

Design-level review of aef3b4544b8a1e2710c642db12f97a34f75fc58d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

This UI feature also carries backend terminal changes that alter every terminal caller, and the ! grammar still lacks the maintainer acceptance its own description requires for this head.

Watch

  • Unrelated backend changes ride in a composer-feature PR. Three of them reach past the bang command: requested-cwd refusal (raise ValueError("Terminal working directory does not exist")), DELETE returning 409 during setup, and the new _close_terminal_fd deadlines. All three change the docked, Activity and code-block terminals too, including saved tabs whose workspace is gone, which used to fall back to HOME and now fail. They come with a near-full re-indent of api_terminal_ws. Reverting the bang feature would mean reverting the shared PTY lifecycle with it, and a regression in either is hard to pin to one cause.
    Clears when: the terminal.py lifecycle, cwd-refusal and DELETE-409 changes move to their own PR, or a maintainer explicitly accepts landing them together.
  • Reserving ! has no escape and is still not accepted for this commit. The description says "No literal-chat escape is included… a current-head acceptance is still required". Once shipped, any chat message starting with ! can never reach the agent, so a user who means it literally has to retype it. The prior acceptances were for earlier commits.
    Clears when: a maintainer accepts the grammar at aef3b4544b, ideally recorded in docs/decisions/.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of aef3b4544b8a1e2710c642db12f97a34f75fc58d and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] aef3b45

False positive or not applicable? A repository writer can comment:
/ai-review override gpt aef3b4544b8a1e2710c642db12f97a34f75fc58d: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of aef3b4544b8a1e2710c642db12f97a34f75fc58d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The cold reader could not identify the ! shell command hint, and would not click "Use terminal starting directory" or act on the "terminal off" refusal.

Watch

  • The feature's only discovery cue is jargon. The placeholder (/command · @file · $skill · ! shell command) drew "no idea what … '! shell command' mean -> I would type normal text, but not the symbols" (shot-01). The ! path stays hidden from anyone who doesn't already know it. This hits every new user, every time; the impact is lost discovery, not task failure. Smallest fix: lead with the verb, e.g. ! run in terminal.
  • The recovery button doesn't say where it goes. For "Use terminal starting directory" the reader said "no idea which folder that is -> no" (shots 03, 09). The answer is only in a hover tooltip, so touch users never see it. This is a rare path, but it's the only alternative to "Reconnect". Show the resolved directory in the label or under the button.
  • The "terminal off" refusal tells a user to edit a config key. For "Enable dashboard.terminal.enabled in the server configuration" the reader said "I would give up" (shot-16). It's rare but a dead end. Name where the setting lives, or link to it.
  • The primary button was read correctly but only as "a guess". "Review terminal command" appears above the composer while the Send button disappears (shot-02). It's a mode swap with no indicator at the input itself apart from the muted "Terminal panel" line. Recordings exist, so a human should check that the swap reads as one control changing.

Suggestions

  • In the bare-hint state, "Terminal panel" says where the command goes but not what will happen. Change terminal_panel to "Runs in terminal panel".

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@Zedmor overrode this lane for aef3b4544b8a1e2710c642db12f97a34f75fc58d via /ai-review override (this commit only).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed aef3b4544b8a1e2710c642db12f97a34f75fc58d — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] aef3b45

Verdict parsed from the review's SHA-scoped output markers for commit aef3b4544b8a1e2710c642db12f97a34f75fc58d.

False positive or not applicable? A repository writer can comment:
/ai-review override fable aef3b4544b8a1e2710c642db12f97a34f75fc58d: <one-sentence reason>

@Zedmor
Zedmor force-pushed the worktree/exclamation_mark branch from 20b1a17 to 77ee731 Compare September 26, 2026 00:07
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 26, 2026
@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=e4d3aa8f1aee — Missing-directory behavior across terminal surfaces

fixed in 77ee731. The authenticated WebSocket now emits terminal_invalid_cwd before a bounded close, without spawning a shell. The shared registry parks immediately, ignores online/visibility revival, and exposes the reason to CliPanel. Explicit Reconnect can recover after restoration; old ready callbacks are consumed so it cannot replay a failed command. Backend transport and registry/panel regressions cover this behavior.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=dc98def39b4a — Explain known refusals before submission

fixed in 77ee731. The hook exposes its current refusal while rendering and subscribes to terminal availability. Popout/embed, remote sessions, disabled terminals, attachments, and bare bang drafts display the reason and disable Run before a click. Submission rechecks the same conditions. Focused composer tests assert the visible explanation and disabled action before submission.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=64731e703d39 — Make the primary terminal action readable

fixed in 77ee731. The terminal action now has the visible localized Run label beside its icon, while retaining the Run in terminal accessible name. The new label is covered by composer tests and the refreshed UI captures.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=5a93d5516944 — Point a missing-workspace failure at recovery

fixed in 77ee731. terminal_invalid_cwd reaches the composer through the optional terminal-ready failure callback immediately. The localized message says the workspace no longer exists and asks the user to select an existing workspace before running again. The draft survives, selecting a workspace clears the stale error, and a new submission is required.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=77d00a58f73d — Default composer bang-command decision

needs-a-decision. This is the requested product behavior: a leading separated bang in workspace chat selects direct terminal execution, with output in the session terminal and no agent turn. No accepted RFC on the base covers that syntax. Maintainer: please record whether this default-on composer behavior is approved for the final reviewed head. This disposition does not authorize an override.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=ddb01fa10dd7 — Pane-scoped consumer requires its own handoff

rebutted with the counted-consumer evidence requested by Clears when. ChatPane passes its own slot.project; useSessionGrid pane focus changes local grid state without changing the global activeSlot. ChatPage’s mc:run-in-terminal handler always takes currentProjectRef from that global active slot and has no workspace override. A command in pane B while A is globally selected would therefore run in A’s directory. MembersPage also mounts ChatPane without mounting ChatPage’s event listener. The regression in ChatInput.terminalCommand.test.tsx mounts two independently scoped composers, checks distinct workspaces, changes only A’s session, and proves only B’s pending command runs. 77ee731 also removes the duplicate timeout constant by using RUN_IN_TERMINAL_READY_DEADLINE_MS.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=affea43a60e3 — Product-shape authorization before merge

needs-a-decision. No RFC covering composer bang commands is accepted on the base branch. The implementation and tests preserve the requested direct-terminal scope; they do not decide the repository’s product gate. Maintainer: approve this product shape with the head-specific first-principles decision required by the PR template, or require an accepted RFC before merge. I will not self-authorize that decision.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=fd89d98b48d2 — Terminal composer entry in the feature map

fixed in 77ee731. The Terminal panel row now names the main/shared composer ! → Run entry and ChatPage, ChatPane, ChatInput, and useTerminalCommand as owning frontend files. It retains the existing dock, per-chat terminal, handler, and API mappings.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=4d576a140324 — Staged folders count as attachments

fixed in 77ee731. hasAttachments includes pendingDirs.length > 0. A regression stages @docs/, changes the draft into a bang command, and submits by button and Enter. Both paths retain the folder and draft, display the attachment refusal, and invoke neither a terminal nor an agent action.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=cf46cffbac97 — Do not silently retry rejected terminal directories

fixed in 77ee731. Missing directories are surfaced through a typed WebSocket error, consumed by the shared registry and displayed in dock/activity terminal ErrorNotice. The connection parks without automatic retry, including foreground/online events. Explicit Reconnect retries the same directory after restoration without replaying old ready callbacks. The error, no-spawn reservation cleanup, and live-PTY reconnect contract have backend and frontend coverage.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=d5541e3ef7af — Keep force-stop and force-reset reachable

fixed in 77ee731. Run renders alongside the existing shared cancellation branch rather than replacing it. Stop, the pulsing force-stop control, and the delayed force-reset escape hatch remain available for a bang draft. Tests exercise these states, prove stopping preserves the draft without executing it, and verify a later Run remains independent of agent actions.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 26, 2026
@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • span=fd1211a6046a — Requested composer entry point

rebutted. This is the user-requested shortcut, recorded in the PR’s original intent comment. It deliberately reuses the existing terminal capability.
The request in this development session was: “I want to work on ! feature - in claude user can use ! to execute command in the terminal - can we do that in the context of the session when user want to run command in the workspace that is selected directly without agent (when agent stopped execution for some reason)”
The user selected this output behavior: “Open the session’s terminal panel, with interactive shell support”. This supplies the requested issue/thread provenance; the benefit is initiating the command from the composer with its selected workspace and no agent turn. I am not claiming that an existing terminal cannot execute the same shell command.

@Zedmor

Zedmor commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • span=10f93377d1b3 — Run is the field’s submit affordance

rebutted. website/AUTOSDE.yaml:324 explicitly excludes “a text field’s own affordances (clear, reveal, submit-inside-the-field)” from max-two-buttons-per-row. The blocking flag and growth-only clause do not remove this exception.
ChatInput.tsx:4174 defines the single bordered composer field containing both its borderless textarea and bottom controls. Run is inside that field and submits its current draft through fireComposer, the same handler invoked by the configured send shortcut. Terminal mode changes the submission destination and suppresses ordinary Send; it does not add a second submit action.
Therefore Run is excluded, leaving at most Mic and agent Stop as the two counted actions. The exception would not cover an independent action outside the field. Screenshot 09 in the PR shows the field boundary and control placement; the 390px browser check also found no overflow, though the rule exception is the deciding evidence.
Two independent read-only checks reached this interpretation. No code change or human override is requested; the rule’s stated exclusion covers this control.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Current-head acceptance of the ! grammar — needs-a-decision (span=13920af0fbe3)

Maintainer bolichen97 accepted the grammar at ea75a107, 60cc7928 and 04d5e31d05, and has been asked to re-record it for 553126a152. Until that override lands, this record asserts no acceptance.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Terminal-backend changes ride with the feature — rebutted (span=82ec92487ddc)

The feature depends on each of these changes. Maintainer review M1/M2 (4c2f80f5) asked for the bounded cwd probe, and for an opening reservation that cannot leak. The descriptor-close deadline keeps that reservation from being held forever by a wedged close. DELETE 409 stops a close from destroying a reservation the opener still owns. Requested-cwd refusal keeps a reviewed command from running somewhere else, and the maintainer accepted it at 60cc7928. Splitting them out would ship the composer path without those guarantees.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Where Send went — rebutted (span=f68bb8bb3e8c)

In terminal mode nothing is sent to the agent, so the chat send arrow would promise the wrong action. Enter and the primary Review terminal command button both open the same confirmation, and nothing runs before Run. The empty-command refusal now says the command is reviewed before it runs. In the cited shot the reader inferred the review button correctly.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Welcome overlap and identical tab names — rebutted (span=be073dc194b3)

WelcomeView.tsx is not changed by this PR. Any tall composer compresses it the same way, and shot-17 predates #15820 in this branch base. Tab titles come from the terminal panel naming shared by every caller. Each bang submission opens its own tab on purpose, so commands never share a shell, and tabs keep the existing rename action. bolichen97 rebutted the same tab point at 60cc7928.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • terminal_pending beside "Session ready" — rebutted (span=3d432d99ae46)

shot-20 is the disclosed pending-metadata fixture, which deliberately delays the workspace metadata after the chat is ready. "Session ready" describes chat. The terminal refusal waits for the session details it needs to choose a directory, and names both remedies: wait, or select another session. Outside that fixture, the gap is the brief metadata fetch.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Config key in terminal_unavailable — rebutted (span=fb7640a53f4d)

The settings UI has no toggle for this; only server configuration enables the terminal. A previous UX round asked for that exact cause and remedy (194965d4). For the operator, the exact key dashboard.terminal.enabled is the actionable part. Keeping it lets the person who can change the server search for it.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Link docs instead of the raw key — rebutted (span=5b4711445cfd)

The packaged docs could not carry this remedy. dashboard.md's Terminal section covers the terminal protocol and ownership, and never mentions dashboard.terminal.enabled, so a link would lead away from the one actionable fact. A generic "ask the operator" line drops it too. The current copy says the terminal is turned off and names the setting that enables it, which is the whole remedy for a solo operator, the common case.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • "Runs in: {{workspace}}" hint wording — rebutted (span=111712670fa9)

The hint names the destination as a UI object: the terminal panel, with its tabs, is where output appears and where the user closes tabs at capacity. "Runs in" would drop that pointer. With the project chip compact or absent, the hint already names the workspace folder: "Terminal panel · ". When the chip already shows the workspace, "Terminal panel" alone avoids repeating it.

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.
@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 one more head. CI on 553126a152 caught a Hindi register slip in my terminal_empty edit (hiStyle.test.ts, changed values must use तुम), so aef3b4544b fixes that string and rebases onto main 4576a298af. Nothing else changed.

The override request now applies to this head:

/ai-review override first-principles aef3b4544b... for the same ! decision.

Also: approve, or dismiss the Sep 29 changes-requested review, once CI is green. Sorry for the churn.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Composer ! reservation without an accepted RFC — needs-a-decision (span=cc86b4814134)

No RFC covering the bang grammar is claimed. Maintainer bolichen97 accepted this grammar at ea75a107, 60cc7928 and 04d5e31d05, and has been asked to re-record /ai-review override first-principles for aef3b4544b. This record asserts no override.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Item 2, no literal-chat escape — needs-a-decision (span=9c88fe63e901)

This is the same decision as the blocker. The description declares the break: dropping the prefix returns to chat. A current-head maintainer override has been requested, and this record asserts none.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Item 7, DELETE 409 while setup owns the id — rebutted (span=84e90669fe23)

A test that fails without it exists: replacing the 409 branch with base's pop-and-404 makes test_delete_during_successful_setup_refuses_until_publication fail in both parametrizations. Re-run locally on aef3b4544b.
The harm it pins: a DELETE during the opener's awaits used to destroy the reservation, so a second opener could claim the id while the first still published a shell. Maintainer review M1 (4c2f80f5) traced that reservation to the bounded setup this PR adds. The bang flow opens a fresh tab per command and can be closed mid-setup, which makes the race reachable.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Item 8, descriptor-close deadline — rebutted (span=ab608925464c)

The reported defect is in maintainer review 4c2f80f5 (minor list): the unbounded shielded wait around the worker and controller closes made the handler uncancellable, so "on a wedged PTY fd close, gateway shutdown waits on it indefinitely". _close_terminal_fd is that fix.
The cwd-probe timeout bounds a different await, the directory stat before any PTY exists, so it cannot cover a close after a shell is spawned. test_setup_deadline_keeps_close_owned pins the bound and fails without it.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Backend lifecycle changes ride with the feature — rebutted (span=419abac3588a)

A maintainer reviewed and asked for these in this PR. Review M1/M2 (4c2f80f5) requested the bounded cwd probe and a reservation that cannot leak. The minor list requested bounding the shielded close waits. The DELETE 409 protects that reservation, and a test fails without it.
bolichen97 accepted the requested-cwd refusal for shared callers at 60cc7928, as the root-cause fix for a confirmed command running in the wrong directory. Splitting them out would ship the composer path without those guarantees.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Grammar acceptance for this commit — needs-a-decision (span=4ba0f5cf4f3b)

bolichen97 accepted the grammar at three earlier heads and has been asked to re-record it for aef3b4544b. This record asserts no acceptance. Recording it under docs/decisions/ is the maintainer's call.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • ! shell command discovery cue — rebutted (span=4ffa8e303817)

The cue sits beside /command, @file and $skill in the same placeholder. It uses the same terse syntax-plus-noun form as its neighbours, which an earlier UX round chose (cfbf714e). A reader who does not want shell commands is meant to type normal text, and that still works.
Teaching the shortcut beyond the placeholder would be onboarding, which is outside this shortcut's goal.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Starting-directory destination on touch — rebutted (span=13ded409fafb)

On this commit the button carries a tooltip naming dashboard.terminal.cwd, then the server's home directory. The error above the button already says the alternative is "the terminal's starting directory", and the server resolves that value, so the browser has no path to print.
Showing the resolved path inline would need a new server preview contract, and this rare recovery path does not justify one. Choosing it only opens a shell; no command runs.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Config key in the terminal-off refusal — rebutted (span=437f573fd35e)

No settings toggle exists; only server configuration enables the terminal. An earlier UX round asked for exactly this cause and remedy (194965d4). The exact key is the actionable part for whoever runs the server, usually the same person on a local install, and the packaged docs never mention it, so a link would lead nowhere.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • Mode swap read only as "a guess" — rebutted (span=993c985a79ff)

The reader guessed correctly. In terminal mode nothing goes to the agent, so the chat Send arrow would promise the wrong action. Enter and Review terminal command both open the same confirmation, Cancel is focused first, and nothing runs before Run. The hint row with the terminal icon marks the mode, and the bare-! refusal now says the command is reviewed before it runs.

@Zedmor

Zedmor commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author
  • "Runs in terminal panel" wording — rebutted (span=dbfce0211160)

The hint names the destination the user then finds. Review terminal command directly below it states the action, and its tooltip reads "Review and run in terminal". Adding "Runs in" to every hint would repeat that, and an earlier round removed exactly such a sentence ("Runs without the agent", f8e30e72).

@Zedmor

Zedmor commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles aef3b45: Same decision maintainer bolichen97 accepted at ea75a10, 60cc792 and 04d5e31: reserving ! for terminal mode with no literal-chat escape is an intentional break; users drop the prefix to chat.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@Zedmor marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for aef3b4544b8a1e2710c642db12f97a34f75fc58d.

Same decision maintainer bolichen97 accepted at ea75a10, 60cc792 and 04d5e31: reserving ! for terminal mode with no literal-chat escape is an intentional break; users drop the prefix to chat.

This decision applies only to this commit. A new push requires a new judgment.

@Zedmor

Zedmor commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 all 94 checks on aef3b4544b are green, and PR Readiness passed.

For transparency: I recorded the First Principles override on this head myself (comment). Its reason cites your acceptances of the identical ! grammar at ea75a107, 60cc7928 and 04d5e31d05; nothing in the grammar changed since. If you'd rather it carry your name, re-post it and I'll defer to yours.

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.

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

Labels

ci:macos Run the on-demand macOS suite against this PR head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants