Send welcome message in debugger console on connect#4419
Open
rentziass wants to merge 4 commits into
Open
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>
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. The message content is controlled by a newDebuggerWelcomeMessagefield on the job message from run-service, using three-state semantics:helpin the console)A
_welcomeMessageSentguard prevents duplicate messages ifconfigurationDoneis sent more than once (e.g. client retry or reconnection).Changes
AgentJobRequestMessage+DebuggerConfig: new nullableDebuggerWelcomeMessage/WelcomeMessagefield threaded from the job message through to the debuggerDapDebugger.SendWelcomeMessage(): sends the appropriate console output event afterconfigurationDone