Self-update the Codex plugin from SessionStart (PRDE-1161) - #8
Merged
Kshitij Jhunjhunwala (KJ-11) merged 1 commit intoJul 29, 2026
Merged
Conversation
…RDE-1161) Port of composio-plugin-cc#10 to the Codex update chain: codex plugin marketplace upgrade + re-add (idempotent), throttled to once per 24h via ~/.composio/plugin-codex-self-update.json, fully detached so the 8s JSON-stdout hook contract is never at risk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A stale installed Composio Codex plugin now converges to the latest published version within a day plus one session restart, with zero user or Composio CLI involvement.
Linear: PRDE-1161
Claude Code source implementation/review: composio-plugin-cc#10
How
At most once per 24h, the SessionStart hook launches a fully detached, fd-silenced job that runs:
codex plugin marketplace upgrade composiocodex plugin add composio@composio --jsonThe re-add is idempotent and installs the newest marketplace snapshot for the next session. State is isolated from Claude Code at
~/.composio/plugin-codex-self-update.json. The state is stamped before network work, doubling as a best-effort throttle lock.The hook contract remains unchanged: this repo registers
SessionStartwith an 8s timeout and expects JSON on stdout. The updater is never waited on and redirects stdin/stdout/stderr.plugins/composio/.codex-plugin/plugin.jsonis bumped 0.2.2 → 0.2.3; the existing CI version-bump gate covers the change.Verification
Installed CLI:
codex-cli 0.144.5. Its help confirmsmarketplace upgrade [MARKETPLACE_NAME]refreshes Git snapshots andplugin add PLUGIN@MARKETPLACE --jsoninstalls from the configured snapshot.All Codex operations used
CODEX_HOME=/tmp/prde-1161-codex-home-e2e; the real Codex config was untouched.CODEX_HOMEwas premise-checked first (marketplace list --jsonreturned an empty isolated config and subsequent files/config appeared only under that path).End-to-end convergence ladder:
codex plugin add composio@composio --json; Codex reported 0.2.3 installed under the isolated home.session-start.shwith isolatedHOMEandCODEX_HOME. It emitted valid SessionStart JSON and exited in 0.93s. After the hook process exited, the detached job completed with{"lastAttempt":1785357497,"lastResult":"updated"}.codex plugin list --jsonreported installed version 0.2.4 from the refreshed isolated Git marketplace.Adversarial battery (each hook invocation exited 0 and emitted valid JSON):
codexonPATH: no state file or attempt~/.composio: silent no-oplastResult:"error", installed version untouchedChecks:
bash -n plugins/composio/hooks/session-start.sh plugins/composio/hooks/user-prompt-submit.shpython3 -m unittest discover -s tests -v— 12 passedbash scripts/check-version-bump.sh origin/main— 0.2.2 → 0.2.3 acceptedBootstrap caveat: installations older than 0.2.3 do not contain the self-updater and require one manual setup/upgrade to enter the convergent path.