.NET: Log a warning when an unsupported declarative action is skipped - #8056
Open
tirdesh wants to merge 1 commit into
Open
.NET: Log a warning when an unsupported declarative action is skipped#8056tirdesh wants to merge 1 commit into
tirdesh wants to merge 1 commit into
Conversation
WorkflowActionVisitor routes 32 action kinds to NotSupported, which recorded
the skip only through Debug.WriteLine and the HasUnsupportedActions flag.
Debug.WriteLine is [Conditional("DEBUG")] and so is removed in Release, and
the flag sits on an internal sealed type that a caller cannot reach, so a
workflow containing one of those actions completed successfully with no
indication that part of it had not run.
Log a warning through the ILoggerFactory the visitor already receives in its
options, naming the action type and id. Control flow is unchanged and no
public API is added.
Fixes microsoft#8040
tirdesh
requested review from
SergeyMenshykh,
Vincent Biret (baywet),
Peter Ibekwe (peibekwe),
Roger Barreto (rogerbarreto) and
westey (westey-m)
as code owners
September 4, 2026 10:30
tirdesh
had a problem deploying
to
github-app-auth
September 4, 2026 10:30 — with
GitHub Actions
Error
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation resolves the silent-skip issue with appropriate regression coverage and no identified defects.
Pull request overview
Adds visible warning logs when .NET declarative workflows skip unsupported actions, addressing issue #8040.
Changes:
- Creates a visitor-scoped logger and emits action type and ID warnings.
- Adds regression coverage verifying the warning.
File summaries
| File | Description |
|---|---|
WorkflowActionVisitor.cs |
Logs unsupported skipped actions. |
DeclarativeWorkflowTest.cs |
Tests warning level and content. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Author
|
@microsoft-github-policy-service agree |
Vincent Biret (baywet)
approved these changes
Sep 4, 2026
Vincent Biret (baywet)
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution!
SergeyMenshykh
approved these changes
Sep 4, 2026
Vincent Biret (baywet)
enabled auto-merge
September 4, 2026 14:02
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.
Motivation & Context
WorkflowActionVisitorroutes 32 declarative action kinds toNotSupported, which recordsthe skip in two ways and neither reaches the caller.
Debug.WriteLineisSystem.Diagnostics.Debug, annotated[Conditional("DEBUG")], so the compiler removes thecall in Release.
HasUnsupportedActionsis declared onWorkflowActionVisitor, which isinternal sealed, and across the repository it is read in exactly one place, a unit test inDeclarativeWorkflowTest.The result is that a workflow containing
SearchKnowledgeSources,InvokeFlowAction,OAuthInputor any of the other 29 kinds builds, runs to completion and reports successwhile never performing that step. In a Release build nothing is written anywhere.
The Python implementation already reports this.
_declarative_builder.pyin_create_executor_for_actionlogs "Unknown action kind ... action will be skipped" andreturns
Noneat the same point in the build, so the two languages currently disagree.Description & Review Guide
NotSupportednow logs a warning through theILoggerFactorythatDeclarativeWorkflowOptionsalready supplies to the visitor, namingthe action type and id. The visitor creates one logger in its constructor. A regression
test,
UnsupportedActionLogsWarning, builds anAdaptiveDialogcontaining aSearchKnowledgeSourcesaction and asserts a single warning carrying both values. Localchecks:
dotnet build -c Release(0 warnings, 0 errors),dotnet test -f net10.0in Debug and in Release (878 passed, 0 failed), anddotnet format --verify-no-changesclean on both projects. Reverting only the sourcechange and rerunning leaves 877 passing with
UnsupportedActionLogsWarningfailing.was skipped before is still skipped. No public API is added, so the public API baselines
and package validation are untouched.
LoggerFactorydefaults toNullLoggerFactory.Instance, so callers that configure no logging see no behavior change.Debug.WriteLineis[Conditional("DEBUG")], soitem.GetId()did not execute in Release before this changeand now does. It is a plain property read that cannot throw for a
DialogAction, and itrenders as
(null)for an action that carries no id.If you would rather surface this as a
WorkflowWarningEventraised on first run instead of alog, I am happy to change it.
Related Issue
Fixes #8040
No other open pull request for #8040 was found during the duplicate check.
Contribution Checklist