slop harness view
README.md

cia #

cia is a native desktop client for the Agent Client Protocol — a GTK 4 / libadwaita application that hosts local and remote ACP agents in rich, persistent, multi-session windows, with no terminal and no editor attached.

Status: pre-alpha. It builds, it talks to an agent, and sessions survive a restart. The list below is intent with the truth marked next to each item: read it as a specification under review, not as a feature list.

Why a desktop client #

ACP's existing clients are editors (Zed, JetBrains, Neovim, Emacs) and notebooks (marimo). They are good at what they are: the agent shares the buffer you are already looking at. A dozen agents now speak ACP, either natively — Gemini CLI, OpenCode, cursor-agent acp, Goose, Junie, Cline, Qwen Code — or through an adapter, such as Claude Code via claude-acp and Codex via codex-acp.

What none of them offer is a place for agent work that is not anchored to one file: research, operational triage, long-running delegation, and supervising several agents at once. Those want a window with its own session list, its own history, and the ability to point at a machine that is not this one. That is the gap cia fills.

What cia is meant to do #

  • Local and remote agents behind one interface. Mostly. Every agent is a stdio subprocess; a remote one is the same subprocess with ssh in front of it, so --cwd=host:directory runs the session on another machine and the sidebar files it under that machine. There is still no network transport of cia's own, and reading files on the far side is not something it does — see Remote agents. Agent authentication methods have a sign-in card and call authenticate; terminal methods and pre-session gating are still open.
  • Sessions as objects, not scrollback. Mostly. A session owns its agent, its working directory and its transcript, and the open ones are written to disk and reopened on the next launch; a closed tab keeps its record, its sidebar row and a way back. The file keeps the raw log of what the agent sent, and the transcript is rendered from that on restore, so a renderer added later applies to every session recorded with the log. The agent's own session id is saved with it: when the next prompt wakes a saved session, agents that advertise session/load get their memory back. Open sessions are grouped in the sidebar by the machine and directory they ran in — this one first, then each host in turn, each heading written the way rsync writes a remote path — and a new tab starts in the location the window was launched in. Under a heading the directory is already said, so a row is named by what the session was first asked, cut to the one line a row has; a session nobody has asked anything yet answers to the directory's name and takes its own when the first prompt is sent. Ctrl+K opens the switcher over the window: one field that finds a session by the name the sidebar gives it, by the location it ran in, by its agent, by the model it answers with, or by a phrase from anywhere in its transcript, and offers the commands with them — Model, Thinking, Reload the agent, a new session with any configured agent. What a row is here for is on the row: the words the ask found are marked in highlighter yellow where the row shows them, and a row that is here because of something it said quotes two or three lines of it under its name — as a row found by the model at its end does, rather than leaving the answer at the far right. It reaches past this window: a session whose tab is in another window is offered too, and picking it brings that window forward rather than opening a second copy. What the agents themselves keep is offered as well — session/list asks each configured agent what sessions it has, so a conversation started at a terminal or in another client is a row here — and picking such a row opens it and takes the transcript from what the agent replays, there being no log of it here. The agents are asked when the switcher opens and their answer is kept for a minute, because session/list is a request like any other: it costs a running agent, and a palette that waits on one booting is a palette that lost the keystroke. New Session in Folder… (Alt+T, or Ctrl+O) picks another one and starts the agent the session on screen is using. An agent's working directory is fixed once its session exists — session/new takes it, and no request moves it — so another folder means another session. Agents without it, or whose session is gone, start fresh with the transcript intact and say so. The conversation history is still ours, not replayed from the agent. A row's right-click menu, and a tab's, offer Copy Session Information: the session's ids, agent, model, state and the build that drew it, fenced and ready to paste into a bug report or a chat with an agent — which is the shortest road from a session that misbehaves to the log behind it.
  • Several agents at once. Done. Independent sessions run in parallel, each in its own tab with its own agent, rather than round-robining a single conversation. New Session in the menu is a submenu of the available agents — pi and the Baseten Codex launcher by default — so one window can hold pi and Codex sessions side by side. Ctrl+N opens another window with its own tabs and sidebar; Alt+N opens one with the folder picker over it, and its agent starts in the folder you choose (cancelling keeps the session the window came up with). The launch window restores the saved sessions, while a new window starts with one fresh session. Dragging a tab out of the bar and letting go of the desktop gives that session its own window; the tab you take leaves its window empty, and a window with nothing in it is the same drop as closing the last tab. Closing the last tab closes the window, and closing the last window quits the application — the sessions are written first, so they come back on the next launch. Every window shares one session store, so one window's save cannot erase another's history.
  • Rich rendering. Mostly. Markdown, code, tables, quotes and tool calls are native widgets. A tool call names itself — its status and the tool's name — and puts the command or path it was given on the row underneath, highlighted as the code it is, where a long one has the width to be read. Hide cd to Working Directory drops the cd <session directory> && an agent puts in front of nearly every command, so the line starts with the command itself. A thought keeps to one line: its word and the opening of what the agent was thinking, or three when Step Display is Cozy. A step with more than fits folds out the rest — the full command and what it printed, or the whole thought — and Show Thinking in the menu opens every thought in the session. The Step Display preference lists every step of a run on a line of its own, lists them with room to wrap (cozy: three lines, five for a shell command), or folds the run behind the step it is on, which opens to the whole list; once every call in a run has finished, its folded line sums the run up as its step count, the tokens it added, and a chip for each kind of step it used. Plans and images have rows of their own; a diff keeps its summary on the line and folds out the full patch; the composer shows the session's context usage. A compaction of the context is a row of its own too — a rule across the column with the news in it — and the summary the agent kept folds out under it: ACP's own compaction_update and pi's prose notices both land in that row, so a compaction reads as a break in the conversation rather than as the opening line of the next answer. The composer grows with the prompt, sends on Enter and keeps the newline for Shift+Enter. An image pasted into it (Ctrl+V) is named in the text by a marker, [image 1], inserted at the caret and coloured like the reference it is; the thumbnails wait under the text, a harness that flattens a prompt into text plus a list of images has no other way to tell which picture a sentence is about, and removing a thumbnail removes its marker and closes the gap in the numbering. The image goes out with the prompt as an ACP image content block, the sent prompt shows it too, and so does a session restored from disk. An agent that does not advertise the image prompt capability says so instead of failing the turn. Prompts typed during a turn wait in a small peeking stack above the composer. One line under the transcript's last row is always there and always says what the session is waiting on: a spinner and Working… while a turn runs, Waiting for your approval while a permission card is up, Ready once the turn is over, and the reason when the agent stops short — the token limit, a refusal, the reader's own cancel. Without it, a turn whose last word was a thought folded to one line reads as finished while it is still running, and a turn that has ended reads as running. Text selection is GTK's own, so it stops at block and widget boundaries.
  • First-class prompts. Partly. Permission requests arrive as cards in the transcript, tied to the session that raised them, with the agent's own choices. They are not dialogs. Agent authentication methods get a sign-in card above the transcript and call authenticate; terminal methods are shown but not launched, and a session that must authenticate before it can be created is not gated yet.

How it fits together #

Workspace layout:

Crate Role
cia-core ACP client, agent process and transport management, session model. No GTK, testable headless.
cia The binary and, for now, the widgets and window chrome: sessions, transcript rendering, dialogs, settings. A separate cia-ui crate is still a possible split, not something that exists yet.

Two loops, one process: GTK owns the main thread, and ACP I/O runs on an async runtime off it. They meet over channels, so a slow or half-dead agent cannot stall the frame clock, and a blocking dialog cannot stall the protocol.

Requirements #

  • GTK 4.24+ and libadwaita 1.9+ at runtime; gtk4-rs 0.11 and libadwaita-rs 0.9 at build time. Both versions are what nixpkgs 26.11 ships.
  • Rust, edition 2024. The exact MSRV is one of the open decisions.
  • ACP protocol v1 through the agent-client-protocol crate (5.x), which is the stable wire version. Protocol v2 exists as a draft and is not a target yet.

Development #

nix develop (or direnv, through .envrc) provides the whole toolchain: rustc 1.99, cargo, rustfmt, clippy, rust-analyzer, cargo-nextest, and the GTK 4.24 / libadwaita 1.10 development headers that pkg-config resolves. Nothing else needs installing on NixOS.

Outside Nix, the build needs a C toolchain, pkg-config, and the GTK 4 and libadwaita development packages from your distribution.

