← Catalog

@zigai/pi-codex-core

Everything GPT models need to feel at home in Pi.

Extension

Install

Install with PiG

pig install npm:@zigai/pi-codex-core

Install with Pi

pi install npm:@zigai/pi-codex-core
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": [
    "./src/index.ts"
  ]
}

README

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

Pi Codex Core

Everything GPT models need to feel at home in Pi.

CI npm version npm downloads License: MIT

Install

pi install npm:@zigai/pi-codex-core

Quick start

Run /login openai-codex and select OpenAI Codex (legacy), then choose an openai-codex model with /model for the full legacy-backed feature set.

Pi's newer /login openai does not authorize Core's ChatGPT-backed web_run, image descriptions, or image generation. Keep the separate legacy login for those features, even when using an openai GPT model. imagegen also retains support for compatible active Responses endpoints with their own credentials.

Tool activation follows model and scope settings; authentication is checked when a tool runs. Local image viewing and apply_patch do not require the legacy login. Native compaction, usage/reset credits, and turn recovery require an active openai-codex model; selecting an openai model does not enable them, and Pi compaction remains the fallback.

Features

Tools

  • web_run — Codex-backed web search using the OpenAI Codex search endpoint, supporting cached, indexed, and live modes.
  • imagegen — Codex image generation and editing.
  • view_image — Native local image viewing.
  • apply_patch — Optional port of the Codex native apply_patch editing tool. Enabling it replaces Pi's standard edit tool.

System prompt

Model-aware Codex prompt mode uses matching bundled GPT-6 Astra/Sol/Luna, GPT-5.6 Sol/Terra/Luna, or GPT-5.5 system prompts adapted to Pi's active tools and runtime context.

Compaction

Optional Codex remote compaction v2 replay supports OpenAI Codex response models, with chaining, metadata, fallbacks, world-state injection, auto-compaction, and token-aware context shrinking.

Turn recovery

Resumes transiently failed Codex turns after Pi exhausts standard retry attempts.

Slash command

Use the /codex slash command to manage extension settings and usage:

  • Configure extension settings through a dedicated interactive interface.
  • View current usage metrics and reset expiration dates.
  • Activate available usage resets.

Additional capabilities

  • Compatibility for GPT-6 Astra/Sol/Luna and GPT-5.6 Responses Lite during standard turns, image descriptions, and native compaction.
  • Streamed reasoning trace controls for GPT Responses models.
  • Fast mode option to prioritize response speed.

Configuration

Global settings are stored in ~/.pi/agent/extension-settings/pi-codex-core.json.

OptionTypeDefaultDescription
scope.toolscodex | all"codex"Expose Codex tools only for Codex models (codex) or for all models (all).
tools.webSearchbooleantrueEnable the web_run web search tool.
tools.webSearchModecached | indexed | live"live"Set search mode: cached, indexed, or live.
tools.imageGenerationbooleantrueEnable the imagegen image generation and editing tool.
tools.viewImagebooleantrueEnable the view_image local image viewing tool.
tools.viewImageDescriptionsbooleanfalseInclude Codex-generated descriptions when viewing images.
tools.applyPatchoff | openai | all"off"Replace standard edit with apply_patch: off, openai, or all.
prompt.modepi | codex"codex"Enable model-aware Codex prompts (codex) or standard Pi prompts (pi).
prompt.personalityfriendly | pragmatic | none"pragmatic"Set Codex communication style: friendly, pragmatic, or none.
compaction.enabledbooleantrueEnable Codex-style conversation compaction.
compaction.autobooleantrueAutomatically trigger compaction when reaching the context threshold.
compaction.thresholdPercentinteger80Context percentage threshold that triggers auto-compaction.
recovery.enabledbooleantrueResume transiently failed Codex turns after Pi exhausts retries.
recovery.batchFollowUpsbooleanfalseDeliver user follow-up messages sent during a turn together when it completes.
recovery.maxAttemptsinteger3Maximum delayed resume attempts for a failed turn.
recovery.baseDelayMsinteger30000Initial recovery delay in milliseconds.
recovery.maxDelayMsinteger120000Maximum recovery delay in milliseconds.
openai.webSearchModelstring"current"Model for web_run; current uses the active model.
openai.imageModelstring"gpt-image-2"Model for imagegen.
openai.imageDescriptionModelstring"current"Model for image descriptions; current uses the active model.
openai.compactionModelstring"current"Model for compaction; current uses the active model.
openai.compactionReasoningstring"medium"Reasoning effort for compaction requests: medium, current, max, or ultra.
openai.verbositylow | medium | high"low"Verbosity level for Codex API requests: low, medium, or high.
openai.fastbooleanfalsePrioritize speed for supported OpenAI models.
openai.showReasoningTracesbooleantrueStream reasoning trace summaries for GPT Responses models.
{
  "$schema": "./schemas/pi-codex-core.schema.json",
  "scope": {
    "tools": "codex"
  },
  "tools": {
    "webSearch": true,
    "webSearchMode": "live",
    "imageGeneration": true,
    "viewImage": true,
    "viewImageDescriptions": false,
    "applyPatch": "off"
  },
  "prompt": {
    "mode": "codex",
    "personality": "pragmatic"
  },
  "compaction": {
    "enabled": true,
    "auto": true,
    "thresholdPercent": 80
  },
  "recovery": {
    "enabled": true,
    "batchFollowUps": false,
    "maxAttempts": 3,
    "baseDelayMs": 30000,
    "maxDelayMs": 120000
  },
  "openai": {
    "webSearchModel": "current",
    "imageModel": "gpt-image-2",
    "imageDescriptionModel": "current",
    "compactionModel": "current",
    "compactionReasoning": "medium",
    "verbosity": "low",
    "fast": false,
    "showReasoningTraces": true
  }
}

Acknowledgements

This extension builds upon initial work by Igor Warzocha in pi-codex-conversion.

License

MIT