Skip to content

Expose full-output artifact locations in shell exit events #2391

Description

@anthonykim1

Problem

When the built-in shell tool returns a truncated output preview, structured tool.execution_complete shell_exit content exposes outputPreview and outputTruncated, but the public SDK does not expose a typed location for the complete output.

SDK consumers therefore cannot provide a reliable "open full output" experience without parsing presentation-oriented completion text.

VS Code tracking issue:

Related/follow-up shell-tool SDK surface request (We already have initScript support now):

Ask

Add an optional outputFilePath field to the public shell-exit event type:

export interface ToolExecutionCompleteContentShellExit {
  type: "shell_exit";
  shellId: string;
  exitCode: number;
  cwd?: string;
  outputPreview?: string;
  outputTruncated?: boolean;
  /** Path reported when shell output exceeded the configured large-output threshold. */
  outputFilePath?: string;
}

The important part is that the complete-output location is structured SDK data rather than presentation text.

Desired semantics

  • Present only on completed shell output that exceeded the configured large-output threshold and reports a file path.
  • Identifies the output corresponding to outputPreview.
  • Documents which filesystem namespace the SDK consumer resolves the path in.
  • Documents availability/lifetime and text encoding.
  • Remains optional and backward compatible when no path is reported.

Acceptance criteria

  • Expose outputFilePath?: string in the public SDK shell-exit event types.
  • Generate the field consistently across supported SDK languages.
  • Document its threshold, resolution, and availability semantics.
  • Add SDK contract/code-generation coverage for events with and without the field.
  • Enable VS Code Agent Host to consume the structured value without parsing generic tool progress or completion text.

Metadata

Metadata

Assignees

Labels

enhancementruntimeRequires a change in the copilot-agent-runtime repo

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions