The LaunchDarkly SDK returns an unknown feature key: <name> error whenever a flag is not configured in the current environment. The SDK already substitutes the caller-supplied default value, so this is expected behavior in staging or for newly added flags pending rollout — not a real failure. Logging it at Error pollutes error dashboards and on-call alerts.
This PR adds a small logFlagError helper that:
unknown feature key misses to Warn (default value already returned).All 32 *Variation() call sites in apps/thermos/utils/launchdarkly.go are routed through the helper — single-file, mechanical change, no behavior change beyond log level.
Concrete impact from the Datadog scan that found this: ~200 staging Error logs in the last 6 hours from missing timerShardCooldownSeconds and timerShardControllerPollIntervalSeconds flags. These will now be Warn-level and clearly tagged with the flag name.
go build ./... from apps/thermos — clean.go vet ./utils/ — clean.go test ./utils/ -v -run "LogFlagError|LaunchDarkly|AuthRefresh|MCPToolkitSync" — 7/7 pass.launchdarkly_test.go:
TestLogFlagError_FlagNotFoundLogsAtWarn — verifies that an unknown feature key error logs at Warn and preserves flag + extra fields.TestLogFlagError_OtherErrorLogsAtError — verifies genuine errors still log at Error.pnpm lint) skipped: pre-existing environmental issue (golangci-lint built for Go 1.23, repo uses Go 1.26.2). Not introduced by this PR.Origin: cron-dd-errors / zen-cron-f2874118c220 Triggered by: Cron: Datadog Error Polling cron-dd-errors | Source: cron Session: https://zen-api-production-4c98.up.railway.app/dashboard/#/chat/zen-cron-f2874118c220
Based on git blame analysis of 2 file(s):
| Contributor | Contribution | Files |
|---|---|---|
| lingalarahul7 | 35% | 1 |
| sarthak |
| 34% |
| 1 |
| Zen | 19% | 2 |
| anshugarg15 | 6% | 1 |
| abir-taheer | 2% | 1 |
I recommend Zen and sarthak. Zen edited the test file today and can quickly validate test expectations and coverage, while sarthak made recent changes to launchdarkly.go about a week ago and can review the core logic and integration details.
🤖 Based on git blame with recency weighting (recent edits count more).
:x: Patch coverage is 15.78947% with 32 lines in your changes missing coverage. Please review.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| apps/thermos/utils/launchdarkly.go | 15.78% | 32 Missing :warning: |
| Flag | Coverage Δ | |
|---|---|---|
| e2e-tests | ? | |
| self-hosted-tests | 5.59% <ø> (ø) | |
| thermos-service-isolation-tests | 65.62% <ø> (?) | |
| thermos-unit-tests | 6.78% <15.78%> (+0.01%) | :arrow_up: |
| unit-tests | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| apps/thermos/utils/launchdarkly.go | 3.90% <15.78%> (+1.26%) | :arrow_up: |
... and 834 files with indirect coverage changes