Skip to content

fix(chat): run a code block's command in the conversation instead of asking the agent - #7651

Merged
reachjalil merged 1 commit into
devfrom
fix/chat-run-button-runs-shell
Nov 21, 2026
Merged

reachjalil merged 1 commit into
devfrom
fix/chat-run-button-runs-shell

Conversation

@reachjalil

Copy link
Copy Markdown
Member

What is this about?

The Run button on a suggested shell command now runs the command itself in the conversation, then lets the agent continue from the output.

What problem does it solve?

Clicking Run sent a chat message on your behalf ("Run this command, then continue from its output") and waited for the agent to decide to run it. It looked like you had typed a prompt, and an extra agent step stood between the click and the result.

What was the situation before?

Before After
Click Run A user message asks the agent to run it The engine runs the command right away
Transcript Your prompt, then the agent's shell step A "Ran a command" step with its output
Agent Runs the command, then replies Replies from the output without running it again

How is this implemented?

  • opencode-v2-adapter.ts: session.shell calls the engine's POST /api/session/:id/shell. Shell messages are shown as a bash step. session.shell.started and session.shell.ended events refresh the transcript.
  • session-sync.ts: a refresh event with no message ID reloads the newest messages.
  • session-surface.tsx: Run sends a shell draft, then adds a hidden note (session.synthetic, resume) that tells the agent to continue. The engine already includes the command output in the model's context.
  • The OpenCode v1 engine still uses the old message, because it can't run a command for you.

What else changed?

The feature doc now describes the new behavior.

Release note

Clicking Run on a suggested command now runs it immediately in the chat, and the agent picks up from its output.

Evidence

  • Focused tests: the shell request body, the shell message shown as a bash step, and the refresh events (apps/app/tests/chat-run-commands.test.ts). No journey spec covers this flag yet.

…asking the agent

Signed-off-by: Jalil <reachjalil@gmail.com>
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Nov 21, 2026 12:41am UTC
openwork-den Ready Ready Preview Nov 21, 2026 12:41am UTC
openwork-landing Ready Ready Preview, v0 Nov 21, 2026 12:41am UTC

Request Review

This branch was successfully deployed

3 active deployments
Preview – openwork-app — 8e69f39b Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-landing — 8e69f39b Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-den — 8e69f39b Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant