Skip to content

fix: Fix crash during agent blueprint creation by improving error handling and logging in AgentBlueprintService (#366)#369

Open
gs-ysingh wants to merge 2 commits intomainfrom
fix/issue-366-a365-blueprint-creation-crash
Open

fix: Fix crash during agent blueprint creation by improving error handling and logging in AgentBlueprintService (#366)#369
gs-ysingh wants to merge 2 commits intomainfrom
fix/issue-366-a365-blueprint-creation-crash

Conversation

@gs-ysingh
Copy link
Copy Markdown

Fixes #366

Summary: Fix crash during agent blueprint creation by improving error handling and logging in AgentBlueprintService

Changes

  • src/Microsoft.Agents.A365.DevTools.Cli/Services/AgentBlueprintService.cs: Improve error handling and logging in SetInheritablePermissionsAsync to catch and log detailed errors that may cause the CLI to crash during blueprint creation. Add null checks and more robust parsing to prevent unhandled exceptions.

This PR was created automatically by AI Team Mate 🤖

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…sync to catch and log detailed errors that may cause the CLI to crash during blueprint creation. Add null checks and more robust parsing to prevent unhandled exceptions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gs-ysingh gs-ysingh requested review from a team as code owners April 14, 2026 07:39
Copilot AI review requested due to automatic review settings April 14, 2026 07:39
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA def24dd.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

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

This PR addresses the “application terminated unexpectedly” crash reported during agent blueprint creation by strengthening error handling and adding more detailed logging around inheritable-permissions updates in AgentBlueprintService.

Changes:

  • Wrap the inheritable-permissions PATCH call with exception handling to prevent unhandled exceptions from bubbling up.
  • Add additional warning/error logs to provide more context (blueprint/resource) when PATCH fails.
  • Improve the outer exception log to include the exception object (stack trace) and more context.

Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/AgentBlueprintService.cs Outdated
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/AgentBlueprintService.cs Outdated
- Propagate OperationCanceledException in both inner (PATCH) and outer catch
  blocks so Ctrl+C is not swallowed as a generic error result
- Hoist blueprintObjectId before the try block so the resolved object ID is
  available in the outer catch log (falls back to blueprintId if resolve failed)
- Replace generic "PATCH failed" error string with a descriptive message that
  includes the blueprint and resource IDs
- Add regression tests: SetInheritablePermissionsAsync_ReturnsFalse_WhenPatchThrows
  and SetInheritablePermissionsAsync_ReturnsFalse_WhenPatchReturnsFalse
- Add CHANGELOG entries for the crash fix and cancellation propagation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sellakumaran sellakumaran enabled auto-merge (squash) April 15, 2026 00:24
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.

a365 blueprint creation crash

3 participants