Skip to content

Shell mode (!) output hidden when "Hide tool details" is enabled; AI-invoked tools flicker before hiding #22667

Closed as not planned

Description

@riuoku

Description

When tool_details_visibility is set to false (via the "Hide tool details" command or tool_details keybind), user-initiated shell commands via ! mode are hidden after execution. The command output appears briefly (fraction of a second). The same flickering behavior occurs for AI-invoked tool calls — they flash on screen while running and then vanish.

Expected behavior

  1. User-initiated shell commands (!) should always be visible regardless of the tool details toggle. The user explicitly ran the command and expects to see its output.
  2. When tool details are hidden, AI-invoked tools should never appear at all — not even briefly while running. The current flicker is caused by shouldHide only checking for status === "completed", leaving running/pending states visible.

Root cause suggested by Claude Opus 4.6

shouldHide in the ToolPart component (packages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1490-1494):

const shouldHide = createMemo(() => {
  if (ctx.showDetails()) return false
  if (props.part.state.status !== "completed") return false
  return true
})

This only hides completed tool parts, so running tools remain visible until they finish — causing the flicker. It also makes no distinction between user-initiated shell commands and AI-invoked tool calls.

Proposed fix

  1. Add synthetic: z.boolean().optional() to the ToolPart schema in message-v2.ts (mirrors the existing field on TextPart). No database migration needed since parts are stored as JSON.
  2. Set synthetic: true on the tool part created in shellImpl (prompt.ts) to mark it as user-initiated.
  3. Rewrite shouldHide to:
const shouldHide = createMemo(() => {
  if (ctx.showDetails()) return false
  if (props.part.synthetic) return false
  if (props.part.state.status === "error") return false
  return true
})

This ensures:

  • User-initiated shell commands are always visible
  • Errored tools are always visible (user needs to see failures)
  • All other tool parts (pending/running/completed) are fully hidden when details are off, eliminating the flicker

Plugins

No response

OpenCode version

1.3.17

Steps to reproduce

  1. Open the command palette and select "Hide tool details"
  2. Type !ls (or any shell command)
  3. Observe: the command output appears briefly while running, then disappears

Alternatively, type a prompt that causes the LLM to invoke bash — the tool invocation block flickers on screen and then gets removed.

Screenshot and/or share link

No response

Operating System

Debian GNU/Linux 13.4

Terminal

xfce4-terminal

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Apr 15, 2026
  2. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  3. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

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