Skip to content

feat: provider extensibility and proactive starting-account selection - #2

Merged
bodencrouch merged 3 commits into
mainfrom
feat/proactive-starting-account
Jul 25, 2026
Merged

bodencrouch merged 3 commits into
mainfrom
feat/proactive-starting-account

Conversation

@bodencrouch

Copy link
Copy Markdown
Owner

Summary

  • Provider extensibility — user config appends to catalog retry/passthrough lists by default, with *_replace siblings to override outright. Adds src/clifwrap/validation.py behind config validate and doctor, an examplecli reference provider, and docs/provider-authoring.md.
  • Proactive starting-account selection — when quota data is available, clifwrap starts on the account with the most headroom instead of a possibly depleted default. On by default for providers with status_command or usage; opt out with proactive_pick = false. Reactive failover is unchanged.
  • Pre-release hardening — three issues found in audit and fixed in this branch (details below).

Audit fixes included

Issue Fix
doctor resolved credentials and made authenticated calls on every run Live probes are now opt-in via --probe (--all-accounts implies it)
Probe findings echoed subprocess stderr and interpolated argv, so a token printed by a failing status_command landed in doctor --json Findings report exit status only; all probe errors pass through a sanitizer
*_replace keys silently resolved to an empty list for providers with no catalog entry Config-only providers now merge against an empty base so replace keys take effect

Test plan

  • pytest — 120 passed
  • ruff check src/clifwrap tests scripts — clean
  • python scripts/verify_release.py --skip-tests --skip-pyinstaller — passed
  • python scripts/check_anonymity.py — passed
  • New regression tests: secret redaction in doctor --probe --json, probes off without --probe, proactive_pick = false at runtime, *_replace on a non-catalog provider

…tion

Provider extensibility: user config now appends to catalog retry and
passthrough lists by default, with *_replace siblings to override them
outright. Adds a validation module behind `config validate` and `doctor`,
an `examplecli` reference provider, and an authoring guide.

Proactive starting-account selection: when quota data is available,
clifwrap picks the account with the most headroom before the first
upstream call instead of always starting on a possibly depleted default.
Enabled by default for providers with `status_command` or `usage`;
opt out per provider with `proactive_pick = false`.

Also hardens the new surfaces following a pre-release audit:

- doctor probes are opt-in via `--probe` so casual and CI runs no longer
  resolve credentials or make authenticated calls as a side effect
- probe findings report exit status only, never subprocess output or
  interpolated argv, keeping tokens out of `doctor --json`
- *_replace keys now apply to providers with no catalog entry, where
  they previously resolved to an empty list
Comment thread tests/test_wrapper.py Fixed
Copilot added 2 commits July 25, 2026 04:33
Add catalog providers for `agent` and legacy `cursor-agent` matching
Cursor's install layout and CLI syntax (interactive TUI, `agent -p`
print mode, CURSOR_API_KEY auth, login/status passthrough).

Introduce interactive_mode=tty-exec so full-screen TUIs keep a live
terminal instead of being buffered; headless `-p`/`--print` runs still
get retry failover across API-key accounts.
Rename the alternate provider to agentcli, scrub vendor tokens from
docs/tests/catalog comments, and block the token in the anonymity guard
so templates stay vendor-neutral.
@bodencrouch
bodencrouch merged commit ba95714 into main Jul 25, 2026
6 of 7 checks passed
@bodencrouch
bodencrouch deleted the feat/proactive-starting-account branch July 25, 2026 10:00
bodencrouch added a commit that referenced this pull request Aug 14, 2026
…-components--clifwrap

chore(main): release 0.2.0
bodencrouch added a commit that referenced this pull request Aug 14, 2026
…#2)

* feat: add provider extensibility and proactive starting-account selection

Provider extensibility: user config now appends to catalog retry and
passthrough lists by default, with *_replace siblings to override them
outright. Adds a validation module behind `config validate` and `doctor`,
an `examplecli` reference provider, and an authoring guide.

Proactive starting-account selection: when quota data is available,
clifwrap picks the account with the most headroom before the first
upstream call instead of always starting on a possibly depleted default.
Enabled by default for providers with `status_command` or `usage`;
opt out per provider with `proactive_pick = false`.

Also hardens the new surfaces following a pre-release audit:

- doctor probes are opt-in via `--probe` so casual and CI runs no longer
  resolve credentials or make authenticated calls as a side effect
- probe findings report exit status only, never subprocess output or
  interpolated argv, keeping tokens out of `doctor --json`
- *_replace keys now apply to providers with no catalog entry, where
  they previously resolved to an empty list

* feat: wrap Cursor Agent CLI with tty-exec and print-mode failover

Add catalog providers for `agent` and legacy `cursor-agent` matching
Cursor's install layout and CLI syntax (interactive TUI, `agent -p`
print mode, CURSOR_API_KEY auth, login/status passthrough).

Introduce interactive_mode=tty-exec so full-screen TUIs keep a live
terminal instead of being buffered; headless `-p`/`--print` runs still
get retry failover across API-key accounts.

* chore: anonymize agent CLI catalog and docs

Rename the alternate provider to agentcli, scrub vendor tokens from
docs/tests/catalog comments, and block the token in the anonymity guard
so templates stay vendor-neutral.

---------

Co-authored-by: Copilot <th3w1zard1@users.noreply.github.com>
bodencrouch added a commit that referenced this pull request Aug 14, 2026
…#2)

* feat: add provider extensibility and proactive starting-account selection

Provider extensibility: user config now appends to catalog retry and
passthrough lists by default, with *_replace siblings to override them
outright. Adds a validation module behind `config validate` and `doctor`,
an `examplecli` reference provider, and an authoring guide.

Proactive starting-account selection: when quota data is available,
clifwrap picks the account with the most headroom before the first
upstream call instead of always starting on a possibly depleted default.
Enabled by default for providers with `status_command` or `usage`;
opt out per provider with `proactive_pick = false`.

Also hardens the new surfaces following a pre-release audit:

- doctor probes are opt-in via `--probe` so casual and CI runs no longer
  resolve credentials or make authenticated calls as a side effect
- probe findings report exit status only, never subprocess output or
  interpolated argv, keeping tokens out of `doctor --json`
- *_replace keys now apply to providers with no catalog entry, where
  they previously resolved to an empty list

* feat: wrap Cursor Agent CLI with tty-exec and print-mode failover

Add catalog providers for `agent` and legacy `cursor-agent` matching
Cursor's install layout and CLI syntax (interactive TUI, `agent -p`
print mode, CURSOR_API_KEY auth, login/status passthrough).

Introduce interactive_mode=tty-exec so full-screen TUIs keep a live
terminal instead of being buffered; headless `-p`/`--print` runs still
get retry failover across API-key accounts.

* chore: anonymize agent CLI catalog and docs

Rename the alternate provider to agentcli, scrub vendor tokens from
docs/tests/catalog comments, and block the token in the anonymity guard
so templates stay vendor-neutral.

---------

Co-authored-by: Copilot <th3w1zard1@users.noreply.github.com>
bodencrouch pushed a commit that referenced this pull request Sep 28, 2026
…-components--clifwrap

chore(main): release 0.2.0
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