Skip to content

Fix show bundle logs in Cursor - #2093

Open
misha-db wants to merge 2 commits into
mainfrom
fix-show-bundle-logs-cursor
Open

Fix show bundle logs in Cursor#2093
misha-db wants to merge 2 commits into
mainfrom
fix-show-bundle-logs-cursor

Conversation

@misha-db

@misha-db misha-db commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Changes

Problem

LoggerManager.showOutputChannel() called LogOutputChannel.show(), which silently did nothing on hosts that register a log channel under a different id than the extension host derives for it. The extension host computes the channel id locally (.) and never round-trips it through the workbench, so the two can disagree — some hosts append a workspace scope segment (.workspaceId-). When they disagree, .show() targets an id that isn't registered and the channel never appears.

User-visible effect: Databricks: Show Bundle Logs (databricks.bundle.showLogs), the databricks.internal.showOutput command behind the AI-tools "Show Logs" affordance, and the "Show Error Logs" button in CliWrapper's error notification all appeared to do nothing.

Fix

New src/logger/outputChannelReveal.ts recovers the real reveal command by probing the registered command list for workbench.action.output.show.:

  • getLogChannelId() derives the id the way the extension host does, stripping the same illegal characters.
  • pickRevealCommand() returns a scoped command only when the host registered the channel under a different id — if the exact id is present, it returns undefined so plain .show() stays in charge. Candidates must differ by exactly one dot-segment, which keeps a longer channel name whose id merely prefixes ours out of the set. On ambiguity it prefers the .workspaceId- shape and otherwise gives up rather than reveal an unrelated channel.

This is a capability probe rather than a host/fork-name check, so it degrades to existing behavior on hosts where ids already agree.

LoggerManager changes:

  • showOutputChannel() is now async and resolves the reveal command before falling back to channel.show(). It never rejects — any failure is logged at debug level and falls through to .show().
  • Resolved command ids are cached per channel; a failed executeCommand evicts the cache entry so a stale id doesn't break reveals for the rest of the session.
  • When a channel was just created, one 200 ms retry covers createOutputChannel registering with the workbench asynchronously.
  • The ad-hoc "Databricks Logs" | "Databricks Bundle Logs" union is extracted to an exported LogChannelName type and now types the outputChannels map.

CliWrapper awaits the newly-async call.

Tests

outputChannelReveal.test.ts
LoggerManager.test.ts

@rugpanov

rugpanov commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ all 35 test jobs passed for 3bc805ff.
View run

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.

2 participants