Skip to content

[WIP]Add provider-wide diagnostic collection - #364

Draft
fioan89 wants to merge 6 commits into
mainfrom
feature/deployment-diagnostics
Draft

fioan89 wants to merge 6 commits into
mainfrom
feature/deployment-diagnostics

Conversation

@fioan89

@fioan89 fioan89 commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Toolbox's general log collection action does not let providers attach additional diagnostic bundles. This left users without a single action that combined detailed Coder diagnostics with local Toolbox logs.

We added "Collect detailed deployment and Toolbox logs" to the Coder provider menu. The Coder provider now collects support bundles for every accessible workspace and its agents, regardless of the workspace filter, and combines them with local Toolbox and JetBrains daemon logs.
This provider action differs from "Collect logs" in the workspace or environment menu, which limits Coder bundle collection to that workspace and its selected agent.

We added a diagnostic collector page that reports progress and supports cancellation. The provider collector preserves available diagnostics when individual bundles or log files cannot be collected, while the log path resolver handles Windows, macOS, and Linux locations and overrides. We also updated the README to explain both actions and added localized UI messages and tests for collection, cancellation, and path handling.

Workspace log archives previously lacked Coder deployment and workspace
diagnostics, so troubleshooting connection issues required collecting a
separate support bundle.

In this change, we added a Coder support bundle to the Toolbox ZIP
generated by an environment's Collect logs action. The plugin uses the
existing deployment login to collect diagnostics for the selected
workspace and its agent, when available.

Collection supports cancellation and has a two-minute timeout. If it
fails, the plugin preserves the other Toolbox diagnostics and adds a
failure report instead of a partial bundle.

We also documented where bundle collection is available and added tests
for collection, cancellation, timeout, and cleanup.
We merged the latest workspace progress reporting changes from main and
resolved overlapping additions while preserving support-bundle collection
and coverage for both features.
The fixed two-minute limit could interrupt a valid diagnostic collection,
and the plugin discarded an inherited session token that would normally
take precedence over stored credentials.

We changed support-bundle collection to wait until the Coder CLI finishes
or the user cancels. The plugin still terminates the process on
cancellation, while the CLI can now use inherited credentials according
to its normal precedence. We also removed redundant header-command
cleanup without changing the existing header configuration behavior.

We updated the README to describe the revised behavior and removed the
obsolete timeout test. The CLI manager and diagnostic collector tests
passed, including cancellation and process cleanup coverage.
Toolbox's general log collection action does not let providers attach
additional diagnostic bundles. This left users without a single action
that combined detailed Coder diagnostics with local Toolbox logs.

We added "Collect detailed deployment and Toolbox logs" to the Coder
provider menu. The Coder provider now collects support bundles for every
accessible workspace and its agents, regardless of the workspace filter,
and combines them with local Toolbox and JetBrains daemon logs. This
provider action differs from "Collect logs" in the workspace or
environment menu, which limits Coder bundle collection to that workspace
and its selected agent.

We added a diagnostic collector page that reports progress and supports
cancellation. The provider collector preserves available diagnostics when
individual bundles or log files cannot be collected, while the log path
resolver handles Windows, macOS, and Linux locations and overrides. We
also updated the README to explain both actions and added localized UI
messages and tests for collection, cancellation, and path handling.
Diagnostic collection opened a separate page and did not provide a
visible Cancel button, making it difficult for users to stop collection
while working with their workspace list.

We moved collection progress and an explicit Cancel control into the
expanded Coder header, where they temporarily replace the filters. The
Coder provider now expands that header when collection starts, and the
header reports that it is busy and cancellable until collection ends.

We changed the header to restore the filters and their previous selections
after collection. On success, Toolbox reveals the archive in the file
manager without leaving a completion label or a Show logs button in the
header. The Coder provider also cancels collection when it closes.

We removed the separate collector page and its unused localization
messages, updated the README, and added header tests covering progress,
cancellation, repeated requests, failures, and filter restoration.
# Conflicts:
#	CHANGELOG.md
#	README.md

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving since the code looks good but I think getting a support bundle for every accessible workspace is going to be too much information. When I tested and saw the "1/1266" I quickly noped out lol

In a scenario where a user has connection issues, we would probably end up just ignoring everything but the affected workspace anyway. And all the deployment information the support bundle collects will be duplicated (and any workspace that is off will have nothing but deployment info, so those are especially redundant).

Could we add the Toolbox logs to the individual agent log collection action instead of having this global one?

@fioan89

fioan89 commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

Approving since the code looks good but I think getting a support bundle for every accessible workspace is going to be too much information. When I tested and saw the "1/1266" I quickly noped out lol

In a scenario where a user has connection issues, we would probably end up just ignoring everything but the affected workspace anyway. And all the deployment information the support bundle collects will be duplicated (and any workspace that is off will have nothing but deployment info, so those are especially redundant).

Could we add the Toolbox logs to the individual agent log collection action instead of having this global one?

I double-checked the environment’s Collect logs action: Toolbox already includes its local logs and daemon logs alongside our bundle for the selected workspace and agent. That remains the most useful action for troubleshooting a specific connection.

The gap is Toolbox’s general Settings > About > Collect logs and diagnostic data action. It currently has no hook allowing providers to add their own bundles, which is why we introduced a separate provider action. Once JetBrains exposes the appropriate hooks, we can move this collection into the general action.

My counterproposal is to narrow the provider action to one of these scopes:

  • Detailed diagnostics for active connections only: collect workspace and agent bundles only where the plugin already has an active SSH connection, alongside Toolbox logs. This avoids enumerating unrelated workspaces or opening connections just to collect diagnostics. Failed connection attempts would still be investigated through the affected environment’s action.

  • A single deployment bundle: run coder support bundle without workspace or agent arguments and include Toolbox logs. This provides general deployment diagnostics without collecting each workspace’s build logs and agent diagnostics.

What do you think?

@fioan89

fioan89 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

Dropping/drafting this PR - after a talk with @matifali and @code-asher we only need to provide logs per workspace/agent.

@fioan89 fioan89 changed the title Add provider-wide diagnostic collection [WIP]Add provider-wide diagnostic collection Sep 22, 2026
@fioan89
fioan89 marked this pull request as draft September 22, 2026 18:28
@matifali
matifali removed their request for review November 3, 2026 06:22
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.

Add command to create a support bundle

2 participants