Skip to content

Failed skills startup checks are not rate-limited #73

Description

@benagentai93-dot

Baseline

Reproduced from v1.3.1 at 5a306f8956cb1eeae69f9709de0e4d61b44e11e7.

Reproduction

  1. Use an isolated home with no fast-path google-agents-cli-* skills and point _SKILLS_CHECK_STAMP at a temporary path.
  2. Stub run_resolved to return one of these startup-check outcomes: an empty JSON list, a timeout, a nonzero exit, or malformed JSON.
  3. Freeze the clock and call check_skills_version() twice.

For each of those outcomes, the fallback is attempted twice and no timestamp is written. A normal successful result with an installed skill does write the stamp.

Actual behavior

_record_skills_check() runs only after _find_installed_skills() returns a non-empty result. Empty, timeout, nonzero, and malformed-JSON paths return first, so every CLI startup immediately retries the relatively slow npx fallback.

Expected behavior

Once a due startup check is attempted, record its timestamp regardless of whether the result is success, empty, timeout, nonzero, or malformed. Calls during the existing cooldown interval should not rerun npx.

Minimal fix

Move the existing _record_skills_check() call immediately after the due/CI guard and before _find_installed_skills(). Keep the timestamp write best-effort; no new retry system or dependency is needed.

Reference implementation: benagentai93-dot@905f1c6

Test evidence

A runnable parameterized regression covers success, empty, timeout, nonzero, and malformed JSON. For every outcome, two calls to check_skills_version() produce one fallback invocation and a timestamp file.

Fork verification:

  • focused Batch 3 suite: 15 passed
  • full root suite: 55 passed
  • ruff check src tests: passed
  • ty check src: passed
  • uv build: passed
  • installed-wheel agents-cli --version: 1.3.1 on Python 3.11 and 3.13

All focused regressions use mocks; no real npx, network, or server command was run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions