lossless-group_perplexed-pl.../release-notes/0.2.1.md
mpstaton 3ae4012f1f feat(release): 0.2.1 — deep research that actually keeps the research
Directory-template runs with sonar-deep-research were silently discarding
~99% of every response. Perplexity's deep-research model delivers its whole
finished document in the first SSE event's message.content; the streaming
reader took delta.content (correct for the token-streaming sonar models) and
captured only a ~75-character tail fragment of a ~10,000-character report.
toolkit-profile shipped with sonar-deep-research as its default model, so
the default was the broken one. This release fixes the streaming, hardens it
against mid-stream disconnects, and adds the tooling the directory-template
research workflow was missing.

Both streaming paths now read Perplexity's cumulative message.content
snapshot and append only the new tail — correct for token-streaming sonar
models and for deep research's first-event document dump alike. A timed-out
or dropped stream now keeps the partial content and the citations it already
received instead of discarding the whole run. "Apply directory template"
gained a run dialog with a per-run model selector, so the model is no longer
locked to the template file, and the loading notice names the model that is
actually running instead of a hardcoded "deep research" string.

Streaming (perplexityService.ts, directoryTemplateService.ts):
- Read message.content (cumulative snapshot), diff against written text,
  append the tail; a startsWith guard skips a changed prefix rather than
  corrupting the note.
- streamPerplexityToFile returns a partial result with a `truncated` flag on
  a read error instead of throwing; applyTemplate writes the partial with
  its sources footer and a truncation notice. The modal catch block salvages
  its citation metadata the same way.
- Deep-research idle timeout 90s -> 270s; request-timeout default 5 -> 10 min.

Model selection (DirectoryTemplateRunModal.ts, main.ts):
- New run dialog: a template dropdown plus a Perplexity model dropdown that
  defaults to the template's cft model and overrides it for that run only.
- cf_last_run_model now stamps the model that actually ran.

Search scoping (directoryTemplateService.ts):
- search_domain_filter support via cf_search_domains (target frontmatter)
  and search-domains (cft block); allow/deny entries, capped at 10; job
  boards are denied automatically.

Template (src/docs/templates/toolkit-profile.md):
- System prompt rebuilt: anchors the entity on its real name rather than the
  scraped marketing tagline, makes source quality a triage task instead of
  an allow/deny list, adds a search-don't-recall rule and per-section length
  ceilings. Default model -> sonar-pro.

Files changed:
- src/services/perplexityService.ts
- src/services/directoryTemplateService.ts
- src/modals/DirectoryTemplateRunModal.ts
- main.ts
- src/docs/templates/toolkit-profile.md
- manifest.json
- package.json
- versions.json
- changelog/releases/0.2.1.md
- release-notes/0.2.1.md

Also included:
- manifest.json description aligned with package.json ("Perplexica (now Vane)").

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 15:28:53 -05:00

5.9 KiB

Directory-template runs with sonar-deep-research were quietly discarding ~99% of every response — the streaming reader was taking the wrong field. 0.2.1 fixes that, keeps citations even when a long research stream drops mid-flight, adds a per-run model picker to the run dialog, and rebuilds the toolkit-profile template so the model searches the product's real name and triages SEO slop instead of citing it.

Why care?

If you generate research notes with Perplexed's directory templates — the "Apply directory template to current file" workflow — 0.2.1 is the release where the deep-research path actually works.

sonar-deep-research runs now keep their output. Perplexity's deep-research model does all its work server-side, then delivers the entire finished document — often 10,000+ characters — in the first event of its streaming response, in a field the plugin wasn't reading. The reader took delta.content (correct for the lighter sonar models, which stream token-by-token); on a deep-research response that field holds only a ~75-character tail fragment of a 10,000-character report. The other 99% arrived on the wire and was thrown away. toolkit-profile shipped with sonar-deep-research as its default model — so it was the default that was broken. Fixed.

Citations survive a dropped connection. Deep research holds a stream open for minutes; a WiFi roam or idle socket mid-stream used to discard everything, including the citations deep research delivers up front. A cut-off run now keeps whatever content and sources arrived, writes the citations footer anyway, and tells you it was truncated.

You pick the model when you run. "Apply directory template" now opens a run dialog with a model dropdown — and the loading toast finally names the model actually running, instead of a hardcoded "deep research" string.

What's new

Deep-research streaming — read the snapshot, not the fragment

Both streaming paths now treat Perplexity's cumulative message.content snapshot as the source of truth and append only the new tail.

Model How it streams Old reader 0.2.1 reader
sonar, sonar-pro Token-by-token deltas Worked Works
sonar-deep-research Whole document in event 1, then tiny deltas ~75 of ~10,234 chars Full document

Citations that survive a timeout

A dropped or timed-out stream no longer discards the run. The runner returns its partial content and the sources it already received, writes the citations footer, and shows a "stream cut off — saved partial content with N sources, re-run to complete" notice. The deep-research idle timeout was lengthened (90s → 270s) since deep research legitimately holds the socket silent while it researches.

A model picker in the run dialog

"Apply directory template to current file" opens a dialog with a template dropdown and a model dropdownsonar-pro, sonar-reasoning-pro, sonar, sonar-reasoning, sonar-deep-research. The model defaults to the template's cft model: and overrides it for that run only. The cf_last_run_model frontmatter stamp records the model that actually ran.

Domain scoping — cf_search_domains

New search_domain_filter support: a cf_search_domains: list in a target file's frontmatter (entity-specific) or a search-domains: key in a template's cft block (generic). Plain entries allowlist, a leading - denylists, capped at 10. Job boards (Indeed, Glassdoor, ZipRecruiter, USAJobs) are denied automatically — a job listing is never a product source. Allowlisting is a last resort for collision-heavy names, not the everyday workflow.

The toolkit-profile template, rebuilt

The shipped toolkit-profile template's system prompt was overhauled: it anchors the entity on its real name ({{basename}}) instead of the scraped marketing tagline; it tells the model to triage source quality — editorial authority over SEO ranking, judge each page on its merits — rather than trusting or hard-banning by domain; it adds a hard "search, don't recall" instruction and per-section length ceilings. Default model is now sonar-pro, with sonar-deep-research one dialog click away.

Longer request timeout

The directory-template request timeout default moved 5 minutes → 10, so a sonar-deep-research run has room to finish.

Verify the release assets

Every release asset is signed via GitHub's artifact attestation system. Before manual install, verify provenance:

gh attestation verify main.js --repo lossless-group/perplexed-plugin
gh attestation verify manifest.json --repo lossless-group/perplexed-plugin
gh attestation verify styles.css --repo lossless-group/perplexed-plugin

Exit code 0 means the file came out of a legitimate build of the source repo.

The Lossless Group plugin family

Plugin What it does
Cite Wide Stable hex-identifier citations + URL-based dedupe + LLM-paste research conversion
Image Gin Recraft + Ideogram image generation, Magnific stock search, ImageKit CDN, drag-gate
Perplexed (this release) Source-cited research from Perplexity, Claude, Gemini, Perplexica, or LM Studio + per-directory templates
Metafetch Pull OpenGraph metadata into note frontmatter via OpenGraph.io or Microlink

If Perplexed saves you time, buy us a coffee. The plugins are free; the coffee keeps the next one coming.

Full release narrative

Marketing-grade narrative with the deeper context, the full eight-file changeset, and what's next: changelog/releases/0.2.1.md.