[codex] fix install.sh validators: optional peer header + parenthesized plugin list state#2632
Open
ZaynJarvis wants to merge 1 commit into
Open
[codex] fix install.sh validators: optional peer header + parenthesized plugin list state#2632ZaynJarvis wants to merge 1 commit into
ZaynJarvis wants to merge 1 commit into
Conversation
…in list state Two false-positive validations surfaced when re-running the installer on a no-peer config after #2598 merged: 1. cached .mcp.json validator unconditionally required the X-OpenViking-Actor-Peer mapping. Since syncMcpConfig now omits that header when no peer is configured (#2598 commit 216dbb5), the validator failed every no-peer install. Make it conditional, and symmetrically flag a stale header when no peer is configured (the same way bearer_token_env_var handles HAS_API_KEY both ways). 2. 'codex plugin list' validator grep expected '<id> installed, enabled' but codex CLI actually prints '<id> (installed, enabled)' with parens. Loosen the regex to accept both forms. - ov-credentials.mjs gains a 'has-peer-id' CLI command symmetric to 'has-api-key', so install.sh can detect peer presence via the same resolver used at render time. Underlying peerId resolution is already covered by ov-credentials.test.mjs cases 1, 2, and 3. - install.sh detects HAS_PEER_ID, mirrors the bearer pattern at the validator, and makes the codex-plugin-list regex tolerate the parenthesized state form. Verified by re-running setup-helper/install.sh non-interactively against the no-peer ovcli.conf: 'Plugin install looks valid.' now prints with no warnings. Hand-traced both HAS_PEER_ID branches of the new validator (peer-configured / peer-absent, header-present / header-absent) to confirm the four cases behave correctly.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
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.
Problem
Re-running
setup-helper/install.shnon-interactively after #2598 surfaces two false-positive validator warnings on a no-peer config (e.g. local unauth OV):Both are validator bugs, not actual install regressions —
codex plugin listshows the plugin as installed, enabled and the cached.mcp.jsonis correct.Root cause
Actor-peer validator unconditional. [codex] tighten memory recall, capture, and resume #2598 commit 216dbb5 made
syncMcpConfigomit theX-OpenViking-Actor-Peerheader when no peer is configured (symmetric tobearer_token_env_var/HAS_API_KEY). The install validator atinstall.sh:613still required the header unconditionally, so every no-peer install gets flagged.codex plugin listregex too strict. The validator grep atinstall.sh:591was${PLUGIN_ID}[[:space:]]+installed, enabled, but codex CLI printsopenviking-memory@openviking-plugins-local (installed, enabled)with parens. The regex never matches the current CLI output. This is older brittleness (not a [codex] tighten memory recall, capture, and resume #2598 regression) and surfaces now because the actor-peer false-positive ran the validator long enough to notice.Fix
ov-credentials.mjs: newhas-peer-idCLI command, symmetric tohas-api-key. Returns1/0based onresolveOpenVikingCredentials().peerId. Underlying resolution is already covered by existing tests 1–3 inov-credentials.test.mjs.install.sh: newHAS_PEER_ID="$(detect_peer_id)"mirrorsHAS_API_KEY. Validator becomes conditional both ways:HAS_PEER_ID=1+ header missing → flag (required header dropped)HAS_PEER_ID=0+ header present → flag (stale header, should be dropped)install.shplugin list regex: relaxed to\(?installed, enabled\)?to accept both the parenthesized and bare forms codex CLI has shipped at different points.Verification
Hand-traced both
HAS_PEER_IDbranches × bothX-OpenViking-Actor-Peerpresence states to confirm the four-case truth table.Follow-up direction (out of scope)
@ZaynJarvis suggested the longer-term home is
openviking@openai-curatedrather than the self-hostedopenviking-plugins-localmarketplace. That requires upstream coordination with codex's curated marketplace and is not part of this validator fix.