Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Fixed and Improvements
body: Do not send tabby/chat LSP Feature to clients that cannot support it
time: 2026-04-28T09:24:08.662286918-04:00
3 changes: 2 additions & 1 deletion clients/tabby-agent/src/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ServerCapabilities } from "../protocol";
import type { Feature } from "../feature";
import type { TabbyApiClient } from "../http/tabbyApiClient";
import { ChatFeatures } from "../protocol";
import { getClientType } from "../utils/clientType";

export class ChatFeature extends EventEmitter implements Feature {
private isApiAvailable = false;
Expand Down Expand Up @@ -41,7 +42,7 @@ export class ChatFeature extends EventEmitter implements Feature {
}

private async syncFeatureRegistration(connection: Connection) {
if (this.isApiAvailable) {
if (this.isApiAvailable && getClientType(this.tabbyApiClient.getClientInfo()) === "vscode") {
if (!this.featureRegistration) {
try {
this.featureRegistration = await connection.client.register(ChatFeatures.type);
Expand Down
6 changes: 6 additions & 0 deletions clients/tabby-agent/src/http/tabbyApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class TabbyApiClient extends EventEmitter {
private readonly logger = getLogger("TabbyApiClient");

private userAgentString: string | undefined = undefined;
private clientInfo: ClientInfo | undefined = undefined;
private api: ReturnType<typeof createClient<TabbyApi>> | undefined;
private endpoint: string | undefined = undefined;

Expand All @@ -60,6 +61,7 @@ export class TabbyApiClient extends EventEmitter {

async initialize(clientInfo: ClientInfo | undefined) {
this.userAgentString = this.buildUserAgentString(clientInfo);
this.clientInfo = clientInfo;
this.connect(); // no await

this.configurations.on("updated", (config: ConfigData, oldConfig: ConfigData) => {
Expand Down Expand Up @@ -155,6 +157,10 @@ export class TabbyApiClient extends EventEmitter {
return this.serverHealth;
}

getClientInfo(): ClientInfo | undefined {
return this.clientInfo;
}

async connect(options: { skipReset?: boolean } = {}): Promise<void> {
if (!options.skipReset) {
this.connectionErrorMessage = undefined;
Expand Down
17 changes: 2 additions & 15 deletions clients/tabby-agent/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { isBrowser } from "./env";
import { ProxyConfig, createProxyForUrl } from "./http/proxy";
import { getLogger } from "./logger";
import { isBlank } from "./utils/string";
import { getClientType } from "./utils/clientType";

export class AnonymousUsageLogger {
private readonly logger = getLogger("Telemetry");
Expand Down Expand Up @@ -121,7 +122,7 @@ export class AnonymousUsageLogger {
}

private updateUserProperties(clientInfo: ClientInfo | undefined, clientProvidedConfig: ClientProvidedConfig) {
const clientType = this.getClientType(clientInfo);
const clientType = getClientType(clientInfo);
const properties = {
[clientType]: {
triggerMode: clientProvidedConfig?.inlineCompletion?.triggerMode,
Expand Down Expand Up @@ -150,18 +151,4 @@ export class AnonymousUsageLogger {
this.clientInfoProperties = properties;
}
}

private getClientType(clientInfo: ClientInfo | undefined): string {
if (!clientInfo) {
return "unknown";
}
if (clientInfo.tabbyPlugin?.name.includes("vscode")) {
return "vscode";
} else if (clientInfo.tabbyPlugin?.name.includes("intellij")) {
return "intellij";
} else if (clientInfo.tabbyPlugin?.name.includes("vim")) {
return "vim";
}
return clientInfo.name;
}
}
17 changes: 17 additions & 0 deletions clients/tabby-agent/src/utils/clientType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { ClientInfo } from "../protocol";

export type ClientType = "vscode" | "intellij" | "vim" | "unknown";

export function getClientType(clientInfo: ClientInfo | undefined): ClientType {
const pluginName = clientInfo?.tabbyPlugin?.name ?? "";
if (pluginName.includes("vscode")) {
return "vscode";
}
if (pluginName.includes("intellij")) {
return "intellij";
}
if (pluginName.includes("vim")) {
return "vim";
}
return "unknown";
}
Loading