omp packages

@sakiko233/pi-native-search0.4.0

Minimal Pi extension for provider-native web search on OpenAI Codex, Kimi For Coding, DeepSeek, and GLM Coding (China).

GitHub Actions Published 21 days ago MIT ~411 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@sakiko233/pi-native-search

npm version license

A minimal Pi extension that enables provider-native web search for OpenAI Codex, Kimi For Coding, DeepSeek, and GLM Coding (Z.ai).

Supported providers

Provider Search mode Auth source
OpenAI Codex Main-request injection of { "type": "web_search" } Pi's openai-codex OAuth resolver
Kimi For Coding Claude Code-style nested Anthropic Messages request declaring web_search_20250305 KIMI_API_KEY or Kimi OAuth
DeepSeek Claude Code-style nested Anthropic Messages request declaring web_search_20250305 against https://api.deepseek.com/anthropic DEEPSEEK_API_KEY
GLM Coding (Z.ai) Claude Code-style nested Anthropic Messages request declaring web_search_20250305 against https://open.bigmodel.cn/api/anthropic ZAI_API_KEY or zai-coding-cn key in auth.json

GLM support currently targets the China Coding Plan provider zai-coding-cn (live-tested with glm-5.3), not the global Z.ai provider. Search requests use the Anthropic endpoint rather than the model's OpenAI-compatible Coding endpoint.

All other providers are intentionally unsupported.

Install

pi install npm:@sakiko233/pi-native-search

Usage

For OpenAI Codex, the extension does not register a client-side search tool. It appends a server-side { "type": "web_search" } entry to the outgoing request's existing tools list and sets tool_choice to auto:

{
  "tools": [...existingTools, { "type": "web_search" }],
  "tool_choice": "auto"
}

Codex keeps full access to its local tools (read, bash, edit, write) while gaining web search. The server-side web_search tool produces no client tool card.

For Kimi For Coding, DeepSeek, and GLM Coding (Z.ai), the extension registers a web_search tool. When the main model calls it, the extension sends a nested Anthropic Messages request declaring:

{
  "type": "web_search_20250305",
  "name": "web_search",
  "max_uses": 8
}

The provider performs the search server-side and returns text plus search-result blocks, which the extension formats as an ordinary tool result.

Configuration

/search           # open settings
/search providers # show supported providers
/search config    # print current configuration
/search on        # enable web search
/search off       # disable web search

Configuration persists in ~/.pi/agent/search-config.json.

Roadmap

  • Selectable search protocol via /search

    Today the search protocol is hardwired per provider. The plan is to decouple provider from protocol so users can choose which protocol each provider uses directly from the /search settings UI — e.g. Kimi For Coding and DeepSeek offer the Anthropic server-tool protocol (web_search_20250305), while OpenAI Codex offers the OpenAI request-injection protocol ({ "type": "web_search" }). This is especially useful for providers that expose multiple compatible endpoints (for example DeepSeek's OpenAI- and Anthropic-compatible APIs).

  • Third-party search tools via MCP

    Add an option to route search through a third-party search tool exposed via MCP (Model Context Protocol) instead of relying on the active provider's native server-side search, letting users plug in external search backends.

Development

npm install --ignore-scripts
npm run typecheck
npm test

The extension is a single TypeScript file, extensions/index.ts, loaded directly by Pi.

License

MIT — see LICENSE.