Send welcome message in debugger console on connect#4419
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
DebuggerWelcomeMessagefield fromAgentJobRequestMessagethroughDebuggerConfiginto the DAP debugger. - Added
DapDebugger.SendWelcomeMessage()invoked after theconfigurationDoneresponse, guarded by a_welcomeMessageSentflag 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
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>
Replace the null/empty/value tri-state semantics of DebuggerWelcomeMessage with an explicit OverrideDebuggerWelcomeMessage feature flag carried in the job variables. Run-service can now safely use omitempty on the welcome message string: when the flag is absent the runner shows the default help text, and when the flag is set the (possibly empty) message is used as-is. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adjust the DAP welcome message tests to exercise the new override flag behavior (default help when disabled, custom or suppressed when enabled), and collapse the now-redundant null/empty serialization round-trip tests into a single check. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TingluoHuang
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
configurationDonehandshake to draw the user's attention to the console and its capabilities.Approach
After the DAP
configurationDoneresponse is sent (following the same pattern as the post-initializeevent), the debugger emits a console output event with a welcome message. By default the runner shows its built-in help text (the same content as typinghelpin the console).The default can be overridden via the job message from run-service using two pieces:
actions_runner_override_debugger_welcome_messagein the job variables -- when set totrue, the runner takes its welcome message from the field below instead of using the default.DebuggerWelcomeMessagestring field on the job message carrying the override content.Behavior:
actions_runner_override_debugger_welcome_messageDebuggerWelcomeMessagefalsetruetrueThis shape plays nicely with a Go producer using
omitempty: the bool flag carries the intent and the string carries the content, so we no longer rely on preserving a null-vs-empty distinction across serialization boundaries.A
_welcomeMessageSentguard prevents duplicate messages ifconfigurationDoneis sent more than once. The guard is reset when a new client connects so that a reconnecting client (which has lost its console output) sees the welcome message again.Changes
Constants.Runner.Features: newOverrideDebuggerWelcomeMessagefeature flag key.AgentJobRequestMessage: newDebuggerWelcomeMessagestring field.DebuggerConfig: newOverrideWelcomeMessagebool plusWelcomeMessagestring; populated from the feature flag and job message field inExecutionContext.DapDebugger.SendWelcomeMessage(): emits the console output event afterconfigurationDone, honoring the override flag.