feat: ship Agent Foundry as a Codex plugin #271
No reviewers
Labels
No labels
bug
cannot reproduce
duplicate
enhancement
help wanted
invalid
need info
need triage
need verification
not a bug
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
claudiomaradonna/agent-foundry!271
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/codex-plugin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
#269 and #270 gave OpenCode and Claude Code a form of Agent Foundry loaded from outside the repository, so a newer source reaches every repository without a
foundry-upgradein each one. This adds the same for Codex. Codex differs in ways that matter:Codex can read the Claude Code plugin's files, but only through a path it calls legacy-compatible, so Codex gets a target and a branch of its own, in its native layout.
Refs #268
What changed
scripts/build-form.sh codex <commit> <folder>builds a Codex marketplace,dumbledore, in Codex's native layout:.agents/plugins/marketplace.json;dumbledorewith.codex-plugin/plugin.json, whoseversionis the commit;hooks/hooks.json, wiring the main-checkout guard and the shell check onapply_patch, and one SessionStart hook withadditionalContextLimit: 0.The SessionStart hook hands over the whole policy in one message, with where the plugin sits and how Codex names its skills (
dumbledore:<name>). Codex runs it again after a compaction.Beside the plugin,
codex-agents/*.tomlholds the seven subagents, each with its brief inlined, for the operator to copy into~/.codex/agents/:features.pluginson, so the guard and the shell check run in them. The reviewers keep plugins off, which keeps them away from other plugins' tools while they read untrusted text.scripts/publish-form.shnow takes the target, and the Maintenance workflow'spublishjob publishesclaude-plugin, thencodex-plugin. The section "Plugin for Codex" ofdocs/INSTALL.mdcovers installing, trusting, copying the subagents, updating, and checking the plugin.How to verify
Needs Codex 0.173.0 (
npm install -g @openai/codex@0.173.0), signed in, plusjqandsha256sum. Branch tip7d92842, basemainat1e6bc53.In a scratch repository holding only a README and a git-ignored
AGENTS.local.mdwith a Test command, run:Then trust the three hooks in
/hooksand start a new session.Ask "Without running any command, quote the first bullet of the section Working with the user." The answer starts "Material decisions, such as product, architecture, and stack choices".
Run on 2026-12-02 with Codex 0.173.0, signed in with ChatGPT, in a scratch
CODEX_HOME, these gave the expected results:dumbledore:<name>, withoutfoundry-upgrade;apply_patchin the main checkout;echo $2showed ShellCheck's SC2086;AGENTS.local.md;codex plugin marketplace upgradeupdated a Git marketplace served from a local bare repository, and a secondcodex plugin addupdated a local one.On the tip,
tests/verify-agent-config.shpassed 427 tests:build-form.sh53, with new tests for thecodextarget;publish-form.sh12, with new tests forcodex-plugin.tests/check-work-folder.shpassed 46, and ShellCheck, prettier, the static validator, andgit diff --check mainalso pass. The new tests fail onmainat thecodextarget name, or at the target argument ofpublish-form.sh, both of which this branch adds.Considerations
/hooks. Until then a session runs without the policy, the guard, and the shell check.docs/INSTALL.mdsays so.publishjob has not run with thecodextarget on the forge yet; its first push tomainafter the merge createscodex-plugin.https://claude.ai/code/session_012wUN2eKSj9s2vRHJdFPNk3