Skip to content

test(codex): CI contract for install/uninstall + credential flow#166

Open
GuyMoses wants to merge 2 commits into
sig-171-m3-codex-install-hook-trustfrom
sig-171-codex-install-contract
Open

test(codex): CI contract for install/uninstall + credential flow#166
GuyMoses wants to merge 2 commits into
sig-171-m3-codex-install-hook-trustfrom
sig-171-codex-install-contract

Conversation

@GuyMoses

@GuyMoses GuyMoses commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Stacked on #165 (M3). Adds CI + test coverage for the Codex install path, which previously had none.

What's covered

Offline contracts in the install-config-contract job (mirror Cursor's D/E/F, no live Codex / API):

  • G — config-file and env-var credentials both reach a real OTLP request through codex-on-event.sh.
  • Hinstall-codex.sh appends the managed block + 10 [hooks.state] pre-trust entries to config.toml, preserving a pre-existing user hook + setting (real tomllib parse).
  • Iuninstall-codex.sh strips only the managed block; user content survives.

Live end-to-end in the e2e job — TestE2EFullFlowWithCodex now runs the real install-codex.sh against a hermetic HOME/XDG_STATE_HOME, then drives live Codex with no --dangerously-bypass-hook-trust against what the installer produced. One test spans installer → config.toml merge + pre-trust → live Codex → OTLP, so a break anywhere (merge, trust hash, hook contract) fails here. Verified locally: install skips the download (pre-staged binary), registers + pre-trusts, connectivity passes, then 3 spans (chat + 2 tools) land with no bypass.

Installer change

install-codex.sh now skips the binary/bootstrap download when already present — a real idempotency win, and what lets both Contract H and the e2e pre-stage a locally-built binary and run the merge without a published release (Codex has none until M4, SIG-172).

The contracts are deterministic and API-free (always run); the e2e adds live trust-acceptance proof (needs OPENAI_API_KEY, which is set — the job is green). Together they cover install, uninstall, credential flow, and live trust.

SIG-171

Add Codex Contracts G/H/I to the install-config-contract job, mirroring
the Cursor ones (D/E/F) — the Codex install scripts previously had zero CI
coverage:
  G: config-file AND env-var credentials both reach a real OTLP request
     through codex-on-event.sh.
  H: install-codex.sh appends the managed block + 10 [hooks.state] pre-trust
     entries to config.toml, preserving a user-authored hook and setting
     (asserted with a real TOML parser).
  I: uninstall-codex.sh strips only the managed block, leaving user content.

install-codex.sh now skips the binary/bootstrap download when they're
already present — a real idempotency improvement that also lets Contract H
pre-stage a locally-built binary and run the merge without a release (Codex
has none until M4). Validated locally end-to-end.

SIG-171

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GuyMoses GuyMoses requested a review from a team as a code owner July 12, 2026 15:25
@github-actions

Copy link
Copy Markdown



Thank you for your submission - we really appreciate it ❤️. We kindly ask that you sign a Contributor License Agreement before we can accept your contribution.

You can sign the CLA by posting a pull request comment containing the same as the text below.

If you are contributing on behalf of a company, the company should contact us to sign a Corporate Contributor License Agreement, via hi@dash0.com.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Instead of calling emit-codex-hooks directly, TestE2EFullFlowWithCodex now
runs the real install-codex.sh against a hermetic HOME + XDG_STATE_HOME
(binary + bootstrap pre-staged so the not-yet-published release download is
skipped), then drives live Codex with no bypass against what the installer
produced. One test now covers the whole path — installer → config.toml
merge + pre-trust → live Codex → OTLP — so a break anywhere surfaces here.

Removes the writeCodexHooksTrusted shim in favor of installCodex +
codexPluginVersion/unameOSArch helpers.

SIG-171

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant