fix: use current Assistant thread API#135
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20465104cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2046510 to
e536e9f
Compare
e536e9f to
d037c87
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d037c87337
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if status.is_success() { | ||
| return serde_json::from_str(&body).map_err(|error| { |
There was a problem hiding this comment.
Check Assistant error envelopes before defaulted deserialization
When an Assistant endpoint returns a JSON error envelope with a 2xx status, this branch tries to deserialize into T before checking assistant_json_error. That silently masks errors for defaulted response types such as CurrentAssistantConversationListResponse, where {"error":...} can deserialize as an empty list and make thread list report no chats instead of the upstream error; check for an Assistant error envelope before deserializing successful bodies.
Useful? React with 👍 / 👎.
| references_markdown: current_assistant_references_markdown(&assistant.references), | ||
| metadata_html: None, | ||
| documents: assistant.attachments, |
There was a problem hiding this comment.
Preserve user attachments in completed turns
For normal completed exchanges with uploaded files or auto-created pasted-content attachments, the attachments live on the user prompt message, but this paired-turn conversion only copies assistant.attachments. The user-side attachments are preserved only for unpaired user messages, so thread get and JSON exports drop documents for the common user+assistant case; merge the user attachments into documents here as well.
Useful? React with 👍 / 👎.
Summary
assistant.kagi.com/apiconversation endpointsassistant.kagi.com/chat/<uuid>URLs anywhere a thread ID is acceptedVerification
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test -qcargo test -q --lockedfacts check --tags assistant-thread-migrationthread get,thread list,thread export,thread delete, then confirmed follow-upthread getreturned Kagi's current 404 JSON errorDocs
Auth / Secrets
Greptile Summary
This PR moves Assistant thread commands to Kagi's current conversation API. The main changes are:
Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Comments Outside Diff (1)
src/api.rs, line 731 (link)The list response now reports
total_countsas only{"all": count}. The old thread list preserved Kagi's per-folder totals across pages, so JSON consumers that display or sync folder counts now receive incomplete metadata even though folders are still returned.Prompt To Fix With AI
Reviews (3): Last reviewed commit: "fix: use current Assistant thread API" | Re-trigger Greptile