Skip to content

fix(codex): preserve ambiguous legacy runtime pins - #601

Open
luvs01 wants to merge 3 commits into
devfrom
codex/fix-legacy-doctor-pins-auto-discovery-issue
Open

luvs01 wants to merge 3 commits into
devfrom
codex/fix-legacy-doctor-pins-auto-discovery-issue

Conversation

@luvs01

@luvs01 luvs01 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Legacy persisted codex-runtime.json files created before origin existed are ambiguous because both automatic discovery and doctor --fix-codex-runtime once wrote that shape.
  • The previous logic treated absent origin as unpinned and allowed an automatic handover that could silently replace an operator-selected runtime.

Description

  • Change provenance semantics so only records with origin: "discovered" are eligible for automatic replacement while ambiguous (origin-less) records are conservatively treated as pinned by default; see src/codex/runtime.ts updates.
  • Backfill migration: when a persisted record exactly matches the resolved selection, write it out as origin: "pinned" instead of discovered so legacy operator choices are preserved; implemented in resolveAndPersistCodexRuntime.
  • Update tests in tests/codex-integration/codex-runtime.test.ts to assert the conservative handling, and add a short doc note in structure/runtime.md describing the provenance/migration contract.

Testing

  • Ran bun run typecheck and it succeeded.
  • Ran the focused runtime integration suite with npx -y bun@latest test tests/codex-integration/codex-runtime.test.ts and all tests passed (59 pass, 0 fail).
  • Ran npx -y bun@latest run structure:check and npx -y bun@latest run privacy:scan and both succeeded.
  • Verified git diff --check; no whitespace or check failures were reported.
  • Note: bun test with the environment's bundled Bun (1.2.14) produced an unrelated zlib export error, so the focused test run used npx bun@latest as documented above; bun run test:changed could not run because this checkout lacks a dev comparison ref.

Codex Task


Devin Review

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 603a5b2d-ce83-42e2-819b-4f3ab082910b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T02:38:15.445369Z 45321a2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 21, 2026
Co-Authored-By: Epinephrine <luvs01@hanmail.net>
@devin-ai-integration

Copy link
Copy Markdown

Fixed in 57cc744 — the CodexRuntimePinOrigin doc now describes absent origin as ambiguous legacy state (written by both discovery and doctor --fix-codex-runtime) that is read conservatively as a possible pin, matching persistedCodexRuntimeIsPinned.

@devin-ai-integration

Copy link
Copy Markdown

Fixed in 57cc744 — provenance now follows the command, not observed metadata: while the persisted command stays selected, pinned and origin-less records stay "pinned" even when the binary is upgraded in place or the stored source normalizes to configured. "discovered" is written only when a different command is selected or the prior record was already discovered. Regression tests cover explicit pins and origin-less records across in-place version bumps, plus stored-source normalization.

@devin-ai-integration

Copy link
Copy Markdown

Fixed in 57cc744 — the migrated origin is now derived from whether the persisted command remained selected, independent of source/version changes; structure/runtime.md was updated to state that in-place upgrades and source normalization do not demote a pin, and new tests cover the resolveAndPersist path end to end.

…budget

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant