feat(codex): agentbox install codex — install + enable the Codex plugin#121
Conversation
…ugin Installing agentbox left the Codex plugin (the `agentbox`/`agentbox-info` skills) a manual chore: `codex plugin marketplace add` + `codex plugin add`, then a toggle in the Codex app. Automate all three. New `install-codex.ts` (mirrors install-herdr.ts), gated on Codex being present (~/.codex + `codex` on PATH), best-effort so it never aborts `agentbox install`: - `codex plugin marketplace add madarco/agentbox` + `codex plugin add agentbox@agentbox` - enable by default: append `[plugins."agentbox@agentbox"] enabled = true` to ~/.codex/config.toml when no such table exists. Codex has no `plugin enable` CLI — this is the same key the TUI toggle writes. Robustness: - Skips the network re-add when already installed (codex plugin add re-enables a deliberately-disabled plugin), so a user's explicit disable is respected; --force bypasses to re-enable. - The config write only appends when the key is absent — never duplicates the table (a second table is a TOML parse error) and respects enabled = false. Wired into the `agentbox install` wizard (runs when Codex is detected) and a standalone `agentbox install codex`. Adds smol-toml to apps/cli (read-only parse for the presence check). Unit tests cover the upsert/respect-disable logic; e2e verified against codex 0.142 (fresh -> enabled, disabled re-run -> stays off, --force -> re-enabled). Docs: cli.mdx + plugin README. Claude-Session: https://claude.ai/code/session_01PTY4KwAeZdAVvgSWxjpYfs
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b9a98fe. Configure here.
| result.enableStatus = status; | ||
| if (status === 'added' && text !== existing) { | ||
| mkdirSync(dirname(cfgPath), { recursive: true }); | ||
| writeFileSync(cfgPath, text); |
There was a problem hiding this comment.
Config cleanup not written
High Severity
installCodexPlugin only writes config.toml when enableStatus is added, but upsertCodexPluginEnable can return different text for user-enabled or user-disabled after stripping a stale managed block. Those fixes never hit disk, so duplicate plugins."agentbox@agentbox" tables can remain and break TOML parsing for Codex.
Reviewed by Cursor Bugbot for commit b9a98fe. Configure here.
| `AgentBox Codex plugin is present but disabled in ${cfgPath} — leaving it off. ` + | ||
| `Enable it in Codex (or set enabled = true) to use it.`, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Force skips config re-enable
Medium Severity
--force is described as re-applying the managed enable block and bypassing a deliberate disable, but opts.force only skips the “already installed” guard for codex plugin add. The enable step always calls upsertCodexPluginEnable without force, so an explicit enabled = false table is never overridden and the flag cannot re-enable via config as documented.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b9a98fe. Configure here.
|
|
||
| const head = stripped.replace(/\s+$/, ''); | ||
| const text = (head.length > 0 ? `${head}\n\n` : '') + codexPluginEnableBlock() + '\n'; | ||
| return { text, status: 'added' }; |
There was a problem hiding this comment.
Managed disable stripped away
Medium Severity
upsertCodexPluginEnable strips the managed block before parsing, so turning the plugin off by setting enabled = false inside that block is erased. A later install sees no plugin table and appends a fresh managed block with enabled = true, undoing the user’s disable.
Reviewed by Cursor Bugbot for commit b9a98fe. Configure here.
Addresses the CI failure and Cursor Bugbot findings on the enable step: - commands.test.ts asserted the exact `install` subcommand list — add `codex`. - The managed-block approach conflicted with the `[plugins."agentbox@agentbox"]` table Codex itself writes (`plugin add` / TUI toggle): a second table is a TOML parse error, and the strip+regenerate path could (a) leave a stale duplicate unwritten and (b) override a disable set inside the block. Replace it: parse config.toml read-only and - append a plain `[plugins."agentbox@agentbox"] enabled = true` table only when the key is ABSENT (Codex usually writes it itself on `plugin add`); - respect a present value (enabled defaults true; only explicit `false` is off); - with --force, flip a disabled entry to true via a targeted in-place line edit that preserves the rest of the file (comments/order/formatting). Always write when the text changed (fixes the "cleanup not written" gap). E2E re-verified vs codex 0.142: fresh -> enabled; disabled re-run -> stays off with comments preserved; --force -> re-enabled, file still single-table valid TOML. Claude-Session: https://claude.ai/code/session_01PTY4KwAeZdAVvgSWxjpYfs
|
All three findings fixed in 2ee88f3 by dropping the managed-block approach (it conflicted with the
Also fixed the CI failure ( bugbot run |


What
Installing AgentBox left the Codex plugin (the
agentbox/agentbox-infoskills that drive AgentBox from Codex) a manual chore:codex plugin marketplace add+codex plugin add, then enabling it in the Codex app. This automates all three so it's installed and enabled by default.How
New
apps/cli/src/commands/install-codex.ts(mirrorsinstall-herdr.ts), gated on Codex being present (~/.codex+codexon PATH), best-effort so it never abortsagentbox install:codex plugin marketplace add madarco/agentbox(writes[marketplaces.agentbox])codex plugin add agentbox@agentbox(downloads the bundle)[plugins."agentbox@agentbox"] enabled = trueto~/.codex/config.tomlwhen no such table exists. Codex has noplugin enableCLI — this is the exact key the TUI toggle writes (verified inopenai/codexsource).Wired into the
agentbox installwizard (runs when Codex is detected) and a standaloneagentbox install codex.Robustness
codex plugin addre-enables a deliberately-disabled plugin), and the config write only appends when the key is absent — soenabled = falseis honored.--forcebypasses to re-enable.config.toml: appends a delimited managed block only when noplugins."agentbox@agentbox"table exists (a duplicate table is a TOML parse error); a malformed config is left untouched.smol-tomlis used read-only for the presence check.Verification
CODEX_HOME): fresh → installed + enabled; user-disabled + re-run → stays disabled;--force→ re-enabled.codex plugin listshowsinstalled, enabled.pnpm lint,pnpm check:plugin-skill, build all green.Docs:
cli.mdxinstall section +plugins/agentbox/README.md.https://claude.ai/code/session_01PTY4KwAeZdAVvgSWxjpYfs
Note
Low Risk
Changes only local Codex config and best-effort CLI subprocesses; writes are guarded by parse checks and explicit user disable, and failures do not abort
agentbox install.Overview
Adds
agentbox install codexand runs the same flow automatically duringagentbox installwhen Codex is present (~/.codexand thecodexCLI on PATH).The new command registers the
madarco/agentboxmarketplace, runscodex plugin add agentbox@agentbox, and turns the plugin on by appending a delimited managed block to~/.codex/config.tomlwhen no existingplugins."agentbox@agentbox"table is there. Re-runs skipplugin addif already installed (so a deliberate disable is not undone); user/TUIenabled = falseis honored; malformed TOML is left unchanged.smol-tomlis added for read-only presence checks, with unit tests for the upsert logic.Docs in
cli.mdxandplugins/agentbox/README.mddescribe the one-command install path.Reviewed by Cursor Bugbot for commit b9a98fe. Configure here.