The loop is cargo build, cargo nextest run, and cargo clippy --all-targets.

Building it with Nix #

crane is the layer that turns those cargo invocations into derivations, and the flake is arranged around the split it makes. cargoArtifacts builds every dependency — gtk4-rs, the ACP SDK, tree-sitter — from the lockfile alone, and the crate build, clippy and the test run each start from its compiled artifacts, so editing a widget does not relink the bindings:

nix build .#cia          # ./result/bin/cia, wrapped for GSettings and the SVG loader
nix run .#cia            # the same, started
nix build .#appimage     # one file for a machine with no Nix on it
nix flake check          # build, clippy, nextest, rustfmt, cargo-deny, audit, metainfo

Two parts of the flake are load-bearing rather than stylistic:

  • The source is a list of files, not the checkout. .envrc evaluates the flake as ., a git ref, so Nix sees the tracked files and never target/ (see Pushing for what the path: ref it replaced cost). What the build sees is narrower still: a lib.fileset naming the manifests, the .rs files, the assets the binary embeds, and .config/nextest.toml. Every derivation starts from that one source, so a change to docs/ would otherwise change its hash and rebuild all of them.
  • Every cargo derivation shares one input set. The *-sys crates fold PKG_CONFIG_PATH into their build-script fingerprint, so a derivation given even a slightly different set of GTK inputs recompiles all of them instead of reusing the cache.

The installed binary gets a wrapper, because two of the things a GTK application needs are not things a Rust binary carries: the compiled GSettings schemas, and a gdk-pixbuf loader cache — whose SVG loader comes from librsvg, the same file the dev shell points at. python3, shfmt and pi-acp go on its PATH, which is what lets --fake, the tool call formatting and the default agent work from a store path with nothing installed.

Installing it #

The package installs the three things that make it an application rather than a binary in a wrapper — the menu entry, the mark under the application id, and the release metadata — from data/, whose README says what each one is for. A NixOS host takes them by importing the flake's module:

# configuration.nix
{ programs.cia.enable = true; }   # programs.cia.package overrides the derivation

That puts share/applications/cool.haze.cia.desktop where a launcher looks, and glib-compile-schemas over the merged schemas is what the system profile does for environment.systemPackages — the same thing the wrapper spends its XDG_DATA_DIRS prefix on, for the hosts that are not NixOS. The application id, the entry's Icon= and the window's icon-name are one string, cool.haze.cia, and the icon theme finds the mark by it. The module also asks for gtk.iconCache, whose NixOS default follows services.xserver.enable even though a GTK icon theme is looked up under Wayland exactly as it is under X.

How the flake reaches the system configuration is the one thing to decide with care: a git+file: or git+https: ref runs into Nix's SHA-1 expectation for this repository's objects, the same one .envrc works around, so a hosted tarball fetch or an exported path: source is the input that evaluates.

Shipping one file #

nix build .#appimage is a type-2 AppImage: cia's whole closure in a squashfs behind a static runtime, some 324 MB. nix-appimage builds it, and it is that bundler's AppRun which makes the work here nearly nothing — it overlays the bundle's own /nix/store over the host's and chroots there, so the absolute store paths the wrapper above writes into the binary still resolve: the pixbuf loader cache, the GSettings schemas, the agent on PATH. It is also the bundler that reads the .desktop entry and the hicolor mark to fill in the bundle's own metadata, so without data/ there is no file to build.

