Bump crates, audit deps, and migrate Perplexity to Agent API #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thesimonharms/baochuan!1
Loading…
Reference in a new issue
No description provided.
Delete branch "cursor/update-deps-and-audit-a262"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Bring baochuan’s crates current, run a RustSec audit, and check every upstream provider API against current docs (September 2026).
Crate version is 0.2.0 → 0.3.0 because
reqwest0.13 is a public dependency (BaochuanError::Http) and Perplexity’s default request path changed.Package updates
reqwestqueryis now an explicit feature)tokioserdeserde_jsonfutures-utilthiserrortracingasync-traitbytesmockitotracing-subscriberAlso set
rust-version = "1.85"(required by edition 2024). Cloudflare model listing needs the newreqwestqueryfeature.reqwest0.13 breaking changes that affect this crate:RequestBuilder::queryis feature-gated — enabled for Cloudflarejson/stream/bytes_streamAPIs are unchangedSecurity audit
cargo auditagainst the resolved lockfile (213 crates, 1239 advisories loaded from rustsec/advisory-db): no vulnerabilities.Code review of the HTTP surface:
Authorization: Bearer/x-api-key/x-goog-api-keyunsafeUpstream API review
Checked each provider’s current docs against what baochuan sends.
Required change (this PR)
Perplexity — Sonar Chat Completions (
POST /chat/completionsandPOST /v1/sonar) is retired on 27 September 2026. Replacement is the Agent API:POST https://api.perplexity.ai/v1/agentinput(notmessages),max_output_tokens(notmax_tokens)tools: [{ "type": "web_search" }]is requiredoutput[]items withtype: "search_results", not a top-levelcitationsarrayresponse.output_text.delta)The Perplexity provider now talks to
/v1/agent. Legacy slugs still work:sonarfastsonar-prolowsonar-reasoning/sonar-reasoning-promediumsonar-deep-researchhighQualified IDs such as
perplexity/sonarand preset names (fast,low, …) are passed through.Still compatible (no wire-format change)
/v1/chat/completionsis still supported. Responses is recommended for new work; Hermes already uses/v1/responses.max_tokens→max_completion_tokensremapping stays correct.POST /v1/messages,anthropic-version: 2023-06-01,x-api-key— still current.generateContent+x-goog-api-keystill current. User action: Google rejects unrestricted standard keys; migrate to AI Studio auth keys before September 2026.https://api.deepseek.com/v1+deepseek-v4-flash/deepseek-v4-prostill current.https://api.moonshot.ai/v1+kimi-k3still current./ai/run/and/ai/models/searchstill current./api/chatNDJSON still current./v1/responses.Docs-only updates
MiniMax-M2→MiniMax-M3(endpoint unchanged)glm-4.6→glm-5.3(endpoint unchanged)POST /responsesinstead of Chat CompletionsTests
cargo test— 7 lib + 5 agent + 108 integration + 56 doctests, all passingcargo clippy --all-targets -- -D warnings— cleancargo fmt --all— appliedcargo audit— no advisoriesBreaking notes for 0.3.0
BaochuanError::Http(reqwest::Error)must use reqwest 0.13PerplexityProvider::with_base_urlnow expects the/v1root; chat is sent to{base}/agent