Linux-native Codex-compatible session manager and agent workstation.
The target is observable 1:1 feature parity with OpenAI Codex CLI/app behavior where public APIs, local configuration, and safe compatibility boundaries allow it. The second target is better long-session performance: bounded hot context, fast resume, deterministic replay, typed tool state, and a terminal UI designed for serious daily work. Interactive parity must be proven with human-emulated E2E tests for 1:1 aesthetics, satisfying animations, visual stability, and measured performance.
This is not a private binary clone. The project uses documented OpenAI APIs, public Codex behavior, public source where available, local runtime traces, and black-box compatibility tests.
Initial foundation:
- Rust CLI and library
- local Codex doctor command
- runtime metrics parser for
codex-tui.log - initial observable parity matrix
- shell approval/risk policy foundation
- safe Codex config and feature-list inventory
- safe reference capture for local Codex help/version/features surfaces
- streaming session JSONL replay summary with malformed-line handling
- native append-only event envelope foundation
- sparse native event-log index generation for resume diagnostics
- native event-log replay state reducer for session/tool aggregates
- durable native tool status projection for approval/replay state
- native session-store foundation for creating and listing session logs
- native session-store append path for shell, PTY, and live PTY tool projections
- per-session advisory locks for cross-process native session appends
- native session fork foundation for copying a validated session prefix into a new indexed branch
- native resume-plan foundation using adjacent sparse indexes
- checkpoint-backed native resume replay using replay seeds in sparse indexes
- replay-seed compaction handoff artifacts with payload-free event references
- semantic-summary compaction handoff artifacts with payload-free event references
- schema-v5 index tracking for latest compaction handoff artifact references
- deterministic native event-log fixture generation
- repeatable native event-log benchmark report
- CI indexed-resume performance evidence gate for a deterministic 60k-event status-rich fixture over 10MB, benchmark report, resume plan, and checkpoint-backed resume replay
- typed GPT-5.5 Responses request construction
- offline Responses API SSE stream parser and accumulator
- incremental Responses API SSE decoder foundation
- mock-tested Responses HTTP transport boundary
- Responses stream to native event-log projection without raw payload retention
- persisted single-turn Responses runtime that appends user/model/failure events
into native sessions with
previous_response_idhandoff - persisted Responses runtime prompt assembly that injects payload-free
replay-seed or semantic-summary compaction context when no
previous_response_idis available - live
model run-turnCLI surface for existing native sessions with env/file API key resolution and prompt-file support - in-memory model tool planner that maps completed
exec_commandfunction calls to typed shell requests without writing raw arguments to event logs - scheduler bridge for starting safe model tool plans with redacted per-request spawn/pending-approval/reject/error outcomes
- model/tool turn orchestrator that runs a persisted model turn and keeps spawned scheduler tools owned and addressable through the caller
- redacted orchestrator finish-all report for explicitly draining active tools
- one-pass Responses tool-output continuation using
function_call_outputitems keyed by modelcall_idwith bounded redacted PTY output previews - bounded library-level model/tool loop that can execute continuation-produced tool plans until a final no-tool response or an explicit round cap
model run-tool-turnCLI smoke surface for one model/tool turn with explicit approval, active-tool finish before process exit, and optional--continue-after-toolsor bounded--max-tool-rounds- headless terminal grid/diff renderer foundation
- ASCII render snapshot serializer and bounded semantic diff foundation
- deterministic ANSI commit byte planner
- headless terminal workstation view foundation with snapshot-tested layouts
- named view fixtures for offline UI snapshot and E2E evidence
- offline resize-flow human-emulated E2E evidence for view fixtures
- deterministic terminal-app smoke harness with JSON/text CLI evidence
- live terminal-app driver foundation with raw-mode polling, resize checks, bracketed paste, ESC timeout, and PTY smoke coverage
- optional terminal-app prompt submission bridge into the bounded model/tool-loop runtime with redacted report events, sanitized progress frames, projected response/tool progress labels, live tool-pane start/finish updates, pending approval projection, approve/reject decision routing, pollable worker-runtime handling for resize/read-only input, deterministic fake-runtime harness coverage, bounded active-PTY poll cumulative byte-count plus recent-line live preview in the tool row, attached-stream live previews without explicit poll requests, and PTY-backed CLI coverage
- expanded command palette for composer commands, prompt submit, active-session interrupt, approval decisions, foreground active-tool controls, foreground cycling/backgrounding, bulk active-tool poll/attach/detach/close-input/backgrounding, and web-search toggle/live/cached/disabled modes plus approval-policy modes for future prompts, with Ctrl-U/Ctrl-W palette query correction and driver routing that keeps palette query bytes out of active PTY stdin
- terminal app latest-session resume selection via
--resume-last - top-level
resumeandforkwrappers for explicit, latest, or TTY line-picker-selected native sessions; explicit/latest forms can submit an initial prompt into the live terminal runtime, with effective config/profile/model projection, approval-policy flags, read-only/workspace-write model-tool sandbox projection,--add-dirwritable-root binding with default workspace-write promotion,--cdruntime working-directory override, Responses hostedweb_searchprojection for explicit live--search, default/configured cached search,web_search = "disabled|cached|live", legacy search feature toggles,tools.web_searchcontext/domain/location controls, palette controls for preset and arbitrary model selection, low/medium/high/xhigh reasoning effort, low/medium/high verbosity, approval-policy mode selection, live/cached/disabled search mode, low/medium/high search context size, preset and arbitrary domain restrictions, and key/value approximate location hints, local--imageprojection for initial-prompt and staged first composer submissions, and--no-alt-screeninline rendering - top-level
resume --allandfork --allnative-session listing when stdin is not a terminal, with--allopening a searchable line picker on a TTY; freshexec, review, and MCP-created sessions are marked non-interactive, andresumepicker/--all/--lasthide them unless--include-non-interactiveis set, while full-screen visual and animation polish remain open parity work - bare
execwrapper for fresh native-session non-interactive prompts, piped stdin, prompt-plus-stdin<stdin>blocks, model override, JSONL model/tool events with a final report, strict Responsestext.formatoutput schemas, and--output-last-message exec resumenative-session wrapper for non-interactive--last/explicit session prompts, stdin-, model override, bounded model/tool loops, JSON event streams, strict Responsestext.formatoutput schemas, and--output-last-message- top-level
reviewandexec reviewwrappers for uncommitted, base-branch, and commit diffs with custom instructions, model override, JSON reports, and--output-last-message, plus effective config/profile review model projection through-c,--enable,--disable, and exec-level--profile;exec reviewaccepts exec-level--color,--sandbox, and--output-schemabefore the subcommand, validates color/sandbox, and keeps schema/sandbox inert because review has no model-planned shell tool loop; review git-repository checks are enforced, andexec reviewaccepts observed exec-only compatibility flags including--skip-git-repo-check,--ignore-user-config,--ignore-rules, and--ephemeraltransient non-persistent review sessions - native
execandexec resumemodel/runtime defaults from effective$CODEX_HOME/config.toml, transient-coverrides, feature toggles, and exec profiles without mutating config files; local--imageattachments are projected into Responses image input parts; git-repository checks are enforced unless--skip-git-repo-checkis set; explicit--sandbox read-onlyand--sandbox workspace-writemodel-planned PTY tools run through the native bubblewrap wrapper, and--add-dirbinds extra writable roots into that sandbox. When--add-diris provided without an explicit or configured sandbox and sandbox bypass is off, nativeexec/exec resumepromotes model-planned PTY tools to the workspace-write bubblewrap mode so the requested roots are actually writable.exec --ephemeral,exec resume --ephemeral, andexec review --ephemeralrun through a transient session root that is removed after completion; resume ephemeral clones the selected source session into that root first, leaving the configured native session root unmodified. Remaining visible exec flags such as OSS/local providers are accepted with explicit blockers where native behavior is not implemented applysurface with hosted task diff retrieval marked blocked and a native--patch-filepath backed bygit apply- help-compatible top-level
login,logout,mcp-server,completion,update,sandbox,debug,cloud,exec-server, andfeaturessurfaces;mcp-serverowns the safe native stdio JSON-RPC handshake, tool listing, method errors, malformed-line recovery, and model-backedcodex/codex-replycalls through the native session/model runtime, with upstream-stylecontentplusstructuredContentresults and explicit MCPcompact-promptpersistence for replay-seed and semantic-summary compaction context injection; MCP read-only and workspace-write sandbox modes use the same native bubblewrap-backed PTY tool runtime,sandbox linuxruns explicit danger/no-sandbox commands natively and uses bubblewrap for default read-only plus workspace-write sandbox modes, including custom named permissions profiles that resolve to configured sandbox modes, while--include-managed-configis accepted only when no managed source is present and full upstream[permissions]policy parity remains open,completiongenerates native shell completions,features listprefers live local Codex feature output, falls back to the embedded catalog offline, and overlays config/transient effective state without mutation;features enable/disablevalidate feature names and mutate[features]config entries, native app-serverconfig/value/writeandconfig/batchWritemutate only known non-secret userconfig.tomlkeys from the safeconfig/readprojection,debug prompt-inputrenders a local prompt/image input JSON slice with upstream-style image wrappers,debug modelscan bridge to a local upstream Codex binary for raw model catalog inspection and--bundledhas a sanitized embedded fallback when upstream is unavailable,debug app-server send-message-v2can bridge to upstream Codex for its verbose protocol transcript, loopbackexec-servercan bridge to upstream Codex, and private/runtime-backed surfaces return explicit blockers - hidden
execpolicy checkprefix-rule evaluator for local rule files, including strictest-decision JSON output and host executable resolution - safe native
mcp list,mcp get,mcp add, andmcp removesurfaces for configured~/.codex/config.tomlMCP servers, with-c key=valueread overrides, secret-bearing value redaction, and OAuth commands reported as explicit blockers - safe native
plugin inventoryfor cached.codex-plugin/plugin.jsonmanifests, manifest schema validation errors, and frontmatter-only plugin skill index entries, plus help-compatible plugin marketplace command blockers - help-compatible
app-serverruntime bridge to a local upstream Codex binary, nativeapp-server --listen unix://control-socket serving, native loopbackapp-server --listen ws://IP:PORTWebSocket serving with health endpoints, nativeapp-server proxystdio-to-control-socket transport, and native stdio/Unix-socket/WebSocket JSON-RPC bootstrap for localthread/start/thread/resume/thread/fork, thread name/git/archive metadata, async model-backedturn/startfor text/image and bounded local skill/mention file input through the Responses/tool loop with transientthread/status/changed,turn/started, redacted commandExecutionitem/started/item/completedshells for model-planned shell tools, agent-message delta/completion notifications, andturn/completednotifications whose turn readbacks include redacted userMessage, agentMessage, and commandExecution item shells, connection-scopedturn/interruptcancellation for active native turns, and payload-free native event logs, nativecommand/execfor standalone argv execution with bounded buffered stdout/stderr capture, non-PTY streaming stdout/stderr notifications, streaming stdin write/close, PTY process sessions with bounded combined output deltas, PTY stdin write/close, PTY resize, connection-scoped terminate, and timeout/terminate cleanup, async model-backedthread/compact/startsemantic summary compaction with deprecatedthread/compactednotification compatibility and redactedcontextCompactionturn item readback, thread/model/config/account/auth/MCP/hook/skill/app inventory including metadata-only user/project hook discovery fromconfig.tomlandhooks.json, initialized remote-control disabled status notifications, redacted conversation summaries, metadata-only filesystem inspection and directory listing, bounded base64 file reads and writes, bounded regular-file and recursive directory copy, bounded regular-file and recursive directory remove, directory creation, safe MCP config reload acknowledgement, connection-scoped filesystem watch registration with bounded pollingfs/changednotifications, bounded fuzzy file search plus experimental-gated fuzzy-search session update/completion notifications, cached plugin list/read projection, boundedthread/shellCommanduser-shell execution with command item notifications and payload-free persisted metadata, schema-declared unsafe/private mutation methods return explicit native blockers, nativegitDiffToRemoteHEAD/upstream diff projection, and static reference generation forapp-server generate-tsandapp-server generate-json-schema - typed shell tool request/event model
- bounded non-PTY shell execution adapter with tool/event-log projection
- PTY execution foundation for non-interactive shell requests with combined output, policy-aware CLI smoke, and event-log projection
- live PTY controller library foundation for stdin writes, input close, runtime resize, kill, transient output drains, and incremental event projection
- actor-backed live PTY CLI smoke surface for scripted input, resize, drain, close, kill, and event-log replay checks
- bounded live PTY actor foundation for queued input, resize, drain, kill, finish, per-command actor replies, and incremental event-log projection
- persisted live PTY runtime bridge for appending actor starts, commands, rejections, command errors, and finishes into native session-store logs
- native tool runtime scheduler foundation for multiple persisted PTY actors, duplicate active ID rejection, and serialized session-store appends
- replayable PTY input byte-count, resize, signal, and control-action event schema
- human-emulated E2E parity requirements for UI, animation, and performance
- offline human-emulated E2E scenario/report validation harness
- foundational architecture, parity, performance, and security docs
- CI workflow for formatting, Clippy, tests, indexed-resume performance evidence, and human-emulated terminal-app gates
cargo run -- doctor
cargo run -- metrics
cargo run -- parity
cargo run -- policy shell --json -- git push
cargo run -- config inventory
cargo run -- config features
cargo run -- features list
cargo run -- features enable unified_exec
cargo run -- completion zsh
cargo run -- mcp list
cargo run -- mcp list --json
cargo run -- mcp get github
cargo run -- mcp add docs --url https://example.test/mcp
cargo run -- mcp add github --env GITHUB_TOKEN=token -- npx -y @modelcontextprotocol/server-github
cargo run -- mcp remove github
cargo run -- plugin inventory
cargo run -- plugin inventory --json
cargo run -- app-server --listen stdio://
cargo run -- app-server generate-json-schema --out target/app-server-schema
cargo run -- reference commands
cargo run -- reference capture --out target/reference/codex-local
cargo run -- session summarize ~/.codex/sessions/path/to/session.jsonl
cargo run -- event-log summarize path/to/events.jsonl
cargo run -- event-log index path/to/events.jsonl --out path/to/events.index.json
cargo run -- event-log replay-state path/to/events.jsonl
cargo run -- native-session create --root target/native-sessions --session-id demo
cargo run -- native-session resume-plan --root target/native-sessions --session-id demo
cargo run -- native-session resume-replay --root target/native-sessions --session-id demo
cargo run -- native-session fork --root target/native-sessions --source-session-id demo --target-session-id demo-branch
cargo run -- native-session compact-replay-seed --root target/native-sessions --session-id demo --artifact-id compact-001
cargo run -- native-session compact-summary --root target/native-sessions --session-id demo --artifact-id summary-001 --summary-file summary.md
cargo run -- native-session compact-summary --root target/native-sessions --session-id demo --artifact-id summary-generated-001 --source-file transcript.md --api-key-file ~/.config/openai/api-key
cargo run -- native-session compact-summary --root target/native-sessions --session-id demo --artifact-id summary-auto-001 --from-session --api-key-file ~/.config/openai/api-key
cargo run -- native-session prune-compactions --root target/native-sessions --session-id demo --keep-latest-per-kind 3 --json
cargo run -- native-session prune-compactions --root target/native-sessions --session-id demo --keep-latest-per-kind 3 --apply --json
cargo run -- fixture event-log target/fixtures/smoke.jsonl --events 1000
cargo run -- event-log benchmark target/fixtures/smoke.jsonl
cargo run -- model stream-summary path/to/responses-stream.sse
cargo run -- model stream-to-event-log path/to/responses-stream.sse --event-log target/model-stream.jsonl --session-id demo
cargo run -- model run-turn --native-session-id demo --prompt-file prompt.txt --api-key-file ~/.config/openai/api-key --json
cargo run -- model run-tool-turn --native-session-id demo --prompt-file prompt.txt --api-key-file ~/.config/openai/api-key --approved --json
cargo run -- model run-tool-turn --native-session-id demo --prompt-file prompt.txt --api-key-file ~/.config/openai/api-key --approved --continue-after-tools --json
cargo run -- model run-tool-turn --native-session-id demo --prompt-file prompt.txt --api-key-file ~/.config/openai/api-key --approved --max-tool-rounds 4 --json
cargo run -- tool shell --json --approved -- /bin/sh -c 'printf hello'
cargo run -- tool shell --approved --native-session-root target/native-sessions --native-session-id demo -- /bin/sh -c 'printf hello'
cargo run -- tool pty --json --approved -- /bin/sh -c 'printf hello'
cargo run -- tool pty-live-smoke --json --approved --step input-line:stdin:hello --step drain:500 -- /bin/sh -c 'read line; printf "got:%s\n" "$line"'
cargo run -- view snapshot active-tool-run --cols 96 --rows 24
cargo run -- view resize-flow active-tool-run --json
cargo run -- terminal-app smoke --json --step line:run --step resize:100x20 --step render:stable
cargo run -- terminal-app run --exit-after-submit --max-duration-ms 1500 --json
cargo run -- terminal-app run --native-session-id demo --api-key-file ~/.config/openai/api-key --approved --max-tool-rounds 4 --json
cargo run -- terminal-app run --resume-last --api-key-file ~/.config/openai/api-key --approved --max-tool-rounds 4 --json
cargo run -- terminal-app run --fork-last --fork-target-session-id demo-branch --api-key-file ~/.config/openai/api-key --approved --max-tool-rounds 4 --json
cargo run -- resume --last "status" --sandbox read-only --api-key-file ~/.config/openai/api-key --approved --max-tool-rounds 4 --json
cargo run -- resume --all --json
cargo run -- fork --last "try this branch" --add-dir /tmp/extra-work --target-session-id demo-branch --api-key-file ~/.config/openai/api-key --approved --max-tool-rounds 4 --json
cargo run -- fork --all --json
printf 'extra input' | cargo run -- exec "status" --api-key-file ~/.config/openai/api-key --approved --json --output-last-message target/exec-last-message.txt
printf 'status' | cargo run -- exec resume --last - --api-key-file ~/.config/openai/api-key --approved --json --output-last-message target/last-message.txt
cargo run -- review --uncommitted --api-key-file ~/.config/openai/api-key
printf 'focus tests' | cargo run -- exec review --commit HEAD - --api-key-file ~/.config/openai/api-key --json --output-last-message target/review.txt
cargo run -- apply local-task --patch-file target/change.patch --cwd . --jsonQuality gate:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspacesrc/main.rs- CLI entry pointsrc/approval.rs- shell risk classification and approval decisionssrc/bench.rs- repeatable local benchmark reportssrc/command_palette.rs- typed terminal command palette modelsrc/composer.rs- UTF-8-safe terminal composer controllersrc/doctor.rs- local runtime/environment checkssrc/config.rs- safe config and feature-list inventory parsingsrc/event_index.rs- sparse native event-log index generationsrc/event_log.rs- append-only native event envelope and summary scannersrc/event_replay.rs- native event-log replay state reducersrc/fixtures.rs- deterministic event-log fixture generationsrc/human_e2e.rs- human-emulated E2E scenario/report validationsrc/metrics.rs- Codex runtime log metrics parsersrc/mcp.rs- safe MCP server config projection, mutation, and redactionsrc/model.rs- typed Responses API request constructionsrc/model_orchestrator.rs- model turn to scheduler orchestration boundarysrc/model_runtime.rs- persisted Responses/native-session turn and continuation runtimesrc/model_stream.rs- Responses API SSE parsing and event-log projectionsrc/model_tools.rs- in-memory model function-call to tool-request planningsrc/model_transport.rs- Responses API HTTP transport boundarysrc/parity.rs- initial observable parity matrixsrc/plugin.rs- safe plugin manifest inventorysrc/pty_actor.rs- bounded actor wrapper for live PTY sessionssrc/pty_exec.rs- PTY execution and live controller foundationsrc/pty_runtime.rs- persisted live PTY actor/native-session bridgesrc/pty_script.rs- deterministic scripted live PTY smoke runnersrc/reference.rs- safe local Codex reference capturesrc/render.rs- headless terminal grid, paint, and diff primitivessrc/render_commit.rs- deterministic ANSI commit byte planningsrc/render_loop.rs- pure terminal frame loop and full/diff plannersrc/render_snapshot.rs- stable terminal-frame snapshot serializersrc/session_replay.rs- streaming JSONL replay metricssrc/session_resume.rs- native resume-plan constructionsrc/session_store.rs- native session-store managementsrc/terminal_app.rs- pure terminal app shell and frame wiringsrc/terminal_app_harness.rs- deterministic terminal app E2E harnesssrc/terminal_driver.rs- live terminal app raw-mode driver foundationsrc/terminal_input.rs- pure terminal key and paste decodersrc/terminal_writer.rs- TUI stdout-owner boundary and write metricssrc/tool_exec.rs- bounded shell execution and tool event projectionsrc/tool_runtime.rs- native tool scheduler foundation and active-tool view projectionsrc/tools.rs- typed shell tool request/event modelsrc/view_fixtures.rs- named terminal view fixturessrc/views.rs- headless terminal workstation view paintersdocs/PROJECT_PLAN.md- build plan and milestonesdocs/APPROVAL_POLICY.md- shell command approval/risk policydocs/ARCHITECTURE.md- native runtime architecturedocs/COMPOSER.md- terminal composer editing contractdocs/CONFIG_AND_FEATURES.md- config/feature inventory scopedocs/EVENT_INDEX.md- sparse event-log index shape and CLI usagedocs/EVENT_LOG.md- native event log envelope and replay rulesdocs/EVENT_REPLAY.md- native event-log replay report shapedocs/FIXTURES.md- offline deterministic event-log fixturesdocs/HUMAN_E2E_HARNESS.md- deterministic E2E scenario/report contractdocs/HUMAN_E2E_PARITY.md- UI, animation, and performance E2E bardocs/MODEL_RUNTIME.md- Responses API runtime directiondocs/PARITY_MATRIX.md- parity scope and acceptance criteriadocs/PERFORMANCE_STRATEGY.md- metrics and stress-test posturedocs/PTY_EXECUTION.md- PTY execution foundation behavior and limitsdocs/REFERENCE_CAPTURE.md- reference capture command scopedocs/RENDER_COMMIT.md- ANSI byte planning and stdout boundarydocs/RENDER_LOOP.md- pure frame-loop planning boundarydocs/RENDER_SNAPSHOTS.md- headless render snapshot format and diffingdocs/SESSION_REPLAY.md- session replay privacy and large-line behaviordocs/SESSION_RESUME.md- native resume-plan behaviordocs/SESSION_STORE.md- native session-store layout and CLI usagedocs/SECURITY_AND_BOUNDARIES.md- clean-room, auth, and safety limitsdocs/SHELL_EXECUTION.md- bounded shell execution behaviordocs/TERMINAL_APP.md- pure terminal app shell contractdocs/TERMINAL_APP_HARNESS.md- scripted terminal app E2E harnessdocs/TERMINAL_DRIVER.md- live terminal driver contractdocs/TERMINAL_INPUT.md- terminal input decoder contractdocs/TERMINAL_RENDERER.md- renderer stdout ownership and snapshot plandocs/TERMINAL_WRITER.md- TUI writer lifecycle and metricsdocs/TERMINAL_VIEWS.md- headless terminal view contractdocs/TOOLS.md- tool event model and privacy boundariesdocs/VIEW_FIXTURES.md- named terminal view fixtures
Every feature must have an observable compatibility target, typed internal boundary, and verification artifact. Performance claims need benchmark, trace, or replay evidence.