Skip to content

D2: Convert VS Code terminal tools to CommandRun objects #56

@Arithmomaniac

Description

@Arithmomaniac

Parent: #54

Problem

CLI shell commands become rich CommandRun objects with command/title/output, rendered as collapsible blocks with $ command prefix and full output. VS Code run_in_terminal becomes a generic ToolInvocation with Using "Run in Terminal" — the biggest visual divergence.

The data IS already available in VS Code's format: toolSpecificData.commandLine has the command, toolSpecificData.terminalCommandOutput.text has the output. We just don't extract it into a CommandRun.

Change

  1. Add _extract_command_run(item) -> CommandRun | None helper (sibling to _parse_tool_invocation_serialized)
  2. In _process_response_items(), call it right after the existing tool_inv append — one new if cmd_run: command_runs.append(cmd_run) line
  3. Update raw_blocks content for terminal tools to use $ {command} format (triggers the matched_cmd rendering path in the template)

Scope

~20 lines — new helper function + 3 lines in _process_response_items

Conflict note

Fully additive approach avoids restructuring the _process_response_items flow that the agent-collapsibles branch modifies. The new helper and call site sit outside their if subagent/elif chain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions