Awesome Reviewers

When behavior depends on provider/env configuration (URLs, feature links, capability gating), derive the effective configuration once using shared helpers, then pass the resolved values through—don’t recompute them during refresh/account cycles. Also, make configuration precedence explicit and test it (CLI flags vs env vs defaults), especially for negatable/boolean flags that may default to true.

Practical rules:

Example (pattern):

// Startup: resolve once
const apiBaseUrl = resolveBackendBaseUrlOnceFromEnvAndProvider();
const appBaseUrl = resolveClineAppBaseUrl(apiBaseUrl); // may be undefined

// Later (refresh/UI actions): reuse resolved value, don’t recompute
export function getPrivacySettingsUrl() {
  return appBaseUrl ? buildPrivacySettingsUrl(appBaseUrl) : undefined;
}

// CLI precedence guardrail
const noMouseProvidedByCli = cli.getOptionValueSource('mouse') === 'cli';
const mouse = noMouseProvidedByCli ? cli.opts().mouse : undefined;
const useMouse = mouse !== undefined ? mouse : envFallback();

Expected outcome: fewer environment mismatches (staging vs prod links), no drift between runtime/UI behavior, and reliable env fallback when users override via CLI.