Resolve the canonical OpenAI Codex repository and refresh a read-only reference checkout before making parity or divergence claims. Use the repo-relative routes below. Current source and tests win over this map.
OpenAI Codex
codex-rs/core/src/client_common.rsowns the assembledPrompt.codex-rs/core/src/session/turn.rsbuilds the next prompt from current history and visible tools.codex-rs/core/src/client.rsbuilds Responses requests, derives the prompt-cache key, compares request properties, and decides whether input is a strict extension eligible forprevious_response_id.codex-rs/core/src/tools/spec_plan.rsowns the provider-visible tool plan and ordering.codex-rs/core/tests/suite/prompt_caching.rsandprompt_cache_key.rsprove Codex client construction. They do not prove a provider cache hit.codex-rs/core/src/compact.rsandsession/rollout_reconstruction.rsown local compaction and resumed history reconstruction.codex-rs/codex-api/src/sse/responses.rsmaps provider cache-read and cache-write usage.
Compare this repository with the relevant current Codex owner when request shape, tool order, keying, continuation invalidators, compaction, or usage accounting changes. Record intentional divergence instead of preserving an obsolete local imitation.
Pi core
Resolve the installed @earendil-works/pi-coding-agent and pi-ai versions. Read their current extension, compaction, session, and SDK docs, then trace the corresponding source under packages/coding-agent/src/core and packages/ai/src.
Confirm the active lifecycle rather than assuming an old hook order. Inspect system-prompt assembly, active tool registration, every before_agent_start and context transform, provider serialization, every before_provider_request transform, compaction, replay, and usage normalization.
Pi Codex Conversion
packages/pi-codex-conversion/src/adapter/activation/runtime-plan.tsselects conversion, Code Mode, tool surface, transport, and compaction policy.src/extension/events.tsmaps Pi lifecycle hooks to prompt, provider-request, context, runtime, and compaction owners.src/extension/runtime.tsowns prewarm identity and lifecycle. A prewarm request must match the next real request it prepares.src/adapter/provider-request.tsadapts the final provider payload around runtime selection and compaction.src/providers/openai-codex/request-body.tsowns the normal Codex request.src/providers/openai-codex/responses-lite.tsandresponses-lite-tools.tsown Code Mode's leading developer input and tool layout.src/providers/openai-codex-custom-provider.ts,openai-codex/websocket-stream.ts,session-continuity.ts, andtransport-recovery.tsown transport, replay baseline, continuation, and fallback.src/adapter/compaction/compaction.tsowns native compaction orchestration.src/adapter/replay/owns canonical replay reconstruction and matching.
Normal and Code Mode intentionally have different prompt and tool layouts. Do not claim continuity across that boundary. A ready WebSocket is transport state, not provider cache evidence. Preserve canonical replay item IDs, types, tool pairing, and order after compaction.
Other local cache surfaces
pi-unicode-charts/src/index.tsappends chart instructions when the session has a UI.pi-gippity-control/src/register.tsfilters provider-visible messages incontext.pi-subdir-agents/src/core/subdir.tsappends nestedAGENTS.mdguidance to relevant tool results rather than changing the system prompt.pi-gpt-switcherchanges model lanes.pi-cache-hit-predictor/index.tspredicts reuse and rebuilds around compaction. Its UI is not provider evidence.- Every active registered tool changes the ordered provider tool surface. Inspect conditional activation and the final serialized vector.
For a cache regression, compare initial, tool-continuation, reconnect, mode-transition, and post-compaction requests as applicable. Separate provider-cache evidence, server continuation, transport prewarm, and UI prediction.