Repository navigation
refactor(ai): run approved commands in existing terminal sessions - #345
shihuili1218 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41602c8635
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Reclaim the whole output budget, even if the echoed input | ||
| // itself was larger than the head window. With echo disabled | ||
| // this branch never runs and the first output line is retained. | ||
| *output = BoundedOutput::default(); |
There was a problem hiding this comment.
Preserve earlier output when stripping a multiline command's echo
When bracketed paste is disabled in an interactive Bash terminal, a multiline command executes line by line, so real output can arrive before the final line containing the echoed sentinel template. Resetting the entire output buffer here discards those earlier results. For example, approving echo FIRST\necho SECOND produces FIRST, then the second command's echo, then SECOND; the new collector returns only SECOND. This silently removes diagnostic data from the result supplied to the AI and audit log. Strip the echoed input without clearing output already produced by earlier lines.
Useful? React with 👍 / 👎.
Closes #334
Core now runs approved commands in the current SSH shell, local or connector PTY, native SSM, serial, or Telnet session. The terminal still shows the command echo and streams output as it arrives. A command inherits the working directory, environment, and nested shell the user is already in.
run_command,match_file, patch steps, and file capability probes share one executor. It observes the existing transport reader, collects bounded output, and passes the result through the existing redaction and audit path. Approval retries return the original result. Stopping a command targets the original connection instance. A timeout ends collection and lets the remote command continue. Serial and Telnet retain manual completion and cancellation without sending Ctrl+C.Entry points
rssh-server.Verification
npm testpassed 1,435 tests.npm run build,cargo fmt --all --check, and the Tauri, server, and CLI feature checks passed.cargo test --workspace --all-featurespassed 1,101 tests with one ignored doctest.tsc --noEmitreports the same 18 diagnostics on this branch and its base.