Move model-backed tools from Sonar models to Agent API presets (v1.0.0) - #122
Merged
rbuchmayer-pplx merged 1 commit intoJul 27, 2026
Merged
Conversation
rbuchmayer-pplx
force-pushed
the
agent-api-migration
branch
6 times, most recently
from
July 23, 2026 04:32
4535399 to
2bda500
Compare
rbuchmayer-pplx
marked this pull request as ready for review
July 23, 2026 19:31
akshay-pplx
approved these changes
Jul 23, 2026
rbuchmayer-pplx
force-pushed
the
agent-api-migration
branch
from
July 27, 2026 16:12
2bda500 to
0dd4bf3
Compare
…resets The three model-backed tools now call the Agent API (POST /v1/agent) with managed presets: - perplexity_ask: sonar-pro -> fast preset - perplexity_reason: sonar-reasoning-pro -> medium preset - perplexity_research: sonar-deep-research -> high preset perplexity_search is unchanged. Tool names and output shape are unchanged, including the appended "Citations:" block: citation lines are keyed by the Agent API's sequential source ids so inline references line up, and the answer body is never modified (bracketed tokens also appear in code and LaTeX). All agent calls stream; PERPLEXITY_TIMEOUT_MS bounds the whole call, not just time-to-headers. Reasoning events are surfaced as MCP progress notifications when the client requests progress, and MCP cancellation aborts the run server-side via the cancel endpoint. Removed params: strip_thinking (the Agent API emits no think tags) and reasoning_effort (presets manage effort). Old clients that still send them are ignored gracefully rather than rejected. search_recency_filter, search_domain_filter, and search_context_size now map onto the web_search tool override. Measured on the same query set (avg): ask 15.3s/$0.030 -> 9.4s/$0.011, reason 22.2s/$0.016 -> 14.4s/$0.030, research 228.7s/$0.79 -> 115.6s/$0.62. Responses are more concise, most visibly for research.
rbuchmayer-pplx
force-pushed
the
agent-api-migration
branch
from
July 27, 2026 16:20
0dd4bf3 to
4bcc433
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the three model-backed tools to the Agent API (
POST /v1/agent, the responses API) with managed presets. Tool names and output shape are unchanged.perplexity_ask: sonar-pro ->fastpresetperplexity_reason: sonar-reasoning-pro ->mediumpresetperplexity_research: sonar-deep-research ->highpresetperplexity_search: unchangedPERPLEXITY_TIMEOUT_MSnow bounds the whole call instead of just time-to-headersstrip_thinking/reasoning_effortfrom the tool schemas; old clients still sending them are ignored gracefully (tested per tool). Recency/domain/context-size params onperplexity_askandperplexity_reasonmap onto theweb_searchtool (perplexity_researchtakesmessagesonly, same as before)Measured on the same query set (avg):
82 unit tests plus e2e against prod: all 4 tools over stdio and streamable HTTP with the official MCP client, and a live claude code session. Independent of #121 (the HTTP-mode fix); both are needed for a working HTTP release. npm publish is a separate step; release notes should call out the response-length change and the removed params.
Fixes #110 (research runs now emit notifications/progress while streaming, so clients with request timeouts can keep the call alive).