- Rust 45%
- Python 44.3%
- Shell 8.9%
- Starlark 1.5%
- C 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .agents | ||
| docs | ||
| elevation-gate | ||
| patches/legacy | ||
| runtime-control | ||
| runtime-fastctx-adapter | ||
| runtime-module-spike | ||
| runtime-native-modules | ||
| skills | ||
| tools | ||
| vendor | ||
| .bazelversion | ||
| .gitignore | ||
| .gitmodules | ||
| AGENTS.md | ||
| BUILD.bazel | ||
| BUILD.md | ||
| MODULE.bazel | ||
| README.md | ||
Codex patched: modular runtime
This repository packages Codex around a native runtime module system. The
patched host loads a versioned manager, exposes module catalog and lifecycle
operations, and lets selected feature modules provide their capabilities. The
module system is the default architecture of this fork, not an optional demo.
The patched source is pinned in vendor/codex and reproduced by
runtime-control/patches/0001-codex-customizations.patch
against the upstream release recorded in runtime-control/release.conf.
The CLI exposes codex modules and the TUI exposes /modules for status,
inspection, verification, activation, rollback, and disable. Package staging
can include approved module libraries; the active version of each module is
selected per Codex profile. See native module activation
and the module author guide for the lifecycle and
ABI contracts.
Module and tool layer
| Component | Role | Interface |
|---|---|---|
| Native runtime manager | Loads versioned modules, publishes their catalog, and controls activation and rollback | Patched Codex host; codex modules and /modules |
| Runway | Context telemetry, checkpoint state, and phase assessment | Native module |
| Session history | Bounded access to the indexed Codex session history | Native module |
| Session state | Bounded host-owned state snapshots and restore | Native module |
| Context hooks | Role hints at context and compaction boundaries | Native module |
| Agent policy | Checks native agent spawns against configured role policy | Native module |
| Model route | Proposes a configured model route for host validation | Native module |
| Approval guard | Vetoes configured tool approvals at host checkpoints | Native module |
| Statusline | Wraps statusline content to display configured indicators across multiple rows | Native module |
| FastCtx | Local file inspection, search, glob, and replacement through the official FastCtx MCP server | FastCtx adapter; external MCP connection |
runtime-native-modules/build-approved.sh defines the release allowlist for
the manager and eight native feature modules. It produces a manifest containing
the library name, SHA-256, and absolute source path for each artifact. Staging
uses CODEX_APPROVED_MODULES_MANIFEST to verify and include those artifacts.
FastCtx is an external tool connection in the same working tool layer; its
adapter configures the official server and does not load a native library.
Local fixes and delivery work
| Area | Change | Detail |
|---|---|---|
| Codex source | Integrates the native manager with Core, CLI, TUI, session, and tool surfaces | Source patch and patch migration |
| Restart handling | Adds managed daemon recovery and restart checks | runtime-control/ and its restart tests |
| Module updates | Adds version selection, verification, rollback, and profile activation tooling | Activation guide and update acceptance |
| Release integrity | Pairs CLI and code mode host from one build record, checks staged hashes, and verifies packages before installation | BUILD.md |
| Desktop integration | Updates the desktop bridge and Codex manager/doctor helpers | tools/desktop-bridge/, docs/codex-manager.md, and docs/codex-doctor.md |
| External file tools | Adds the FastCtx connection and catalog probe | FastCtx adapter |
Build and repository map
Follow BUILD.md to build, stage, and package the paired CLI and code
mode host. tools/build-codex-release retains immutable builds under
dist/dev-builds/; staging and packaging verify their hashes. The
alpha rebase runbook covers moving the source
patch to another upstream release.
| Path | Contents |
|---|---|
vendor/codex/ |
Pinned patched Codex source submodule |
runtime-native-modules/ |
Manager release allowlist and native feature modules |
runtime-module-spike/ |
Native ABI prototype and module update acceptance work |
runtime-fastctx-adapter/ |
Official FastCtx MCP connection helper |
runtime-control/ |
Release pin, complete source patch, restart sidecar, and checks |
tools/ |
Build, staging, packaging, activation, doctor, and desktop helpers |
docs/ |
Architecture, module, migration, and operations guides |
patches/legacy/ |
Archived patch fragments; not an input to the current build |
The complete source patch is regenerated after vendor edits settle. Archived
patches under patches/legacy/ document earlier work and must not be applied
on top of the current source patch.