Skip to content

v0.2.0

Latest

Choose a tag to compare

@fantasticjoe fantasticjoe released this 08 Mar 20:26
· 1 commit to main since this release

✨ Overview

v0.2.0 is the second public release of cpa-warden, focused on extending the core maintenance workflow into a fuller operation loop: maintain, refill, and upload at scale for known CLIProxyAPI (CPA) management environments.

Building on v0.1.0, this release adds controlled account refill orchestration, concurrent auth-file upload with idempotent deduplication, and stronger guardrails around retries, classification, and configuration parsing.

🚀 Highlights

  • Added upload mode for concurrent local auth JSON uploads via POST /v0/management/auth-files
  • Added maintain-refill mode to enforce a minimum valid-account threshold after maintenance
  • Added SQLite-backed upload deduplication (auth_file_uploads) to prevent duplicate concurrent uploads
  • Added external register hook support when refill still cannot meet threshold
  • Added quota auto-disable threshold support (quota_disable_threshold / --quota-disable-threshold)
  • Added re-enable scope control (reenable_scope / --reenable-scope)
  • Raised default probing/action concurrency and retry settings for higher-throughput operations
  • Improved probe retry behavior (429 + 5xx backoff retries, fast-fail on other 4xx)

🔎 Core Behavior In This Release

Upload mode

upload reads local .json auth files, validates each file, and uploads concurrently to /v0/management/auth-files.

It keeps upload state in SQLite and guarantees each {base_url, file_name, content_sha256} tuple is uploaded only once across concurrent runs.

Maintain-refill mode

maintain-refill runs maintain first, then checks strict valid-account criteria (disabled=0, non-401, non-quota-limited, no probe error).

If valid accounts are below min_valid_accounts, it refills from upload_dir with either:

  • to-threshold: fill only the current gap
  • fixed: upload a fixed count equal to threshold when triggered

If still below threshold and auto_register=true, it invokes register_command with appended CLI args and environment variables for external registration integration.

Maintenance and classification updates

This release tightens behavior around quota and recovery decisions:

  • threshold-based quota disable now supports remaining-ratio checks
  • Pro-plan quota signal selection falls back to primary rate_limit when Spark signal is incomplete
  • recovered-account logic now relies on live usage signals plus current disabled state
  • re-enable scope can target all signal-recovered accounts (signal) or only tool-managed ones (managed)

⚙️ Configuration And Filtering

This release expands external configuration for:

  • upload operations: upload_dir, upload_workers, upload_retries, upload_method, upload_recursive, upload_force
  • refill orchestration: min_valid_accounts, refill_strategy, auto_register, register_command, register_timeout, register_workdir
  • quota/re-enable control: quota_disable_threshold, reenable_scope

Additional behavior improvements in v0.2.0:

  • strict boolean parsing (true/false/1/0/yes/no/on/off) to avoid accidental truthy-string misconfiguration
  • non-zero exit guarantees when upload or maintain-refill fails to meet expected operational outcomes

🛡️ Operational Safety Notes

This project remains focused on known CPA management environments and operator-controlled local workflows, not generic account-management automation.

Important safety behavior in this release:

  • destructive actions remain configuration-driven and confirmation-gated by default
  • --yes still bypasses deletion confirmation and should be used carefully
  • upload force-overwrite behavior is explicit (--upload-force)
  • external registration is still hook-only; account creation logic remains out of this repository

📦 Repository Improvements Included

Alongside runtime behavior, v0.2.0 includes synchronized documentation and release metadata updates across:

  • README.md and README.zh-CN.md
  • CONTRIBUTING.md
  • CHANGELOG.md
  • config.example.json
  • package metadata and lockfile updates for versioned release integrity

✅ Validation

The repository was validated for this release with:

  • uv sync --locked
  • uv run python -m py_compile cpa_warden.py clean_codex_accounts.py
  • uv run python cpa_warden.py --help

📝 Notes

This release is focused on making cpa-warden more production-usable for sustained operations: not only scanning and maintenance, but also controlled refill and upload workflows with clearer safety boundaries and stronger runtime guarantees.