Fixing bug that was hiding error messages when publish and unpublish happen - #503
Merged
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
deepaligargms
enabled auto-merge (squash)
September 23, 2026 23:05
deepaligargms
requested review from
Bhaarath Raguru (ragurubhaarath)
and removed request for
Copilot
September 23, 2026 23:05
Copilot started reviewing on behalf of
Krishnadheeraj (DheerajPannala)
September 29, 2026 16:08
View session
Krishnadheeraj (DheerajPannala)
approved these changes
Sep 29, 2026
Krishnadheeraj (DheerajPannala)
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Status envelopes containing only Error still lose the server message, and the user-facing fix lacks a changelog entry.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Improves develop-mcp publish failures by preserving server-provided error messages.
Changes:
- Parses envelope, problem-detail, and fallback error responses.
- Adds seven parsing regression tests.
| File | Description |
|---|---|
Agent365ToolingService.cs |
Builds populated publish failure responses. |
Agent365ToolingServicePureFunctionTests.cs |
Tests supported failure-body formats. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Bhaarath Raguru (ragurubhaarath)
approved these changes
Sep 29, 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.


What
a365 develop-mcp publishprintedERROR: Failed to publish ...: No response receivedonevery failure — a duplicate-instance rejection, a 400 validation error, or a downstream
5xx all looked identical, with the actual server message thrown away.
Root cause:
Agent365ToolingService.PublishServerAsyncdidreturn null;on failure,discarding the
responseContentthatValidateResponseAsynchad already extracted. Theexecutor then rendered
publishResponse?.Message ?? "No response received"→ the fallbackstring, always.
Change
internal static BuildPublishFailureResponse(responseContent, statusCode, logger)thatreturns a populated
PublishMcpServerResponse(Status = "Failed") carrying the real message.The publish failure branch now calls it instead of
return null;.{ Status, Message }envelope — including double-serialized bodies, because theplatform returns its already-JSON string via
Ok(string), which re-serializes it(unwrapped by the existing
DeserializeWithDoubleSerializationhelper);{ error[, details] }/{ message }problem bodies (viaExtractErrorMessage,preferring
details);Server returned {statusCode}when the body has no readable message.This mirrors what
AddServerAsyncalready does correctly — publish was the outlier.Before / after
Before:
ERROR: Failed to publish MCP server msdyn_DataverseMCPServer: No response received
After (example — duplicate instance):
ERROR: Failed to publish MCP server msdyn_DataverseMCPServer: MCP server '...' is already
published in environment '...' under alias '...'. Only one published instance is allowed
per server.
Tests
7 new
[Fact]s inAgent365ToolingServicePureFunctionTestscovering every branch:double-serialized envelope, single-serialized envelope,
{error}(400),{error,details}(500, prefers
details), empty body, null body, non-JSON body. Full pure-function +publish/develop/tooling suites green (175 tests).
Reviewer notes
PublishServerAsyncstill returns the deserializedsuccess response; only the failure branch changed.
ValidateResponseAsyncalready flags both non-2xx responses and 200 bodies whose envelopeStatus != "Success", so this correctly surfaces the platform's 200-with-Status:"Failed"rejection as well.