Skip to content

feat(piri): add web skill — SearXNG search + readable fetch helpers - #964

Merged
jinon86 merged 1 commit into
mainfrom
feat/piri-web-skill
Aug 5, 2026
Merged

feat(piri): add web skill — SearXNG search + readable fetch helpers#964
jinon86 merged 1 commit into
mainfrom
feat/piri-web-skill

Conversation

@jinon86

@jinon86 jinon86 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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/web package 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_URL accepts a comma-separated list tried in order.
    • An instance answering 200 with zero results and a non-empty unresponsive_engines list is treated as engine-blocked → falls through to the next base URL; a sole degraded instance exits 69 rather than inventing zero hits.
    • Fleet reality baked in: 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 (SEARXNG_URL=http://127.0.0.1:8888,http://100.80.237.12:8889 in 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.
  • Both mark all output as untrusted web data.

Live verification (pre-commit)

  • Engine-blocked node (soonwook) fallback path returns real results via bangtong.
  • End-to-end: a fresh Piri session discovered the skill, ran web_search.py via bash, and answered from its first result.
  • Bangtong needed an instance: deployed searxng/searxng on 127.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.sh
  • setup.sh — installs the skill only when ~/.piri/agent exists (non-Piri nodes untouched)
  • scripts/setup.test.sh — install assertion (70/70)
  • scripts/validate-harness.sh — registers the new test

Test plan

  • piri/skills/web/web_tools.test.sh 9/9 (search/fallback/degraded-69/fetch/cap/scheme rejection, loopback stub only)
  • setup.test.sh 70/70
  • Full validate-harness.sh PASS
  • Live E2E on soonwook

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.
@jinon86
jinon86 requested a review from seoseo-ai as a code owner August 5, 2026 13:50

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after explicit operator authorization using the local seoseo-ai credential.

@jinon86
jinon86 merged commit d5e5e8c into main Aug 5, 2026
8 checks passed
@jinon86
jinon86 deleted the feat/piri-web-skill branch August 5, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants