Graceful failure when extensions fail to start: suppress verbose errors and surface update hints#6832
Graceful failure when extensions fail to start: suppress verbose errors and surface update hints#6832
Conversation
…tensions Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>
spboyer
left a comment
There was a problem hiding this comment.
Two concerns:
-
Non-timeout startup errors are masked as timeout failures (High)
The fallback warning always says extensions failed to initialize within the timeout period even for real startup errors (invalid binary, permission denied, bad args). WaitUntilReady returns the original failure error, not just timeout, but the message hardcodes timeout wording for all failures. Consider conditionally branching the messaging on context.DeadlineExceeded vs other error types. -
Synchronous network work in failure path (Medium)
On extension startup failure, the middleware now performs update checks (including source refresh via FindExtensions which can issue HTTP requests) before continuing to next(ctx). This adds blocking I/O in a failure path that should be fast. Consider making update checks async with a short timeout, or skip remote refresh entirely during startup failure handling.
|
@copilot address feedback |
…rk I/O from failure path Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
Both issues addressed in 19b8566:
|
When an extension fails to start,
azdwas dumping the extension's full stdout/stderr to the console—including internal gRPC logs, timestamps, and EOF traces—producing noise irrelevant to the user. There was also no guidance that an outdated extension might be the root cause.Changes
cmd/middleware/extensions.gostdout/stderron failure is now routed tolog.Printfonly, keeping it available for debug inspection (AZD_DEBUG) without polluting normal output.extensionStartFailurestruct tracking each extension alongside atimedOut bool(set viaerrors.Is(err, context.DeadlineExceeded)). The failure message now says "failed to initialize" generically; theAZD_EXT_TIMEOUThint is only shown when at least one failure was actually a deadline exceeded.checkUpdatesForExtensionsconsults the already-cached registry data for failed extensions. Any extension with an available upgrade emits aux.WarningMessagewith actionable upgrade instructions before the generic startup-failure block. No network requests are made in the failure path—if the cache for a source is expired or missing, that extension is simply skipped.Before (on extension startup failure):
After — timeout failure with a newer version available:
After — real startup error (e.g. invalid binary, permission denied):
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.