← Catalog

@sakiko233/pi-native-search

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

Extension

Install

Install with PiG

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

Install with Pi

pi install npm:@sakiko233/pi-native-search
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.4.0 (README.md). PiG does not review it.

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

ProviderSearch modeAuth source
OpenAI CodexMain-request injection of { "type": "web_search" }Pi's openai-codex OAuth resolver
Kimi For CodingClaude Code-style nested Anthropic Messages request declaring web_search_20250305KIMI_API_KEY or Kimi OAuth
DeepSeekClaude Code-style nested Anthropic Messages request declaring web_search_20250305 against https://api.deepseek.com/anthropicDEEPSEEK_API_KEY
GLM Coding (Z.ai)Claude Code-style nested Anthropic Messages request declaring web_search_20250305 against https://open.bigmodel.cn/api/anthropicZAI_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.