feat(piri): add web skill — SearXNG search + readable fetch helpers - #964
Merged
Conversation
Piri has no built-in web tools and no MCP by design, so web access gets the pi-native CLI+skill shape: a ~/.piri/agent/skills/web package with two stdlib-only helpers and a SKILL.md the agent loads on demand. - web_search.py: queries SearXNG (SEARXNG_URL, comma-separated). An instance answering 200 with zero results plus a non-empty unresponsive_engines list is treated as engine-blocked/degraded and the next base URL is tried; a sole degraded instance exits 69 instead of inventing zero hits. Fleet reality: the OVH-node IPs are broadly engine-blocked (DDG CAPTCHA, qwant/wikidata 403), so those nodes fall back to bangtong's healthy instance over Tailscale. - web_fetch.py: http(s)-only fetch with stdlib readability-lite (script/style/nav stripping, heading prefixes, entity decoding), bounded output; rejects non-http(s) URLs. - Both mark all output as untrusted web data. Live-verified before this commit: fallback query path on an engine-blocked node and an end-to-end Piri session that discovered the skill and answered from its first search result. setup.sh installs the skill only when the node has a Piri agent dir; web_tools.test.sh covers search/fallback/degraded/fetch/cap/scheme rejection hermetically (9/9); setup.test.sh 70/70; full harness PASS.
seoseo-ai
approved these changes
Aug 5, 2026
seoseo-ai
left a comment
Collaborator
There was a problem hiding this comment.
Approved after explicit operator authorization using the local seoseo-ai credential.
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.
Summary
Piri has no built-in web tools and no MCP by design, so the Claude lane's curated web-MCP routing can't be reused. This gives Piri web access in the pi-native shape: a
~/.piri/agent/skills/webpackage with two stdlib-only helpers + a SKILL.md the agent loads on demand.Contents
web_search.py— SearXNG query with bounded plain-text results (title/URL/snippet/engine).SEARXNG_URLaccepts a comma-separated list tried in order.unresponsive_engineslist is treated as engine-blocked → falls through to the next base URL; a sole degraded instance exits 69 rather than inventing zero hits.SEARXNG_URL=http://127.0.0.1:8888,http://100.80.237.12:8889in their bridge drop-ins).web_fetch.py— http(s)-only fetch, stdlib readability-lite (script/style/nav stripping, heading prefixes, entity decoding), bounded output, non-http(s) rejected.Live verification (pre-commit)
web_search.pyvia bash, and answered from its first result.searxng/searxngon127.0.0.1:8889(+ Tailscale bind) with JSON format enabled, matching the vps6 config.Changes
piri/skills/web/— SKILL.md, web_search.py, web_fetch.py, web_tools.test.shsetup.sh— installs the skill only when~/.piri/agentexists (non-Piri nodes untouched)scripts/setup.test.sh— install assertion (70/70)scripts/validate-harness.sh— registers the new testTest plan
piri/skills/web/web_tools.test.sh9/9 (search/fallback/degraded-69/fetch/cap/scheme rejection, loopback stub only)setup.test.sh70/70validate-harness.shPASS