Skip to content

feat: toggle tool details visibility (resolves #4824)#4882

Merged
rekram1-node merged 30 commits into
anomalyco:devfrom
ariane-emory:feat/toggle-tool-action-visibility
Dec 2, 2025
Merged

feat: toggle tool details visibility (resolves #4824)#4882
rekram1-node merged 30 commits into
anomalyco:devfrom
ariane-emory:feat/toggle-tool-action-visibility

Conversation

@ariane-emory

@ariane-emory ariane-emory commented Nov 29, 2025

Copy link
Copy Markdown
Contributor

Resolves #4824.

Successful tool calls can be hidden.

Unsuccessful tool calls are always displayed so that any error messages can be seen,

The modal used by the "ask" permission is NOT hidden.

In the command_list, the command's name is either Hide tool usage or Show tool usage, depending on its current state.

The current state of the toggle is persisted to kv.json as tool_usage_visibility.

@ariane-emory
ariane-emory marked this pull request as draft November 29, 2025 00:14
@ariane-emory
ariane-emory marked this pull request as ready for review November 29, 2025 00:16
@ariane-emory
ariane-emory force-pushed the feat/toggle-tool-action-visibility branch from d7c52fc to e80d742 Compare November 30, 2025 06:36
Comment thread packages/opencode/src/session/message-v2.ts Outdated
@ariane-emory

Copy link
Copy Markdown
Contributor Author

@rekram1-node Tidied up that spurious line you'd drawn my attention to. This should probably be good to go now, I think?

Comment thread packages/opencode/src/permission/index.ts Outdated
Comment thread packages/sdk/go/session.go Outdated
Comment thread packages/ui/src/components/message-part.tsx Outdated
@ariane-emory

Copy link
Copy Markdown
Contributor Author

@rekram1-node Seems like most of that can go. Temporarily reverting to draft status while I finish tidying it up.

@ariane-emory
ariane-emory marked this pull request as draft December 2, 2025 00:41
The hiding logic only needs to check for pending permissions, not historical
tracking of tools that asked for permission. Once a tool completes successfully,
whether it required permission is irrelevant to the hiding decision.
- Add hideDetails to BasicToolProps interface
- Restore !props.hideDetails condition for Collapsible.Arrow visibility
- Ensures proper tool hiding functionality works correctly
…tsx were in fact unnecessary, resync with dev
@ariane-emory
ariane-emory marked this pull request as ready for review December 2, 2025 01:19
@ariane-emory

Copy link
Copy Markdown
Contributor Author

@rekram1-node Tidied up, the changes should be nice and lean now. :)

@rekram1-node

Copy link
Copy Markdown
Collaborator

/oc rename the things in this pr called "tool usage" to "tool details"

@opencode-agent

opencode-agent Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Done! I've renamed all instances of "tool usage" to "tool details" in the PR:

  1. Line 118: Changed tool_usage_visibility to tool_details_visibility in the KV key
  2. Line 459: Changed command titles from "Hide tool usage" / "Show tool usage" to "Hide tool details" / "Show tool details"
  3. Line 465: Changed tool_usage_visibility to tool_details_visibility in the KV set call

The changes are now consistent throughout the file, and the feature will persist visibility state to kv.json as tool_details_visibility.

New%20session%20-%202025-12-02T01%3A29%3A35.950Z
opencode session  |  github run

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
@rekram1-node

Copy link
Copy Markdown
Collaborator

/oc rename showActions to showDetails, also if shouldHide is true return undefined instead of null

@opencode-agent

opencode-agent Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Perfect! I've successfully completed all the requested changes:

  1. Renamed showActions to showDetails throughout the file:

    • Line 84: Updated the context type definition
    • Line 118: Updated the signal creation
    • Line 459-467: Updated the command dialog entry to use showDetails
    • Line 770: Updated the context provider value
    • Line 1145: Updated the ToolPart component destructuring
  2. Changed the return value from null to undefined in the ToolPart component:

    • Line 1156-1157: When shouldHide is true, the function now returns undefined instead of null

The changes maintain consistency with the PR's goal of managing tool details visibility, and TypeScript compilation passes without errors.

New%20session%20-%202025-12-02T01%3A33%3A45.327Z
opencode session  |  github run

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
@rekram1-node rekram1-node changed the title feat: toggle tool action visibility (resolves #4824) feat: toggle tool details visibility (resolves #4824) Dec 2, 2025
@rekram1-node
rekram1-node merged commit 1864e8c into anomalyco:dev Dec 2, 2025
3 checks passed
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
…lyco#4882)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
…lyco#4882)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
…lyco#4882)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
…lyco#4882)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
…lyco#4882)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request Jun 14, 2026
…lyco#4882)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
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.

Hiding action blocks

3 participants