Skip to content

fix(usage): register emitted feature values#4580

Merged
chrarnoldus merged 1 commit into
mainfrom
fix/register-emitted-usage-features
Jul 16, 2026
Merged

fix(usage): register emitted feature values#4580
chrarnoldus merged 1 commit into
mainfrom
fix/register-emitted-usage-features

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

Register feature values that production callers already emit so the gateway preserves them in microdollar_usage_metadata.feature_id instead of normalizing them to NULL.

cloud-agent-web is already registered on current main by #4574. This PR adds the remaining observed values and deliberately leaves unknown invalid.

Feature sources

  • jetbrains-plugin: set by the JetBrains launcher through KILOCODE_FEATURE in Kilo-Org/kilocode (packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/cli/KiloBackendCliManager.kt).
  • daemon: set by the Kilo daemon child environment in Kilo-Org/kilocode (packages/opencode/src/kilocode/daemon/daemon.ts).
  • code-review-memory: sent directly by review-memory LLM requests in apps/web/src/lib/code-reviews/review-memory/llm.ts.
  • security-remediation: passed as the Cloud Agent createdOnPlatform value by services/security-auto-analysis/src/remediation.ts, then forwarded as KILOCODE_FEATURE.
  • github and linear: derived from the Kilo Bot chat adapter name in apps/web/src/lib/bot/agent-runner.ts and passed to spawned Cloud Agent sessions as createdOnPlatform.
  • scheduled: used by scheduled Webhook Agent runs in services/webhook-agent-ingest/src/queue-consumer.ts and forwarded by Cloud Agent as KILOCODE_FEATURE.

The Kilo-Org/kilocode sources were checked at commit 982503868326ba72a66419cb5c7d716fe13ea0c7.

Verification

  • oxfmt on the changed files
  • oxlint on the changed files: 0 warnings, 0 errors
  • git diff --check
  • Focused Jest was attempted, but the web test global setup could not connect to the configured PostgreSQL test database. The suite failed before assertions ran.

Notes

  • unknown remains rejected and has an explicit regression assertion.
  • This change registers emitted values verbatim; it does not merge separate producer identities into broader feature buckets.

@chrarnoldus chrarnoldus self-assigned this Jul 16, 2026
@kilo-code-bot

kilo-code-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed additions to FEATURE_VALUES/featureSchema and their test coverage; the new literals are unique, the unknown rejection path is preserved with an explicit regression test, and no security, correctness, or performance issues were found.

Files Reviewed (2 files)
  • apps/web/src/lib/feature-detection.ts
  • apps/web/src/lib/feature-detection.test.ts

Reviewed by claude-sonnet-5 · Input: 14 · Output: 2.3K · Cached: 233.6K

Review guidance: REVIEW.md from base branch main

@chrarnoldus chrarnoldus enabled auto-merge (squash) July 16, 2026 10:07
@chrarnoldus chrarnoldus merged commit 39d11ec into main Jul 16, 2026
15 checks passed
@chrarnoldus chrarnoldus deleted the fix/register-emitted-usage-features branch July 16, 2026 10:11
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