Skip to content

task command injects a synthetic user instruction that can override review-only scope #41866

Description

@jaysonvirissimo

Description

Task calls with a command create a synthetic user message after the subtask completes:

Summarize the task tool output above and continue with your task.

This is injected unconditionally in packages/opencode/src/session/prompt.ts when task.command is present.

For a command representing review-only work, this can be interpreted as permission to implement a reported fix. The command's original scope is not carried into the continuation, and the injected text appears as a user instruction even though the user did not send it.

Expected: command-specific scope remains authoritative. A review command should result in a review summary, not an imperative continuation that can authorize edits. The runtime should omit this message, make it non-instructional, or include an explicit scope-preserving continuation.

Related: #33044 also concerns synthetic continuation messages, but this is a command-semantics issue.

Plugins

Custom review command / task wrapper.

OpenCode version

1.18.16

Steps to reproduce

  1. Invoke Task with a review-only prompt and a non-empty command value, such as review.
  2. Have the task report a code issue.
  3. Observe that OpenCode adds the synthetic user message above.
  4. The next turn has an imperative instruction to “continue,” without preserving the review-only constraint; an agent may edit the worktree to fix its review finding.

Screenshot and/or share link

None.

Operating System

macOS

Terminal

OpenCode CLI

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions