Skip to content

Send welcome message in debugger console on connect#4419

Open
rentziass wants to merge 4 commits into
mainfrom
rentziass/debugger-welcome-message
Open

Send welcome message in debugger console on connect#4419
rentziass wants to merge 4 commits into
mainfrom
rentziass/debugger-welcome-message

Conversation

@rentziass
Copy link
Copy Markdown
Member

When a user connects to the DAP debugger, there's no indication of what the debug console can do. This PR sends a welcome message after the configurationDone handshake to draw the user's attention to the console and its capabilities.

Approach

After the DAP configurationDone response is sent (following the same pattern as the post-initialize event), the debugger emits a console output event with a welcome message. The message content is controlled by a new DebuggerWelcomeMessage field on the job message from run-service, using three-state semantics:

  • null (key absent from JSON) -- show the default help text (same as typing help in the console)
  • empty string -- suppress the welcome message entirely
  • non-empty string -- display the provided custom message

A _welcomeMessageSent guard prevents duplicate messages if configurationDone is sent more than once (e.g. client retry or reconnection).

Changes

  • AgentJobRequestMessage + DebuggerConfig: new nullable DebuggerWelcomeMessage/WelcomeMessage field threaded from the job message through to the debugger
  • DapDebugger.SendWelcomeMessage(): sends the appropriate console output event after configurationDone
  • Tests: 4 DAP-level tests (default help, custom message, empty suppression, once-only) + 3 serialization round-trip tests for the new field

rentziass and others added 3 commits May 14, 2026 12:48
Add a nullable string DebuggerWelcomeMessage property to
AgentJobRequestMessage (from run-service) and thread it through
DebuggerConfig so the runner can use it when a debugger client
connects.

Three-state semantics:
- null (absent): use default help text
- empty string: suppress welcome message
- non-empty: display the provided message

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After the DAP configurationDone handshake completes, send a console
output event with the welcome message. Behaviour is gated behind the
actions_runner_debugger_welcome_message feature flag and respects the
three-state WelcomeMessage from DebuggerConfig:

- null  → default help text (DapReplParser.GetGeneralHelp())
- ""    → no message
- value → custom message from run-service

A _welcomeMessageSent guard prevents duplicate messages on repeated
configurationDone requests or reconnections.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DapDebuggerL0:
- Default help shown when WelcomeMessage is null and flag enabled
- Custom message shown when WelcomeMessage is non-empty
- No message when WelcomeMessage is empty string
- No message when feature flag is disabled
- Welcome message sent only once per session

AgentJobRequestMessageL0:
- DebuggerWelcomeMessage deserializes as null when absent
- Empty string preserved on deserialization
- Custom string preserved on deserialization

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 12:10
@rentziass rentziass requested a review from a team as a code owner May 14, 2026 12:10
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 a welcome message that is sent to the DAP debugger console after the configurationDone handshake, controlled by a new optional DebuggerWelcomeMessage field on the job request message (null = default help, empty = suppressed, non-empty = custom text).

Changes:

  • Threaded a new optional DebuggerWelcomeMessage field from AgentJobRequestMessage through DebuggerConfig into the DAP debugger.
  • Added DapDebugger.SendWelcomeMessage() invoked after the configurationDone response, guarded by a _welcomeMessageSent flag to avoid duplicates.
  • Added L0 tests for default/custom/empty welcome behavior, once-only delivery, and JSON deserialization round-trips for the new field.
Show a summary per file
File Description
src/Sdk/DTPipelines/Pipelines/AgentJobRequestMessage.cs Adds nullable DebuggerWelcomeMessage DataMember with EmitDefaultValue = false.
src/Runner.Worker/Dap/DebuggerConfig.cs Adds optional welcomeMessage ctor argument and WelcomeMessage property.
src/Runner.Worker/ExecutionContext.cs Passes message.DebuggerWelcomeMessage into the DebuggerConfig constructor.
src/Runner.Worker/Dap/DapDebugger.cs Adds SendWelcomeMessage() and invokes it after configurationDone, with _welcomeMessageSent guard.
src/Test/L0/Worker/DapDebuggerL0.cs Adds 4 new tests and updates existing tests to consume the additional welcome output event.
src/Test/L0/Sdk/RSWebApi/AgentJobRequestMessageL0.cs Adds 3 deserialization tests for the new DebuggerWelcomeMessage field (absent/empty/custom).

Copilot's findings

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

Comment thread src/Test/L0/Worker/DapDebuggerL0.cs
Comment thread src/Runner.Worker/Dap/DapDebugger.cs
A reconnecting DAP client has lost its console output, so it should
see the welcome message again. Reset _welcomeMessageSent in
HandleClientConnected() so each new connection gets the message.
The duplicate guard still prevents multiple sends within a single
connection's handshake.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rentziass rentziass enabled auto-merge (squash) May 14, 2026 14:02
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.

2 participants