Perplexity's model fields are inconsistent per model: Claude Sonnet 5 reports the real slug in user_selected_model with display_model "turbo", while GLM-5.2 reports the inverse. Pick whichever field is present and not "turbo", and fall back to the requested model when both are missing or "turbo".
Also add glm_5_2 to KNOWN_MODELS.
Refs #7 (follow-up comment)
Perplexity's /rest/models/config now exposes claude50sonnet and
claude50sonnetthinking. Add both to KNOWN_MODELS with the official
labels from the config.
The stream's display_model can report "turbo" even when the requested
model was honored, so prefer user_selected_model when present and not
"turbo" so tool metadata reflects the model actually used.
Closes#7
Co-authored-by: Ivan Pereira <183991+ivanrvpereira@users.noreply.github.com>
Hardcode is_incognito: true in the Perplexity request and remove the
toggle surface: the incognito tool parameter, PI_PERPLEXITY_INCOGNITO
env var, config file field, /perplexity-config prompt, and TUI status
indicators. Config and resolveDefaultModel are now model-only.
Supersedes the incognito portion of PR #4.
Co-authored-by: Ivan Pereira <183991+ivanrvpereira@users.noreply.github.com>
parseBrowserAuthInput returns an access-only credential for a bare
__Secure-next-auth.session-token value, which /perplexity-login
--browser accepts but credentialsFromEnvironment rejected because it
required .cookies. Only reject when parsing fails entirely.
@mariozechner/pi-coding-agent is deprecated in favor of
@earendil-works/pi-coding-agent (github.com/earendil-works/pi).
Import Type from @earendil-works/pi-ai instead of @sinclair/typebox,
which the new ecosystem replaces with plain typebox. Upgrading to
0.80.6 also resolves all 31 open Dependabot alerts from the old
package's transitive dev dependencies.
Disable checkout credential persistence so repository-controlled code
run by npm ci/test cannot read GITHUB_TOKEN from .git/config, and pin
actions to full commit SHAs to guard against mutable-tag supply-chain
attacks.
resolveSearchDefaults no longer accepts a per-call model override and
SearchParams no longer carries limit; neither was reachable from the
tool schema (limit is applied client-side in formatForLLM). Also fold
asPositiveNumber into asPositiveInteger and simplify recency matching.
The perplexity_search tool no longer prompts for pasted browser
credentials mid-search; /perplexity-login --browser is the single
entry point for that flow. Drop the now-unused promptForBrowserAuth
option and its Cloudflare-challenge fallback from authenticate().
Run Perplexity search and auth requests through pi's Node runtime instead of
shelling out to Bun. Move development and CI commands to npm, add a Node test
build path, and keep OTP auth fail-fast when Set-Cookie headers are not
available.
mock.module() in index-execute.test.ts permanently poisons Bun's
module cache — mock.restore() does not undo it in Bun 1.3.11.
Use cache-busted dynamic imports (../src/mod.ts?t=${Date.now()}) in
beforeEach for the three affected test files so each test gets a
fresh, unpoisoned module instance.
- Re-add isError flag to error details so renderPerplexityResult
shows error styling instead of green success rows
- Use errorMessage() for unknown errors instead of unsafe cast
- Trim whitespace-only PI_PERPLEXITY_MODEL env var values
- Add comment explaining clearToken() on AUTH rejection