Skip to content

Run one off Bash commands from the composer - #7

Merged
Kaloyanes merged 4 commits into
mainfrom
Kaloyanes/composer-bash-commands
Sep 27, 2026
Merged

Kaloyanes merged 4 commits into
mainfrom
Kaloyanes/composer-bash-commands

Conversation

@Kaloyanes

Copy link
Copy Markdown
Owner

What Changed

Added ! composer commands that execute once in the thread workspace and send their output to the agent as context. Command results appear inline on the user message in web and mobile, with expandable stdout and stderr, exit status, and running or failure states.

Why

Users can run a quick command and give its result to the agent without switching to a terminal or copying output manually.

UI Changes

Added a Bash mode indicator in the composer and expandable command results on messages. Before/after screenshots and an interaction video are not included.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Execute bang-prefixed submissions in the thread workspace and send bounded, redacted results through the existing provider turn flow. Reuse command activities, cancellation, and terminal authorization.

Implemented by GPT-6-Astra through the Codex harness.
- Parse command output into stdout, stderr, and exit code
- Add Bash mode and result status disclosures across web and mobile
- Remove duplicate Bash activity rows
Copilot AI lite review requested due to automatic review settings September 27, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T18:35:13.731922Z 5c43d44 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL labels Sep 27, 2026
@Kaloyanes
Kaloyanes merged commit be6f074 into main Sep 27, 2026
7 of 16 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c43d44694

ℹ️ 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".

Comment on lines +24 to +26
const stderrIndex = body.startsWith("stderr:\n") ? 0 : body.indexOf("\nstderr:\n");
const stdoutPart = stderrIndex === -1 ? body : body.slice(0, Math.max(stderrIndex, 0));
const stderr = stderrIndex === -1 ? "" : body.slice(stderrIndex + (stderrIndex === 0 ? 8 : 9));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Encode stdout and stderr without sentinel collisions

When legitimate stdout contains a line beginning with stderr:, this parser treats the remainder as stderr even if the process wrote nothing to stderr. For example, !printf 'before\nstderr:\nafter\n' is displayed with after as error output. Carry structured stdout/stderr fields from the server or use an encoding that cannot collide with command output.

Useful? React with 👍 / 👎.

Comment on lines +1563 to 1565
: hasWideBlock ||
(entry.bashCommand && props.expandedWorkRows[`bash:${message.id}`])
? { width: props.userBubbleMaxWidth }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the collapsed-state key when sizing Bash output

In the mobile thread feed, expansion is now tracked under bash-collapsed:${message.id}, but this width condition still checks the obsolete bash:${message.id} key. Consequently, the condition never widens a normally expanded Bash result, so short commands such as !ls can leave multiline output cramped into the command bubble instead of using userBubbleMaxWidth.

Useful? React with 👍 / 👎.

Comment on lines +9 to +15
for (const [name, value] of Object.entries(process.env)) {
if (
/(?:TOKEN|SECRET|PASSWORD|API_KEY|PRIVATE_KEY|CREDENTIAL)/i.test(name) &&
value &&
value.length >= 4
) {
sanitized = sanitized.replaceAll(value, "[redacted]");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Redact longer credential values before their prefixes

Credential replacement follows environment iteration order, so overlapping values can leak a suffix. If SHORT_TOKEN=abcd is visited before DATABASE_PASSWORD=abcdefgh, output containing abcdefgh becomes [redacted]efgh; the later replacement can no longer match the full password, and that partial credential is then persisted and sent to the provider. Deduplicate and sort sensitive values by descending length before replacing them.

Useful? React with 👍 / 👎.

@Kaloyanes
Kaloyanes deleted the Kaloyanes/composer-bash-commands branch October 28, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants