spawn/shared
A 53aa27b598
refactor: extract _log_diagnostic helper and flatten get_openrouter_api_key_oauth (#502)
Reduce complexity in the two most verbose functions in shared/common.sh:

- verify_agent_installed(): Extract repeated "Possible causes" / "How to fix"
  error blocks into a reusable _log_diagnostic() helper, reducing 22 lines of
  duplicated log_error calls to 2 structured calls.

- get_openrouter_api_key_oauth(): Flatten nested if/else by testing the
  rejection case first (early return), eliminating the else branch and reducing
  nesting depth.

Agent: complexity-hunter

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-11 11:53:47 -08:00
..
common.sh refactor: extract _log_diagnostic helper and flatten get_openrouter_api_key_oauth (#502) 2026-02-11 11:53:47 -08:00