Pi extension package that exposes Codex web research as a native Pi tool.
- Tool:
codex_search - Command:
/codex-search <question> [|| <question2> ...] - Live progress updates: elapsed time + search/page counters while Codex runs
- Parallel batches: pass multiple questions and the tool runs them concurrently
- Per-run observability: live batch view includes each query's status/action/counters
The tool runs Codex in a locked search profile:
codex --search exec--ephemeral--skip-git-repo-check--sandbox read-only--json(JSONL event telemetry)--output-schema(structured output contract)-o/--output-last-message(deterministic final artifact)
It combines three Codex output modes for reliability:
- Schema-constrained result (
--output-schema) for stable machine parsing - Final message artifact (
-o) for deterministic extraction - JSONL event stream (
--json) for telemetry:- web search actions/queries/opened pages
- usage metadata
- policy checks (command-like event detection)
pi install git:github.com/mikeyobrien/pi-codex-searchYou can also use the HTTPS URL:
pi install https://github.com/mikeyobrien/pi-codex-searchThis writes the package into your global Pi config at:
~/.pi/agent/settings.json→packages[]
pi install -l git:github.com/mikeyobrien/pi-codex-searchThis writes to .pi/settings.json in the current project.
pi install /path/to/pi-codex-searchpi listYou should see one of:
git:github.com/mikeyobrien/pi-codex-searchhttps://github.com/mikeyobrien/pi-codex-search/path/to/pi-codex-search(if installed from a local checkout)
pi -p --no-session "Use codex_search with questions ['What is the latest stable npm version?'] as_of_period 'early' and as_of_year 2026. Return only a short answer."pi -e /path/to/pi-codex-search/extensions/codex-search/index.tsBreaking change: this tool now accepts
questions(array) instead ofquestion.
Parameters:
questions(required): list of research questions- one question → single search behavior
- multiple questions → run in parallel
parallelism(optional): worker count for batch runs (default: auto, max:5)as_of_period(optional):early|mid|late(default:early)as_of_year(optional): reference year (default: current UTC year)model(optional): Codex model overridetimeout_sec(optional): default1800, max7200(very permissive)max_sources(optional): default8, max20fail_on_command_event(optional): defaulttrue
Returns:
- single-question call: same human-readable answer format with
as_of, confidence, and source URLs - multi-question call: batch summary plus per-question result sections
- structured details including telemetry (
searchTrace,usage,commandEvents) for each question details.runStateswith per-query end-state (status,lastAction,elapsedSeconds, counters)- progress summary (
elapsedSeconds,searches,pagesOpened) per question, plus batch summary
If Codex emits search activity but no final structured output, the tool returns reason: "no_final_output" and a hint to retry with a larger timeout_sec.
npm testnix-shell -p python312Packages.pillow --run "python3 scripts/make-demo-gif.py"codexCLI installed and authenticated- network access for web search
- Pi extension docs:
/home/mobrienv/.npm-global/lib/node_modules/@mariozechner/pi-coding-agent/docs/extensions.md - Pi package docs:
/home/mobrienv/.npm-global/lib/node_modules/@mariozechner/pi-coding-agent/docs/packages.md - Codex non-interactive docs: https://developers.openai.com/codex/noninteractive/
- Codex CLI reference: https://developers.openai.com/codex/cli/reference/
