Skip to content

Add displayPrompt support to session.send across all SDKs#1470

Merged
devm33 merged 3 commits into
mainfrom
devm33/display-prompt
May 28, 2026
Merged

Add displayPrompt support to session.send across all SDKs#1470
devm33 merged 3 commits into
mainfrom
devm33/display-prompt

Conversation

@devm33
Copy link
Copy Markdown
Member

@devm33 devm33 commented May 27, 2026

Summary

Add a displayPrompt field to the session.send RPC params across all language SDKs. When provided, this value is shown in the conversation timeline instead of the actual prompt text.

Changes

  • Rust (rust/src/types.rs, rust/src/session.rs): Added display_prompt: Option<String> field to MessageOptions with a with_display_prompt() builder method, serialized as displayPrompt in params.
  • Node.js (nodejs/src/types.ts, nodejs/src/session.ts): Added optional displayPrompt to MessageOptions interface and pass it through in send().
  • Python (python/copilot/session.py): Added display_prompt keyword argument to send() and send_and_wait().
  • Go (go/types.go, go/session.go): Added DisplayPrompt field to MessageOptions and sessionSendRequest.
  • Java (java/src/main/java/.../rpc/MessageOptions.java, SendMessageRequest.java, CopilotSession.java): Added displayPrompt field with getter/setter and pass it in send().
  • .NET (dotnet/src/Types.cs, dotnet/src/Session.cs): Added DisplayPrompt property to MessageOptions and SendMessageRequest, passed in SendAsync().

Motivation

The GitHub app sends prompts that may contain additional context (e.g., canvas context, system instructions) prepended to the user's message. The displayPrompt field lets the app tell the runtime what to show in the timeline as the user's message, rather than showing the full enriched prompt.

@devm33 devm33 requested a review from a team as a code owner May 27, 2026 21:24
Copilot AI review requested due to automatic review settings May 27, 2026 21:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support in the Rust SDK for an optional “display-only” prompt label when sending a message, aligning Rust with the existing displayPrompt parameter used in other language SDKs and the JSON-RPC schema.

Changes:

  • Extend MessageOptions with display_prompt: Option<String> plus a with_display_prompt() builder.
  • Include displayPrompt in the session.send JSON-RPC params when display_prompt is set.
Show a summary per file
File Description
rust/src/types.rs Adds the display_prompt option and builder method to MessageOptions.
rust/src/session.rs Serializes displayPrompt into session.send params when provided.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread rust/src/session.rs
Add display_prompt field to MessageOptions that gets serialized as
displayPrompt in the session.send JSON-RPC params. This allows callers
to specify a different prompt to display to users than what is sent to
the model.

Includes integration tests verifying:
- displayPrompt is included with expected value when set
- displayPrompt is omitted when not set

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@devm33 devm33 force-pushed the devm33/display-prompt branch from bd7a3bc to 1246929 Compare May 27, 2026 21:59
@devm33 devm33 marked this pull request as draft May 27, 2026 22:14
@devm33 devm33 requested a review from Copilot May 27, 2026 22:14
@devm33 devm33 marked this pull request as ready for review May 27, 2026 22:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

@devm33 devm33 enabled auto-merge May 28, 2026 00:17
Pass the displayPrompt option through to the session.send RPC call in
each SDK, matching the Rust implementation in this PR. When provided,
displayPrompt is shown in the timeline instead of the actual prompt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review

This PR adds displayPrompt support to Go, Java, Node.js, Python, and Rust — great cross-SDK coverage! However, .NET is missing the equivalent change.

The .NET SDK needs updates in three places:

1. dotnet/src/Types.csMessageOptions class (after line 2796):

/// <summary>
/// If provided, this is shown in the timeline instead of <see cref="Prompt"/>.
/// </summary>
public string? DisplayPrompt { get; set; }

Also update the Clone() copy constructor to include DisplayPrompt = other.DisplayPrompt.

2. dotnet/src/Session.csSendMessageRequest record (after RequestHeaders, line 1673):

[JsonPropertyName("displayPrompt")]
public string? DisplayPrompt { get; init; }

3. dotnet/src/Session.csSendAsync method (in the SendMessageRequest initializer, after RequestHeaders):

DisplayPrompt = options.DisplayPrompt,

Without these changes, .NET consumers won't be able to set a display prompt, creating a feature gap relative to the other four SDKs.

Generated by SDK Consistency Review Agent for issue #1470 · ● 3.6M ·

- Reformat Java Javadoc comments to satisfy Spotless line-length rules
- Add DisplayPrompt to .NET MessageOptions, SendMessageRequest, and
  SendAsync method to close the feature gap

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request May 28, 2026
@devm33 devm33 changed the title rust: Add display_prompt to MessageOptions for session.send Add displayPrompt support to session.send across all SDKs May 28, 2026
@devm33 devm33 added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit 8172d12 May 28, 2026
42 checks passed
@devm33 devm33 deleted the devm33/display-prompt branch May 28, 2026 02:11
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.

3 participants