Skip to content

Send welcome message in debugger console on connect#4419

Merged
rentziass merged 8 commits into
mainfrom
rentziass/debugger-welcome-message
May 18, 2026
Merged

Send welcome message in debugger console on connect#4419
rentziass merged 8 commits into
mainfrom
rentziass/debugger-welcome-message

Conversation

@rentziass
Copy link
Copy Markdown
Member

@rentziass rentziass commented May 14, 2026

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. By default the runner shows its built-in help text (the same content as typing help in the console).

The default can be overridden via the job message from run-service using two pieces:

  • A feature flag actions_runner_override_debugger_welcome_message in the job variables -- when set to true, the runner takes its welcome message from the field below instead of using the default.
  • A new DebuggerWelcomeMessage string field on the job message carrying the override content.

Behavior:

actions_runner_override_debugger_welcome_message DebuggerWelcomeMessage Result
absent / false (ignored) default built-in help text
true non-empty custom message shown as-is
true null / empty welcome message suppressed

This 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 _welcomeMessageSent guard prevents duplicate messages if configurationDone is 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: new OverrideDebuggerWelcomeMessage feature flag key.
  • AgentJobRequestMessage: new DebuggerWelcomeMessage string field.
  • DebuggerConfig: new OverrideWelcomeMessage bool plus WelcomeMessage string; populated from the feature flag and job message field in ExecutionContext.
  • DapDebugger.SendWelcomeMessage(): emits the console output event after configurationDone, honoring the override flag.
  • Tests: DAP-level tests covering default, custom, empty-suppressed, null-suppressed, once-only, and reconnect; plus a job-message serialization round-trip test.

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
Comment thread src/Sdk/DTPipelines/Pipelines/AgentJobRequestMessage.cs Outdated
Comment thread src/Runner.Worker/Dap/DebuggerConfig.cs Outdated
rentziass and others added 2 commits May 18, 2026 09:52
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>
Comment thread src/Sdk/DTPipelines/Pipelines/AgentJobRequestMessage.cs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rentziass rentziass merged commit ae2896c into main May 18, 2026
12 checks passed
@rentziass rentziass deleted the rentziass/debugger-welcome-message branch May 18, 2026 16:14
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