Serve Perplexity POST /search under a new search activity (#660) #664
main fromrefs/pull/664/head·merged by tombeckenham View on GitHubCloses #660.
What#
Perplexity's published OpenAPI document already has POST /search. The adapter dropped it because no activity fitted an endpoint that takes no model. This adds a search activity and classifies /search into it, so the next spec sync stores the endpoint and GET /v1/openapi/perplexity gets paths["/search"].post with the upstream request and response schemas.
Activitygainssearch(src/db/schema.ts, the OpenAPI enum, MCP/WebMCP/llms.txt wording). No migration: the column has no CHECK constraint.MODEL_ROW_SHAPEmoves to version 9, with a@modelschemas/clientminor changeset.openapi.json, the generated client andSKILL.mdare regenerated.
Not in the upstream schema#
The issue lists max_tokens_per_page. Upstream's ApiSearchRequest does not have it as of 2026-11-16, so the served schema will not either. It has query, max_results, country, search_type, search_language_filter, plus the SearchDomainFilter and DateFilters fields. Nothing is hand-added.
Testing#
pnpm run test: 2481 passed. New test bundles an upstream-shaped/search(allOf over$refs) and checks the request and response are inlined.pnpm run typecheck,lint,checkpass.- Not run: a live sync.
pnpm run rederive -- perplexityfails on Node 24.22 before reaching the adapter (ERR_UNSUPPORTED_TYPESCRIPT_SYNTAXinpackages/rate-card/src/evaluate.ts), unrelated to this change.
After merge#
Deploy, then POST /v1/admin/sync/perplexity (or wait for the daily spec sync) for the endpoint to appear.
Summary by CodeRabbit#
New Features
- Added
searchas a model activity, including support for identifying Perplexity’s/searchendpoint, which does not require a model. - Search is now available as an activity filter across model listings and API schemas. The
decisionactivity is also reflected in supported activity listings.
- Added
Documentation
- Updated model activity documentation to include search and decision activities.
- 1
tombeckenham linked this to fix #660
No actionable comments were generated in the recent review.
Walkthrough
-
The activity vocabulary and API descriptions now include
search. The Perplexity adapter classifies/searchas a search endpoint, and tests verify that its request and response schemas are bundled.Changes: Search activity support
Layer / File(s) Summary Activity contract and API exposure
src/db/schema.ts,src/server/openapi.ts,openapi.json,src/lib/webmcp.ts,src/server/mcp.ts,src/server/llms-txt.ts,skill/modelschemas/SKILL.mdThe activity type, API enums, filters, tool descriptions, and activity guides include search. The skill guide also addsdecisionto its activity list.Perplexity Search endpoint classification
src/server/providers/adapters/perplexity.ts,src/server/providers/adapters/perplexity.test.ts,src/server/row-shape.ts,.changeset/perplexity-search-activity.mdThe adapter classifies /searchassearch. Tests verify classification and bundling of the endpoint’s request and response schemas. The row-shape version and release changeset are updated.Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Merge Risk:
Minimal · up toc6b0d-
This adds the search activity so Perplexity's /search endpoint appears in the served OpenAPI after the next sync. No concrete merge-blocking risk was found.
Pre-merge checks:
3 · 1-
Failed checks: 1 inconclusiveCheck name Status Explanation Resolution Linked Issues check [ #660] Requirement: GET /v1/openapi/perplexity must expose paths["/search"].post with typed request and response schemas. The diff adds the search activity, classifies /search as search in perplexity.…Provide evidence that a sync (or rederive) produces paths["/search"].post with inlined request and response schemas. Confirm against the upstream Perplexity OpenAPI document that ApiSearchRequest lacks max_tokens_per_page. If upstream has i… Passed checks: 3 passed-
Check name Status Explanation Description Check Check skipped - CodeRabbit’s high-level summary is enabled. Title check The title names the main change: Perplexity's POST /search is now served under a new search activity. The changeset adds a 'search' activity to the enums, types, and classifier, and the Perplexity ada… Out of Scope Changes check All listed changes relate to adding the search activity for /search. Files changed: the Activity type (src/db/schema.ts), the OpenAPI activity enum (src/server/openapi.ts), MCP, WebMCP, and llms.txt w… Full details: Title check
-
Explanation
The title names the main change: Perplexity's POST /search is now served under a new search activity. The changeset adds a 'search' activity to the enums, types, and classifier, and the Perplexity adapter maps /search to it. The title is specific and matches the primary change. The '(
#660)' reference is an issue number and does not affect the verdict.
Full details: Out of Scope Changes check
-
Explanation
All listed changes relate to adding the search activity for /search. Files changed: the Activity type (src/db/schema.ts), the OpenAPI activity enum (src/server/openapi.ts), MCP, WebMCP, and llms.txt wording, the Perplexity classifier and its docs, the MODEL_ROW_SHAPE version bump to 9 with its hash and note, the
@modelschemas/clientchangeset, and regenerated openapi.json and SKILL.md. The tests cover the classifier change and the /search bundling. The version bump and changeset follow from the new activity and the changed row shape. The generated client file is excluded from review (ignored_files), so its contents are not assessed.
-
Full details: Linked Issues check
-
Explanation
[
#660] Requirement: GET /v1/openapi/perplexity must expose paths["/search"].post with typed request and response schemas. The diff adds the search activity, classifies /search as search in perplexity.ts, and adds a unit test. That test bundles an upstream-shaped /search and checks that request and response schemas are inlined. This supports the code path. The committed openapi.json changes only add the search value to activity enums. It contains no /search path. The served path appears only after a live spec sync. The author did not run a sync, so the served output is unverified. The issue also asks for max_tokens_per_page in the request body. The PR does not add it. It states that upstream ApiSearchRequest lacks this field as of 2026-11-16. This claim is not verified in the available evidence. The issue's Ask lists the field explicitly, so this is a deviation from the Ask. The acceptance criterion itself is the typed POST /search operation.Resolution
Provide evidence that a sync (or rederive) produces paths["/search"].post with inlined request and response schemas. Confirm against the upstream Perplexity OpenAPI document that ApiSearchRequest lacks max_tokens_per_page. If upstream has it, the served schema must include it. Maintainers should then decide whether the issue's max_tokens_per_page requirement is accepted as a deviation.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4e5177de-23d4-471b-b2d2-7b840fdd99b7
Commits-
Reviewing files that changed from the base of the PR and between 876992937d62891e9738527934373ad840c758cf and c6b0d1708152fd2c7bce1ed3c19b9729f71e646c.
Files ignored due to path filters: 1-
packages/client/src/generated/types.gen.tsis excluded by!**/generated/**
Files selected for processing: 11-
.changeset/perplexity-search-activity.mdopenapi.jsonskill/modelschemas/SKILL.mdsrc/db/schema.tssrc/lib/webmcp.tssrc/server/llms-txt.tssrc/server/mcp.tssrc/server/openapi.tssrc/server/providers/adapters/perplexity.test.tssrc/server/providers/adapters/perplexity.tssrc/server/row-shape.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-
-
tombeckenham merged this0b49e0a
tombeckenham closed this
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: c6b0d1708152fd2c7bce1ed3c19b9729f71e646c
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR