Engine adapter trait and conformance test suite for coding CLIs
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Read docs/guide/cli-engines.md, then crates/cli-provider/src/registry.rs and levels.rs; run cargo test -p cli-provider to see the current coverage. Start by drafting the adapter trait and choosing an engine to migrate, then get the design reviewed before coding. Done means at least two engines pass the shared conformance suite, including a deliberately broken adapter test, and the Linux and Windows test and clippy commands pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
size: L · first-timer: no
Please comment before starting so we can agree on the design. This reshapes a security-sensitive part of the runtime, so the trait boundary must be reviewed first.
Summary
Turn the coding-CLI integrations (Claude Code, Codex, Cursor, OpenCode, Antigravity, Gemini CLI) from a static table plus per-engine special cases into an engine adapter trait with a shared conformance test suite, so adding or changing an engine means one module that must pass the same tests.
Why it matters
Praxi can hand a bot's brain to a locally installed coding CLI. Every new engine today touches several places, and behaviour that must stay identical across engines (version floors, how approval levels map onto the CLI's permission mode, untrusted installer output, no credential leakage) is only tested engine by engine. Contributors who want to add a CLI (see #185, #186, #187 for sign-in work) need a clear contract and a way to prove they met it.
Current state
crates/cli-provider/src/registry.rshasCliEngineSpecand the staticCLI_ENGINEStable: command names, version and auth probe arguments, install descriptors, minimum versions, last-resort model lists.crates/cli-provider/src/levels.rsmaps the bot's approval level onto each CLI's own permission mode (level_plan) and selects a native-tools driver viaDriver::from_id.runtime.rs(about 1,600 lines) runs sessions;detect.rs(about 2,500 lines) probes installed engines;login.rs,install.rs,models.rs,opencode.rs,peer.rshold engine-specific parts.docs/guide/cli-engines.mdrecords, per engine, what is detected, how auth status is read, whether Praxi's own tools can stay in charge ("brain") and the verified install command.- Tests exist but are engine-specific; there is no shared contract and no fake CLI executable that a new adapter can be run against.
Proposal and suggested approach
- Design. Draft an
EngineAdaptertrait covering: detection and version, auth status, install descriptor, model listing, session spawn and streaming events, and the approval-level mapping. Decide which parts are data (stay in the table) and which are behaviour. - Migrate the existing engines behind the trait with no behaviour change, one engine per PR, keeping
detect.rs/runtime.rsshrinking rather than growing. - Conformance suite. A reusable set of tests that runs against any adapter using a scripted fake CLI executable (a small test binary or script that prints canned output): detection with and without the binary, a version below the floor is refused, auth unknown vs signed in, session start/stream/cancel and orphan-process cleanup, approval mapping never grants more than the bot's level, installer output is treated as untrusted text, and credentials/ambient API keys are not passed through.
- An opt-in mode (
BOT_CLI_CONFORMANCE_REAL=1) that runs the read-only parts of the same suite against the real installed CLI. - A short "adding an engine" guide in
docs/contributing/.
Acceptance criteria
- Trait and suite merged with at least two existing engines migrated and passing the suite; remaining engines have a tracking checklist in the PR.
- No change to what users see in Settings > Providers or to
docs/guide/cli-engines.mdclaims, except additions. - The suite fails when an adapter weakens an invariant (include a deliberately broken fake adapter test).
cargo test -p cli-providerandcargo clippy -p cli-provider --all-targets -- -D warningspass on Linux and Windows.
Out of scope
Adding a brand-new engine, changing install commands, the host-side sign-in work, changing the approval model.
How to get started
Read docs/guide/cli-engines.md, then registry.rs and levels.rs; run cargo test -p cli-provider. Comment here with a draft of the trait and which engine you would migrate first.
- Lingua principale
- Rust
- Stelle
- 0
- Fork
- 1
- Merge medio
- 6h 54m
- PR unite (30g)
- 152
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di emreocell/Praxi-Bot
-
area: desktop-ui enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Add an LLM provider presetApertaarea: daemon enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Contribute example skillsApertadocumentation enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
emreocell/Praxi-Bot#168 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di emreocell/Praxi-Bot
Issue simili
-
bug ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
userFRM/egui-charts#3363 ·
I maintainer di solito rispondono entro 1 giorno
-
ada documentation mobile report
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
physicsdolphin/nv-uefi-unlocker#254 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kindraywind/rustnarok-client#1382 ·
I maintainer di solito rispondono entro 1 giorno
-
area:accessibility bug good first issue help wanted priority:p3-low size:small
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NecturaLabs/Canopy#209 ·
-
CLI config custom-model enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno