Commit Graph

5 Commits

  • test(watcher): add comprehensive unit tests for watcher edge cases
    Add extensive test coverage for watcher module including:
    - Auth file handling for empty and missing files
    - Persist async error paths and nil receiver handling
    - Dispatch loop context cancellation scenarios
    - Event processing for errors and channel closures
    - Handle event cases: unrelated files, config changes, auth writes,
      remove debouncing, atomic replace detection
    - Normalize auth path and debounce cleanup logic
    - Runtime auth dispatch and refresh state
    - Config reload with mirrored auth dir and OAuth provider filtering
    - Start failure when auth dir is missing
    - Auth equality comparison ignoring temporal fields
    - Reload clients filtering without full rescan
  • refactor(diff): improve security and stability of config change detection
    Introduce formatProxyURL helper to sanitize proxy addresses before
    logging, stripping credentials and path components while preserving
    host information. Rework model hash computation to sort and deduplicate
    name/alias pairs with case normalization, ensuring consistent output
    regardless of input ordering. Add signature-based identification for
    anonymous OpenAI-compatible provider entries to maintain stable keys
    across configuration reloads. Replace direct stdout prints with
    structured logger calls for file change notifications.
  • refactor(watcher): extract config diff helpers
    Break out config diffing, hashing, and OpenAI compatibility utilities into a dedicated diff package, update watcher to consume them, and add comprehensive tests for diff logic and watcher behavior.