Skip to content

Add endpoint probe, rename cost_probe, add PR/probe interval throttling#105

Merged
BillJr99 merged 3 commits into
mainfrom
claude/free-script-provider-probing-tw1x2u
Jun 19, 2026
Merged

Add endpoint probe, rename cost_probe, add PR/probe interval throttling#105
BillJr99 merged 3 commits into
mainfrom
claude/free-script-provider-probing-tw1x2u

Conversation

@BillJr99

Copy link
Copy Markdown
Owner
  • Rename scripts/sources/probe.py → cost_probe.py; class ProbeSource →
    CostProbeSource; config key free_tier.probe → free_tier.cost_probe;
    state file probe_state.json → cost_probe_state.json (with auto-migration).
    Back-compat aliases preserved in config.py and admin.py so existing
    configs and admin API keep working.

  • Add scripts/sources/endpoint_probe.py (EndpointProbeSource): calls each
    configured provider's GET /v1/models, emits positive Evidence for new
    :free-suffixed models not yet in believed_free and negative Evidence for
    :free models that disappeared. Gated by sync_on_startup or
    update_on_startup (no separate enabled flag needed). Throttled by
    free_tier.endpoint_probe.frequency_minutes (default 30).

  • Add providers_pr.frequency_days throttle: _maybe_open_providers_pr()
    checks pr_state.json before opening a PR; saves last_pr_at on success.
    Accumulated sidecar changes are bundled into one PR per interval.

  • Add _maybe_fire_interval_probes() in server.py: debounced (60 s gate)
    check called on startup and every request. Fires endpoint probe
    (sync_on_startup / update_on_startup), cost probe (update_on_startup +
    cost_probe.enabled), and PR creation (frequency_days elapsed) as
    single-flight daemon threads when their intervals have elapsed.

  • New config keys: free_tier.endpoint_probe.{frequency_minutes,timeout_sec},
    free_tier.cost_probe (renamed), providers_pr.frequency_days.
    State files: cost_probe_state.json, endpoint_probe_state.json, pr_state.json.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01RkRhX4Znv73oPcZy41bnyS

claude added 3 commits June 19, 2026 11:00
- Rename scripts/sources/probe.py → cost_probe.py; class ProbeSource →
  CostProbeSource; config key free_tier.probe → free_tier.cost_probe;
  state file probe_state.json → cost_probe_state.json (with auto-migration).
  Back-compat aliases preserved in config.py and admin.py so existing
  configs and admin API keep working.

- Add scripts/sources/endpoint_probe.py (EndpointProbeSource): calls each
  configured provider's GET /v1/models, emits positive Evidence for new
  :free-suffixed models not yet in believed_free and negative Evidence for
  :free models that disappeared. Gated by sync_on_startup or
  update_on_startup (no separate enabled flag needed). Throttled by
  free_tier.endpoint_probe.frequency_minutes (default 30).

- Add providers_pr.frequency_days throttle: _maybe_open_providers_pr()
  checks pr_state.json before opening a PR; saves last_pr_at on success.
  Accumulated sidecar changes are bundled into one PR per interval.

- Add _maybe_fire_interval_probes() in server.py: debounced (60 s gate)
  check called on startup and every request. Fires endpoint probe
  (sync_on_startup / update_on_startup), cost probe (update_on_startup +
  cost_probe.enabled), and PR creation (frequency_days elapsed) as
  single-flight daemon threads when their intervals have elapsed.

- New config keys: free_tier.endpoint_probe.{frequency_minutes,timeout_sec},
  free_tier.cost_probe (renamed), providers_pr.frequency_days.
  State files: cost_probe_state.json, endpoint_probe_state.json, pr_state.json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RkRhX4Znv73oPcZy41bnyS
- Rename ProbeSource→CostProbeSource throughout test_probe_source.py
  (module path, monkeypatch targets, class usage, source name assertion)
- Sort cost_probe/endpoint_probe imports to correct alphabetical position
  in scripts/sources/__init__.py (ruff I001)
- Rename unused loop variable prov_name→_prov_name in endpoint_probe.py
  (ruff B007)
- Fix server.py: split `import os, sys` into separate lines (ruff E401),
  separate import groups with blank lines per isort (ruff I001), and
  remove unused `save_pr_state as _save_pr_state` alias (ruff F401)
- Regenerate config.example.json with cost_probe/endpoint_probe sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RkRhX4Znv73oPcZy41bnyS
…n order

- test_admin_api: check free_tier.cost_probe (not free_tier.probe) after PUT
- test_probe_throttle: import/use cost_probe_* state helpers; --source cost_probe
- test_fusion: use sorted() comparison for backfill panel order (parallel threads
  make request order non-deterministic, only set membership matters)
- docs/base.py: retry GET up to 3 times on 429 with exponential-ish backoff,
  honouring Retry-After; return [] on exhaustion instead of raising
- test_docs_huggingface: add tests for 429 retry-then-succeed and exhausted-429
  returns-empty, monkeypatching time.sleep to keep tests fast

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RkRhX4Znv73oPcZy41bnyS
@BillJr99 BillJr99 merged commit 761bd84 into main Jun 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants