Skip to content

feat: add shell tool display mode preference#25029

Draft
DanielleMaywood wants to merge 1 commit intomainfrom
feat/shell-tool-display-mode
Draft

feat: add shell tool display mode preference#25029
DanielleMaywood wants to merge 1 commit intomainfrom
feat/shell-tool-display-mode

Conversation

@DanielleMaywood
Copy link
Copy Markdown
Contributor

@DanielleMaywood DanielleMaywood commented May 7, 2026

Note

🤖 This PR was written by Coder Agent on behalf of Danielle Maywood

Stacked on #25027. Adds the shell_tool_display_mode user preference for Coder Agents shell tool calls (execute and process_output) while keeping the code-diff preference in the base PR.

This remains a draft because the shell/execute/process output collapse UX is still iterative.

shell_tool_display_mode intentionally supports only auto, always_expanded, and always_collapsed. preview remains a thinking-block-only mode.

Changes

  • Adds backend/API storage, validation, authz wrappers, generated docs, and generated TypeScript types for shell_tool_display_mode.
  • Adds the Shell Tool Display setting on the Agents general settings page.
  • Threads the shell display mode from preferences through ConversationTimeline and Tool renderers.
  • Wraps ExecuteTool and ProcessOutputTool in ToolCollapsible so they can start in auto, expanded, or collapsed states.
  • Extends Storybook coverage for shell display modes and preference-driven timeline rendering.

Verification

  • make gen
  • make test RUN=TestAgentDisplayModePreferences TEST_PACKAGES=./coderd
  • make test RUN=TestDBAuthzRecursive/GetUserShellToolDisplayMode TEST_PACKAGES=./coderd/database/dbauthz
  • make test RUN=TestDBAuthzRecursive/UpdateUserShellToolDisplayMode TEST_PACKAGES=./coderd/database/dbauthz
  • make test RUN=TestDBAuthzRecursive/GetUserCodeDiffDisplayMode TEST_PACKAGES=./coderd/database/dbauthz
  • make test RUN=TestDBAuthzRecursive/UpdateUserCodeDiffDisplayMode TEST_PACKAGES=./coderd/database/dbauthz
  • cd site && pnpm test src/pages/AgentsPage/components/ChatElements/tools/displayMode.test.ts
  • cd site && CI=1 pnpm test:storybook src/pages/AgentsPage/components/ChatElements/tools/Tool.stories.tsx -t "Execute Success|Execute Always Collapsed|Process Output Always Collapsed|Write File Success|Write File Always Expanded|Edit Files Single Success|Edit Files Always Collapsed" --run
  • cd site && CI=1 pnpm test:storybook src/pages/AgentsPage/components/ChatConversation/ConversationTimeline.stories.tsx -t "Tool Display Modes From Preferences" --run
  • cd site && CI=1 pnpm test:storybook src/pages/AgentsPage/AgentSettingsGeneralPageView.stories.tsx -t "Renders Agent Display Mode Settings" --run
  • cd site && pnpm check
  • make fmt
  • make lint
  • git diff --check
  • commit hook pre-commit passed
Implementation plan / split context

The original implementation plan covered two preferences:

  • code_diff_display_mode for write_file, edit_files, and fallback inline diffs.
  • shell_tool_display_mode for execute and process_output.

The work was split into stacked draft PRs:

  1. feat: add code diff display mode preference #25027: code diff display modes only, intended to be shippable first.
  2. This PR: shell/execute/process output display modes, stacked on feat: add code diff display mode preference #25027 while the UX is still being refined.

Both tool preferences use auto, always_expanded, and always_collapsed. auto preserves the previous per-tool default behavior.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Docs preview

📖 View docs preview for docs/reference/api/schemas.md

Base automatically changed from feat/code-diff-display-mode to main May 7, 2026 19:15
@DanielleMaywood DanielleMaywood force-pushed the feat/shell-tool-display-mode branch from 1124851 to 9272f83 Compare May 7, 2026 20:31
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