Skip to content

desktop: LiveNotes stops retrying the plan-gated managed notes endpoint - #14377

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/desktop-livenotes-respects-plan-gate
Sep 17, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/desktop-livenotes-respects-plan-gate

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

On a basic (free) account, LiveNotesMonitor started a managed note generation for every transcript segment. The backend answers 402 plan_gated, the generator throws the typed GeminiClientError.planGated, and the monitor's catch-all logged it as an error and forgot it. Observed on a free-tier QA bundle against dev on 2026-09-17: a 30-minute recording produced one doomed managed request and one [error] LiveNotesMonitor: Failed to generate note: AI features require an active plan or BYOK keys. line per segment. That is expected plan behaviour, not a failure, and it should not generate request or error traffic.

The monitor now:

  • reads the existing cached entitlement decision (SubscriptionEntitlementService.cachedDecisionForManagedProactivity(), which already folds BYOK into allow) before each generation and skips when it is .planGated;
  • latches a typed plan_gated failure from the server, so later segments and sessions skip generation, and logs it once at info level (LiveNotesMonitor: AI notes unavailable on this plan; skipping generation);
  • clears the latch when the entitlement decision changes to allow, and in any case after 10 minutes — when the cached plan was unknown (fail-open allow) an upgrade leaves the decision at allow, so one probe per lifetime is what notices it without an app restart. While skipping it nudges the entitlement snapshot, which is TTL-cached (5 minutes), so that is at most one subscription read per TTL;
  • leaves every other failure path exactly as it was (network errors still log as errors and retry on the next segment), and manual notes are untouched.

Failure-Class: FC-typed-failure-collapsed-to-generic

Evidence

xcrun swift test --package-path Desktop --filter LiveNotes on Xcode 27.0: 22 tests, 0 failures (12 monitor tests, 8 accumulator tests, 2 others). New tests: gated decision → generator never called; typed planGated failure → exactly one generator call across many segments and no error-level log; decision flips to allow → generation resumes; a network error does not latch.

Layer measured: unit tests under Xcode 27.0. The CI-pinned Xcode 26.6 run on this PR is the verdict for that toolchain. Not yet observed: the free-tier QA bundle re-recorded on this build.

🤖 Generated with Claude Code

Review in cubic

…n every sentence

A basic account's note generation is answered 402 plan_gated, and the monitor
logged the typed failure as an error and tried again on the next segment, so a
recording produced one doomed managed request and one error line per sentence.
Consult the cached entitlement decision first, latch a typed plan_gated failure
with a bounded lifetime, log it once at info level, and resume when the plan
changes. Other failures and manual notes are unchanged.

Failure-Class: FC-typed-failure-collapsed-to-generic

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 160890c into main Sep 17, 2026
42 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/desktop-livenotes-respects-plan-gate branch September 17, 2026 20:53
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.

1 participant