mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-06 08:10:48 +00:00
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> |
||
|---|---|---|
| .. | ||
| common.sh | ||