Skip to content

Fix Policy Diagnostics Command to Prevent Indefinite Wait - #330030

Merged
joshspicer merged 2 commits into
mainfrom
agents/fix-policy-diagnostics-issue
Aug 10, 2026
Merged

joshspicer merged 2 commits into
mainfrom
agents/fix-policy-diagnostics-issue

Conversation

@joshspicer

Copy link
Copy Markdown
Contributor

This pull request addresses the issue where the Developer: Policy Diagnostics command fails to open the editor due to an indefinite wait caused by the Agent Host managed-settings probe.

Changes Made:

  • Timeout Implementation: Introduced a five-second timeout for the managed-settings probe to prevent it from blocking indefinitely.
  • SDK Delay Resolution: Bypassed a redundant five-minute authentication check in the SDK, allowing for quicker access to managed settings.
  • Error Reporting: Enhanced error reporting to specify which stage of the process is slow, rather than providing a generic timeout message.
  • Progress Notification: Wrapped the entire diagnostics generation process in a VS Code loading notification to improve user experience.

Validation:

  • Conducted live tests confirming that the report opens promptly after the timeout.
  • Passed all validation checks including ESLint, type-checking, and unit tests.

This fix resolves the issue reported in issue #329973 and improves the overall responsiveness of the Policy Diagnostics feature.

Copilot AI balanced review requested due to automatic review settings August 10, 2026 17:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prevents Policy Diagnostics from hanging on Agent Host managed-settings probes.

Changes:

  • Adds layered probe timeouts and stage-specific errors.
  • Shows progress while generating diagnostics.
  • Bypasses connection/authentication delays and adds SDK probe tests.
Show a summary per file
File Description
developerActions.ts Adds progress UI and report-level timeout.
copilotAgent.ts Adds SDK authentication and staged timeouts.
localAgentHostService.ts Avoids waiting for protocol readiness.
copilotAgent.test.ts Tests authentication forwarding and timeout behavior.

Review details

Tip

Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Balanced

@joshspicer
joshspicer enabled auto-merge (squash) August 10, 2026 18:17
@joshspicer
joshspicer merged commit 725ac17 into main Aug 10, 2026
29 of 30 checks passed
@joshspicer
joshspicer deleted the agents/fix-policy-diagnostics-issue branch August 10, 2026 20:19
@vs-code-engineering vs-code-engineering Bot added this to the 1.134.0 milestone Aug 10, 2026
Misha Damjanic (mdamjanic7) added a commit to mdamjanic7/pihub that referenced this pull request Aug 24, 2026
…n (temporary core patch)

Upstream microsoft#329839 (bba5e40, 2026-08-17 sync) made _getManagementService
async resolving to the ProxyChannel.toService proxy; _callManagement awaits
it, so JS treats the proxy as a thenable — .then is proxied as an RPC whose
function arguments serialize to zero-length objects. The agent host fails to
deserialize the frame (SyntaxError: Unexpected end of JSON input on stderr),
never responds, and the awaited call hangs forever (Compact Conversation
spinner, 100% repro).

Split the readiness wait (void) from the proxy accessor (sync) so the proxy
never travels through promise resolution. Superseded by upstream microsoft#330030 /
microsoft#330567 (bd094b5) in the deferred slice — drop on that merge and re-home
compactSession onto the synchronous accessor. Ledger: docs/pihub-patches.md.
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants