feat(telemetry): central command dispatcher (#902)#934
Open
EhabY wants to merge 2 commits intotelemetry/local-jsonl-sinkfrom
Open
feat(telemetry): central command dispatcher (#902)#934EhabY wants to merge 2 commits intotelemetry/local-jsonl-sinkfrom
EhabY wants to merge 2 commits intotelemetry/local-jsonl-sinkfrom
Conversation
Introduce CommandManager so every coder.* registration funnels through
one place and inherits command.invoked instrumentation (durationMs +
result) via TelemetryService.trace, no per-command wrapping. CoderCommandId
is a string-literal union derived from a static array; a unit test pins
it to package.json's contributes.commands so drift breaks CI.
Wire CommandManager into ServiceContainer so its dispose runs before
TelemetryService dispose, letting in-flight events flush. Migrate all
25 vscode.commands.registerCommand("coder.*", ...) sites in extension.ts
to commandManager.register(...). Returns are not pushed onto
ctx.subscriptions because the manager owns its registrations and is
itself disposed via the service container chain.
Add a no-restricted-syntax ESLint rule blocking direct registerCommand
of coder.* ids, with commandManager.ts carved out, mirroring the
existing setContext guard.
Declare coder.openDevContainer in package.json contributes.commands
(commandPalette when:false to preserve current behavior). It was
registered in code but never declared, which the new manifest-parity
test would have flagged.
4b4c555 to
0e6d1a1
Compare
DanielleMaywood
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #902. Adds
CommandManagerso everycoder.*command emitscommand.invoked(durationMs + success/error) viaTelemetryService.trace.src/core/commandManager.ts—register(id, handler): Disposable.CoderCommandIdis a string-literal union; a unit test pins it topackage.jsonso drift breaks CI.src/extension.ts— migrates all 25coder.*registrations. The manager owns disposal viaServiceContainer, disposed beforeTelemetryServiceso in-flight events still flush.eslint.config.mjs— blocks directregisterCommandofcoder.*ids (carve-out forcommandManager.ts).package.json— declarescoder.openDevContainer(was registered but never declared).Builds on #921; merge target is
telemetry/local-jsonl-sink, notmain.