fix(pi): support model-advertised max and minimal thinking - #842
Conversation
|
@xintaofei Ready for review. This fixes #467: Pi now offers max/minimal only when the selected model advertises them, persists the chosen level, and avoids launching an incompatible Pi runtime. I verified real Pi RPC/ACP capability and saved-default behavior without sending a model prompt; 55 frontend and 96 Rust tests passed, along with type, lint, format, Next build, desktop Rust check, and a native Windows .cmd regression. The seven PR CI jobs are running now. Thanks! |
|
CI follow-up: Ubuntu Rust server Clippy flagged the new Pi RPC success guard spelling under Rust 1.98. Commit 619bc1f uses the equivalent Boolean negation. I reproduced the warning locally, reran the exact server Clippy command with warnings denied successfully, and reran the response-projection regression test with one passing result. The new PR checks are starting now. |
619bc1f to
fbd615d
Compare
…each launch - Recognise a pi too old for pi-acp 0.0.34 from its answer to get_available_thinking_levels on session/new and session/load, and report it as agent_runtime_outdated with upgrade instructions and an Open Agent Settings action, instead of running `pi --version` before every connect. - Resolve the launch preflight on the launch env's PATH, and a relative command inside the workspace, the way pi-acp spawns it. - Offer all seven thinking levels for built-in providers and never refuse a save over pi's catalog: defaultThinkingLevel is one global preference, so the panel names the level pi will actually run the selected model at. - Query the catalog with --offline, report why it is unavailable, keep the last answer while re-asking, and re-ask after install, uninstall, recheck and saves. Reload the credentials form only when the agent dir changes and show why it could not be read. - Resolve PI_CODING_AGENT_DIR as the pi child does (the parser's tilde rule, the child's HOME, no trimming, blank = removed), and anchor a relative dir in the workspace for the trust gate and trust decisions. - Keep the pi minimum version in one Rust constant, mirrored by a checked frontend constant.
- Take the child's HOME (USERPROFILE on Windows) verbatim, a relative one included, and fall back to the account's home from the OS when a launch removes it, so settings and the trust gate never read codeg's own profile in place of the one pi opens. - Match per-agent env names case-insensitively on Windows, where pi_coding_agent_dir is the variable pi reads. - Anchor relative PATH entries in the child's cwd when resolving pi, and run the catalog query in a private empty directory, so it can never pick up a pi planted in the shared temp dir. - Clear the credentials form when a newly selected agent dir cannot be read, so a save cannot write the previous profile's values into it. - Route the connection-failure sentinels through one tested function.
…tries - Treat the home variable the pi child inherits as its home even when empty, as Node does; only a launch that removes it falls back to the account home. - Drop Windows drive-relative PATH entries (C:tools) when resolving pi: they follow a per-drive directory of the child that codeg cannot name.
|
codeg work task |
Summary
maxandminimalthrough CodeG's Pi thinking selector and native config persistence.maxonly when the selected model advertises it, rejects a stale level after switching models, and refreshes after credential or runtime changes. Only model identity and thinking capabilities cross the settings API.Result
On the original code path,
maxwas absent from the Pi settings vocabulary, filtered by the Rust writer, and rejected by the pinned adapter. In an isolated Pi 0.87.1 + pi-acp 0.0.34 protocol check, a model advertisingmaxnow accepts and reports it. A model advertisingminimalbut notmaxaccepts and reportsminimal; a model without reasoning exposes onlyoff. A savedminimaldefault is reported again by a new ACP session. These checks used a dummy key and sent no model prompt.Verification
cargo check --features tauri-runtime --libpassed87cb3ab: no blocking findings.cmdand spaces-in-path regression tests added; native Windows regression passed locally (1/1) after adding a Common Controls v6 manifest to the temporary test binary; GitHub Windows desktop CI compiles these tests without running themCloses #467