From c8a8684e638b1ce9bba396007b21c62a8198ed87 Mon Sep 17 00:00:00 2001 From: chrarnoldus <12196001+chrarnoldus@users.noreply.github.com> Date: Thu, 16 Jul 2026 10:00:37 +0000 Subject: [PATCH] fix(usage): register emitted feature values --- apps/web/src/lib/feature-detection.test.ts | 13 +++++++++++++ apps/web/src/lib/feature-detection.ts | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/apps/web/src/lib/feature-detection.test.ts b/apps/web/src/lib/feature-detection.test.ts index dd5456cc4c..2445afc893 100644 --- a/apps/web/src/lib/feature-detection.test.ts +++ b/apps/web/src/lib/feature-detection.test.ts @@ -12,12 +12,25 @@ describe('validateFeatureHeader', () => { test('returns null for invalid feature', () => { expect(validateFeatureHeader('unknown-feature')).toBeNull(); + expect(validateFeatureHeader('unknown')).toBeNull(); }); test('returns normalized feature for valid input', () => { expect(validateFeatureHeader('cloud-agent')).toBe('cloud-agent'); expect(validateFeatureHeader(' Cloud-Agent ')).toBe('cloud-agent'); }); + + test.each([ + 'jetbrains-plugin', + 'daemon', + 'code-review-memory', + 'security-remediation', + 'github', + 'linear', + 'scheduled', + ])('accepts emitted feature %s', feature => { + expect(validateFeatureHeader(feature)).toBe(feature); + }); }); describe('isUserRateLimitedFeature', () => { diff --git a/apps/web/src/lib/feature-detection.ts b/apps/web/src/lib/feature-detection.ts index e0b813bcab..ab655c24c6 100644 --- a/apps/web/src/lib/feature-detection.ts +++ b/apps/web/src/lib/feature-detection.ts @@ -13,22 +13,29 @@ import { z } from 'zod'; export const FEATURE_VALUES = [ 'vscode-extension', 'jetbrains-extension', + 'jetbrains-plugin', 'autocomplete', 'parallel-agent', 'managed-indexing', 'cli', + 'daemon', 'cloud-agent', 'cloud-agent-web', 'code-review', + 'code-review-memory', 'auto-triage', 'autofix', 'app-builder', 'agent-manager', 'security-agent', + 'security-remediation', 'slack', 'discord', + 'github', + 'linear', 'bot', 'webhook', + 'scheduled', 'kiloclaw', 'openclaw', 'direct-gateway',