I'm getting some failure with subagents because I don't have a websearch tool…
- User
I'm getting some failure with subagents because I don't have a
web_searchtool configured. I want to setup my perplexity extension as the web_search tool Assistant
Let me check the exact
web_searchtool contract from pi-web-access so the perplexity-backed version matches what subagents expect.Assistant
Let me see the
searchPerplexitysignature and the rest of the index.ts execute flow.Assistant
I have enough context. Let me look at the exact insertion boundary in
index.ts:Assistant
Let me verify how subagent child processes load extensions/tools, to confirm the perplexity extension's
web_searchwill actually be visible to children.Assistant
I have a clear picture now. Two findings drive the design:
- The
context-builderagent listsweb_searchonly → registeringweb_searchfully fixes it. - The
researcheragent listsweb_search, fetch_content, get_search_content→ pi-subagents validates every listed tool name against the registry and fails the run if any is missing (README line 851). So to makeresearcherrunnable via the Perplexity extension, I'll add all three as Perplexity-backed shims.
Let me check the root README for the Extensions section, then implement.
- The
Assistant
Now I'll implement. First, add helpers after
formatSources:Assistant
Now add the three web tools right after
perplexity_search, before the/researchcommand:- User
Do we still need perplexity_search tool? if not let's remove it
Assistant
Good call —
web_searchnow covers the single-query case (and more). Let me check what referencesperplexity_searchand what becomes unused before removing it.Assistant
perplexity_searchis only referenced in source + docs (the.entire/tmphits are session logs, not config). Safe to remove. Let me view the exact block and header comment.Assistant
Let me get a clean exact copy of the full
perplexity_searchblock to remove it precisely:Assistant
Now I'll remove
perplexity_searchand its now-unused bits in one pass:Assistant
Let me verify the file is consistent — no leftover references and valid structure:
Assistant
Only a stale comment reference remains. Let me fix it and run a real typecheck with the project's toolchain:
Assistant
A few real type errors to fix (the
.ts-import and missing-module errors are environmental from running tsc standalone — the original file has them too). The ones I introduced:PerplexityMessagenot imported, a strayntypo, andnever[]inference on the early-return. Let me view and fix.Assistant
Found the stray
ntypo. Let me also check the exact early-return blocks to fix thenever[]inference:Assistant
Now fix all real errors in one pass — import
PerplexityMessage, add aWebSearchEntrytype to fix thenever[]inference, and kill the strayn:Assistant
Let me check exact whitespace to get the indentation right:
Assistant
Tab count was 5, not 6. The whole edit was atomic so nothing applied. Let me redo all fixes with correct indentation:
Assistant
Now re-run the typecheck, filtering out the environmental errors (
.tsimports, unresolved modules) that the original file also has:Assistant
Good progress — the
never[]is fixed. Remaining issue: the early-returndetailshas a different shape than the success return, so TS infers the wrong union. Make bothdetailsobjects the same shape:Assistant
Clean. Let me do a final sanity check on the file structure and confirm no stale references remain:
Assistant
Code is clean — 3 web tools registered, no stale references,
/researchintact. Now sync the docs per AGENTS.md. Let me view the full perplexity README:Assistant
Now sync the perplexity README — replace the
perplexity_searchsection with the web tools:Assistant
Now update the root
README.mdExtensions section for Perplexity:Assistant
Let me also fix the now-stale comment in
perplexity.tsreferencing the removed tool:Assistant
Final typecheck pass to confirm everything is clean:
Assistant
Clean. Here's a summary of what changed.
What I did
Root cause: pi-subagents validates every tool name in an agent's frontmatter against the live registry and fails the run if any is missing. The and builtins list (from , which you don't have installed). So your Perplexity extension now provides those names instead.
- User
Yes
Assistant
Let me spawn a
researchersubagent with a short, time-boxed task that forces it to useweb_search.Assistant
✅ Smoke test passed. The
researchersubagent ran to completion, called the Perplexity-backedweb_search, and returned a cited brief (Node.js 24 LTS v24.18.0; pi 0.82.1 requires Node ≥ 22.19.0) with sources from nodejs.org and the pi docs. No "unavailable tool" failure — theweb_search/fetch_content/get_search_contentshims are now satisfying the agent'stools:frontmatter.Output was saved to
.pi-subagents/artifacts/outputs/aadf5e3b/research.md.A couple of notes from the run:
- The researcher dropped one cnblogs mirror source on its own — the synthesis-based results gave it real URLs to cite and evaluate, which is the behavior you want.
- If you ever see it try
fetch_contenton a GitHub repo or PDF and complain it can't fully extract it, that's the documented gap vs. realpi-web-access— install that package alongside if you need true URL fetching.
You're good to go. Run
/reloadin your main session if you haven't already so the parent picks up the newweb_searchtool too.- User
Ok commit our changes
Assistant
There's an unexpected
.gitignorechange I didn't make. Let me inspect before committing:Assistant
The working tree has unrelated, pre-existing exe.dev workspace work (
.gitignorepy-cache lines, a README "exe.dev workspace" section, and untrackedmise.toml/scripts//tests/) from a prior session. I'll commit only our Perplexity changes and leave that other work untouched. Let me stage the perplexity files and selectively stage just my README hunk:Assistant
Staging is clean — only my Perplexity README hunk is staged; the exe.dev section remains unstaged. Let me verify the staged README hunk and the perplexity file staged content, then commit:
Assistant
Exactly right — staged README is only the Perplexity hunk; the exe.dev section stays unstaged. Committing:
Assistant
Heredoc tripped on shell quoting. Let me use multiple
-mflags instead:Assistant
Committed as
b251cb1.Commit:
perplexity: provide web_search/fetch_content/get_search_content for subagents(4 files, +366/−70)extensions/perplexity/index.ts,extensions/perplexity/perplexity.ts,extensions/perplexity/README.md(full), and only the Perplexity hunk ofREADME.mdare in the commit.
Left untouched (your pre-existing exe.dev workspace work, not part of this change):
.gitignore(py-cache /.pi-subagents/additions)README.md(the "exe.dev workspace" section)- untracked
mise.toml,scripts/,tests/
You can stage/commit those separately when ready. Want me to push
main?