A host needs unprivileged user namespaces for the AppRun's unshare, and /dev/fuse for the mount, with APPIMAGE_EXTRACT_AND_RUN=1 for that second one. The GTK renderer is the thing to test first on a machine that is not this one: the bundle carries its own mesa, and GSK_RENDERER=cairo is the way around a host whose GL or Vulkan driver will not pair with it. The pi the bundled adapter spawns is still found on the host's PATH — a bundle carries the client and its adapter, not somebody's agent.

Running it #

nix develop --command cargo run                                   # talks to `pi-acp`, from this flake
nix develop --command cargo run -- --cwd=~/dev/cia --name=pi      # or somewhere else

An agent is spawned when a new session opens, so its model and thinking-level selectors are there before you type. A session restored from disk waits for your first prompt instead, which is what keeps a dozen restored tabs from spawning a dozen processes; that first prompt also asks the agent to resume its saved session where it can. If the program is missing, the session says so in a banner with a Retry rather than panicking.

/model <text> and /thinking <text> open the agent's selector with the text as its initial search, so /model deepseek lands on the matching models. The rest of the line is not sent to the agent.

/reload replaces the agent process. ACP carries prompts, not commands, so there is no way to ask an agent to re-read its extensions, skills, prompts and context files in place; the fresh process re-reads them all, and the transcript and the agent's session id come back unchanged. The agent has to be idle, because a running turn belongs to the process being replaced.

Sessions on disk #

Sessions live in one SQLite database, $XDG_STATE_HOME/cia/cia.db (~/.local/state/cia/cia.db by default), and open sessions are reopened on the next launch, newest last, twelve as tabs. That is a preference: with Reopen Sessions on Startup off, the window launches on one fresh session and the sessions that were open stay in the sidebar, closed and reopenable. Each session also keeps the agent's session id, so a saved conversation can resume the agent's memory through session/load when the agent supports it; the raw event log is what restores the transcript. Closing a tab does not drop a session: it stays in the database, marked closed, its row stays in the sidebar, and Ctrl+Shift+T brings the newest one back — anything older is one ask away. A tab that never said anything is the exception, and goes. A file SQLite cannot read is moved aside as cia.db.bad and the app starts with an empty one: losing your history should not stop the app from starting.

What startup reads is the sessions table: names, models, agent ids, a row per session. A session's log is read on the store's own thread when its tab is first drawn, and records reach the database as they are made, folded (a streamed message is one record, and so is a running tool call's progress) and written once a second. The switcher's search over every transcript is the database's FTS5 index, with the trigram tokenizer, so a phrase is found inside a word as well as at the start of one.

A string longer than 64 KiB in a record (a tool's megabyte of output) is written whole to a file under cia.blobs/ beside the database, and the record keeps its first and last 16 KiB with a line between them that names the file.

One session's log is sqlite3 ~/.local/state/cia/cia.db "select body from records where session = 's3' order by seq". Copy Session Information writes that line out with the session's own id, next to the facts that say which session it is.

The first launch after the upgrade from sessions.json imports it into the database while the window shows how far it has got, then keeps the file as sessions.json.bak; delete that once the sessions are where you expect them. The import is one transaction: quitting in the middle of it leaves the file where it was, and the next launch starts it again.

--state=PATH points the app at a different database, which is what development runs and screenshots use so they do not reopen real sessions. A .json path is an old session file, imported into a database beside it.

Tool call commands are put through shfmt before they are shown, so their indentation is right and long lines break at their operators. It is optional: without shfmt on PATH the preference is disabled and commands appear exactly as the agent wrote them.

--agent takes any ACP command, with the default being pi-acp here.

The adapter is built by this flake (nix build .#pi-acp) rather than run through npx, because npx resolves pi-acp@latest against the registry in ~/.npmrc first and never execs anything while that request is outstanding. Where pi itself comes from is left alone: the adapter spawns pi --mode rpc through a PATH lookup, and PI_ACP_PI_COMMAND names it explicitly when the PATH does not.

To look at the interface without an agent at all, --demo opens a gallery of every widget variant — each markdown block, tool call status, permission card and note level:

cargo run -- --demo        # add --demo=N to open a particular tab

To watch a run happen, --fake runs the real window against a scripted agent — a separate process speaking the protocol, streaming reasoning and tool calls one step at a time, and playing the next scene on every prompt: a turn of seven steps, a turn of one, a turn that asks permission, a turn with more output than a line holds. Nothing to install but python3, and its transcript goes to the cache rather than the state directory, dropped at launch so each run starts clean:

cargo run -- --fake          # --fake=250 paces the steps, in milliseconds

For volume there is a separate DeepSeek-shaped fake, --fake-deepseek[=TOKENS/S]. It streams a 24,000-token answer at 900 tok/s by default, alternating reasoning, prose sections and tool calls (bash, read, and a codemode script with nested calls), and reports usage as it goes. Its rate is the flag's value; the script at crates/cia/assets/fake-deepseek.py also takes --tokens and --chunk, and reports the rate it was given:

cargo run -- --fake-deepseek=1200
python3 crates/cia/assets/fake-deepseek.py --rate 1200 --tokens 24000 --chunk 40

--perf is the frame-rate measurement. A GTK window does not choose its frame rate: the compositor decides when a surface may present, and the window's frame clock follows that decision, so what the app can lose is the interval rather than the setting. The flag names the renderer and the monitor's mode once, then prints a line per window per second while frames are being drawn: how many were painted, how many the clock expected in that second, how many were dropped, and how late the last one reached the screen. Read it while something is moving, since a window with nothing to draw asks for no frames and correctly reports none:

cargo run -- --perf --fake-deepseek=4000

What the transcript draws is a frame's worth of chunks rather than a chunk at a time, which is what keeps the paint at the display's pace when the agent streams faster than any display shows. With RUST_LOG=cia=debug each draw says how many chunks it stood in for.

Capturing a screenshot does not have to take over the screen. Give the run a compositor of its own and no session bus, and neither its window nor the single-instance handshake reaches the desktop:

printf '[core]\nidle-time=0\n\n[output]\nname=headless\nmode=1400x1000\n' > /tmp/weston.ini
weston -B headless --renderer=pixman -S wl-headless -c /tmp/weston.ini & sleep 2
GDK_BACKEND=wayland WAYLAND_DISPLAY=wl-headless \
DBUS_SESSION_BUS_ADDRESS=unix:path=/nonexistent \
  cargo run -- --demo --screenshot-dir=/tmp/shots
kill %1

Wayland, because that is the backend the app really runs on. GDK_BACKEND has to be pinned either way: GDK's backend order is wayland,x11, so with nothing pinned the run picks the session out of the environment and the window lands on your desktop — the socket name alone does not save you. --renderer=pixman is weston's software renderer, since a headless compositor has no GPU to give. The GTK-side VK_ERROR_SURFACE_LOST_KHR warnings are its Vulkan renderer probing that compositor, and are as harmless as the measurement warnings.

To rule Wayland out instead, Xvfb is the other direction: Xvfb :99 -screen 0 1600x1000x24 -nolisten tcp & sleep 1, then GDK_BACKEND=x11 DISPLAY=:99 …; while it runs, xlsclients -display :99 lists it.

The Unable to acquire session bus warning is the point rather than a problem: GApplication cannot register, so the run draws its own window instead of activating the copy already on screen. Add --state=/tmp/cia-dev.json when what is captured is the real window rather than the gallery, and it will not reopen your sessions.

--scripted, --auto-approve, --screenshot-dir, --screenshot-delay and --perf exist for smoke runs and measurements; they are not user features. RUST_LOG=cia=debug,cia_core=debug shows what the app and the connection are doing.

Testing #

cargo nextest run is the runner, configured by .config/nextest.toml: a per-test timeout of 60 seconds, so an agent that stops answering fails its test instead of hanging the suite.

nix flake check path:. runs that same suite in the sandbox, under the same configuration file, with python3 for the stub agent and the SVG loader for the agent's mark in its environment. Clippy runs with --all-targets -- --deny warnings, rustfmt runs as a gate, and both are separate checks so a lint blocks CI without breaking someone's ability to build the app.

Tests that need a display or a session bus are marked #[ignore] rather than filtered out, so plain cargo test still lists them. Run them on request:

cargo nextest run --run-ignored ignored-only --no-tests=pass

nextest does not run doctests. When there are any, they need cargo test --doc.

Pushing #

The repository is SHA-256, because the knot that hosts it accepts nothing else — a SHA-1 repo is rejected with "the receiving end does not support this repository's hash algorithm". jj git init --object-hash sha256 is the flag to remember if this repo is ever created again; jj cannot change the hash of an existing repo, and converting one means git fast-export into a fresh SHA-256 repository.

Nix 2.35's Git fetcher still expects SHA-1 for a git+file input, so a flake referenced as . fails with hash ... has wrong length for hash algorithm 'sha1' as soon as a new SHA-256 commit invalidates nix-direnv's cache. path:$PWD avoids that but hands Nix the entire checkout, including the 9 GB target/ directory. .envrc therefore exports the tracked and non-ignored working files into a small cache directory keyed by HEAD and the dirty state, and evaluates that path. It is about 700 KB, contains no target/, and never asks the Git fetcher to parse the SHA-256 commit. Run direnv allow after changing .envrc; subsequent flake.nix edits produce a new cache key.

Pushes authenticate over HTTPS with an atproto service token minted by git-credential-tangled from an OAuth session in the keyring:

$ git push origin main          # the first push, for the browser login
$ jj git push -b main           # every one after that

The first push has to go through git. The helper only opens a browser when stderr is a terminal, and jj captures its git subprocess's stderr, so through jj it falls back to asking for an app password. Once the session is stored, jj git push mints tokens silently.

Dependencies #

cargo deny check answers four questions about the tree at once — known advisories, duplicate or wildcarded versions, licences, and where each crate comes from — using the policy in deny.toml. Anything the policy does not allow fails the check, so adding a dependency is a visible diff instead of a silent one:

cargo deny check        # advisories, bans, licences, sources
cargo deny check bans   # just duplicate and wildcarded versions

nix flake check covers the same ground in the sandbox: checks.deny for bans, licences and sources, and checks.audit for advisories against the advisory-db flake input — vendoring the database as an input is the only way that half runs without a network.

deny.toml names the few duplicates that are already in the graph, each with the reason it exists — gtk-rs's split system-deps generation, and the syn 2/3 split between proc-macro crates. Both are build-time only. Anything else is an error, so a duplicate we introduce ourselves fails the check instead of quietly costing build time.

Compatible agents #

Any agent that implements ACP protocol v1 works. The public ACP registry is the list to trust — it is verified in CI, and it moves faster than any table copied into a README.

Remote agents #

An agent on another machine is the same stdio command with ssh in front of it. There is no separate network transport in cia, and nothing to install on the far side but the agent: ssh is the transport, and its sign-in is ssh's. A session says where it runs in rsync's spelling, so this is a session in /home/hbooth/cia on hbooth@2313:

cargo run -- --cwd=hbooth@2313:/home/hbooth/cia

Every agent the window can start then starts there. A folder picked from a dialog starts one here again: the host belongs to the directory a session runs in, not to the agent's name.

Hosts worth naming live in ~/.config/cia/settings.json, which is where the arguments belong that ssh needs and an address does not carry:

{
  "hosts": [
    {
      "name": "devbox",
      "address": "hbooth@devbox.example",
      "options": ["-o", "ProxyJump=bastion"]
    }
  ]
}

name is for the row and the settings pane; a session records the address, so renaming a host does not orphan the sessions started on it, and an address the file no longer lists still works. options go in front of the ones cia adds itself — BatchMode=yes, because there is no terminal for a passphrase prompt to appear on, a connect timeout, keepalives so a link that dropped is noticed rather than waited on, and -T, because a pty would translate the line endings of the JSON.

Three things the app does about a host that is not there:

  • Before anything is spawned, the host is asked command -v <program> over the same ssh the session will use. A missing agent is a sentence naming the machine, not a handshake that never finishes.
  • A host that does not answer is offline, not failed: one retry three seconds later, then the row says Offline with a mark beside it, the banner names the reason, and Retry is there for when the machine is back. The session is intact throughout, which is the difference. A link that drops under a running session is offline in the same way, and an offline session tries again by itself when the network comes back.
  • Sessions are filed under host:directory, ordered by machine and then by directory, so each machine's sessions sit together.

The caveat: files on the far side. cia does not read them. A tool call's paths are drawn from what the agent reports, and nothing follows them; so a remote session looks complete — the transcript, the tool output and the diffs the agent sends all arrive over the same pipe — but anything that opens a file beside the transcript will work locally only, until it learns to ask the host. The directory in the settings pane is a name in the same way: recorded, not browsable.

A network transport of cia's own, and ACP's authenticate on a remote host, are still open.

Codex over Baseten #

Codex speaks ACP through @agentclientprotocol/codex-acp. codex-acp-baseten is a thin launcher that keeps the Codex binary on this flake's pinned nixpkgs-unstable (0.169.0), not the system nixpkgs-weekly, and points it at the Model Gateway. Codex only speaks the Responses API — it refuses wire_api = "chat" while loading its config — and the guarded gateway route serves the managed Baseten models on chat completions, so that route 404s on every turn. The launcher uses the gateway's managed passthrough instead, /baseten/managed/v1, which forwards verbatim to Baseten's Responses API and injects the Netflix-managed Baseten key: there is no Baseten key to hold here. It is experimental and carries no rate limiting and no cost attribution, so leave other traffic on the guarded route.

The launcher takes the project id header from ~/.pi/agent/models-netflix.json, so no copy of that config is committed here; CODEX_BASETEN_BASE_URL, CODEX_BASETEN_API_KEY and CODEX_BASETEN_HEADERS override it. Slugs are Baseten's own (moonshotai/Kimi-K3), not the gateway's routing form, and a baseten/ prefix is stripped from CODEX_MODEL. The default model is deepseek-ai/DeepSeek-V4.1-Flash-1017.

Inside the development shell:

nix develop path:.
cargo run -- --agent=codex-acp-baseten --name=codex-baseten

Or install the launcher once and use it from any shell:

nix profile install .#codex-acp-baseten
cargo run -- --agent=codex-acp-baseten --name=codex-baseten

The generated Codex home is $XDG_CACHE_HOME/cia/codex-baseten (usually ~/.cache/cia/codex-baseten), holding config.toml and the generated model_catalog.json. The Baseten provider is the only provider configured.

Codex never asks a provider which models it serves: its selector is fed by a catalog compiled into the binary, plus model_catalog_json, which replaces it (codex debug models --bundled prints the bundled one). The launcher writes a catalog from the gateway's own model list, ~/.pi/agent/nflx-gateway-catalog.json (PI_GATEWAY_CATALOG overrides it), skipping deprecated models and dedicated-deployment aliases, so every managed Baseten model is selectable. Each entry clones a bundled model, because base_instructions is required, then narrows it to the request shape the passthrough accepts: support_verbosity off, since Codex would otherwise send text.verbosity and the request is rejected, and the freeform apply_patch tool dropped, since chat-trained models get its payload shape wrong — file edits go through the shell tool.

Roadmap #

License #

MIT OR Apache-2.0, the Rust ecosystem default. Confirm before the first release.