pi-openai-web-search

May 12, 2026 · View on GitHub

ci license: MIT

OpenAI native web search extension for the pi coding agent.

This package is the standalone extraction of senpi's former builtin openai-web-search extension.

Behavior

The extension does not register a new local tool. It intercepts OpenAI Responses-family requests and ensures native web search is available by injecting { type: "web_search" } when absent.

CaseResult
API is openai-responses or azure-openai-responses and no native web search tool existsinjects { type: "web_search" }
Existing native web_search or web_search_preview tool existspreserves it (no duplication)
Function variant named web_search is presentstrips function variant and keeps native variant
Non-Responses API payloadleaves payload unchanged

It also appends a system-prompt section for Responses sessions indicating native web_search availability.

Installation

The package targets the pi coding agent. Pi loads extensions from ~/.pi/agent/extensions/, project .pi/extensions/, or via the --extension / -e CLI flag.

# From npm (once published)
pi install npm:pi-openai-web-search

# From git
pi install git:github.com/code-yeongyu/pi-openai-web-search

# Manual placement
git clone https://github.com/code-yeongyu/pi-openai-web-search ~/.pi/agent/extensions/pi-openai-web-search
cd ~/.pi/agent/extensions/pi-openai-web-search && npm install

# Dev / one-shot test
pi -e /path/to/pi-openai-web-search/src/index.ts

After installation, restart pi or run /reload inside an interactive session.

Development

npm install
npm test
npm run typecheck
npm run check
pi -e ./src/index.ts

The test suite uses vitest. TypeScript is strict, Node-only, and uses ESM imports with .js suffixes.

Origin

Ported from packages/coding-agent/src/core/extensions/builtin/openai-web-search/index.ts in code-yeongyu/senpi-mono.

License

MIT.

  • senpi — the fork/runtime these extensions are extracted from.
  • Ultraworkers Discord — community link from the senpi README.
  • Dori — the product powered by senpi under the hood.