fix(codex): stable Codex runtime selection for sync/clamp (#297)#359
Conversation
Keep catalog probing and effort clamping on one persisted runtime so PATH cannot silently downgrade away max/ultra.
This comment was marked as resolved.
This comment was marked as resolved.
…lean Reject unparseable --version output, stop v2 from bypassing validation, avoid false replacedConfigured when env matches persisted, and keep settings probes off the hot PATH scan.
Numeric prerelease compare, redact probe failures, mkdir before persist, safer doctor --fix when CODEX_CLI_PATH wins, and localized Startup runtime warnings with complete sync remediation.
Follow-up after CodeRabbit / Codex reviewPushed
Skipped / deferred:
|
Remove the implementation plan from the PR, restore newerAvailable on /api/settings via memoized full resolve, correlate clamp diagnostics to the active runtime, and isolate v2 invocation test state.
|
Removed Addressed the latest unresolved CodeRabbit threads:
|
…er compare Add first-write directory regression tests, return persistError from resolveAndPersistCodexRuntime, and compare hyphenated prerelease identifiers with deterministic code-unit ordering.
Dual review (security + bugs/edge cases)Bot review threads are already cleared (0 unresolved). CI is green. Independent second look below — several earlier bot findings were fixed; a few concrete leftovers remain. Security categories checkedNo malware, backdoor, hidden C2, admission bypass, or classic XSS. Runtime selection persists under Blockers / should-fix
Non-blocking / already in good shape
Suggested fix order
|
Route .cmd/.bat probes through commandInvocation instead of shell:true, forward BundledCatalogDeps into the runtime resolver, and cover /api/settings codexRuntime shape.
Pass configDir into persistEffortClamp, expose catalogClamp.runtimeVersion in status JSON, memoize i18n t to avoid Startup refresh loops, and harden settings clamp-correlation coverage.
|
Addressed the latest CodeRabbit batch (2 inline + 2 outside-diff) in 6879d15:
Tests: |
Dual review (security + bugs/edge cases) — re-review @ 6879d15Prior High blockers from the last dual review look fixed ( SecurityVerdict: merge-ready for security (no blockers). Checked:
Non-blocking: bare / non-absolute Bugs / #297 goalVerdict: not fully merge-ready — one remaining should-fix for the in-process remediation path. Should-fix
Residual / follow-ups (non-blocking)
What looks solid
Bottom line: security OK to merge; for #297, fix (or deliberately document + invalidate on sync) the 60s bundled-catalog cache before calling the GUI remediation path done. |
…w-ups Bust resolve/catalog memos when persisted selection changes so dashboard /api/sync does not keep clamping after doctor --fix. Also track default effort clamps, forward full resolver deps, and harden related tests.
|
Addressed the re-review P1 + latest CodeRabbit batch in 716f39c: Cache / #297 remediation
CodeRabbit
Tests + typecheck green on the touched suites. |
Summary
ResolvedCodexRuntimeresolver (env → configured → shim → PATH → fallback) with--versionvalidation and persistence incodex-runtime.json.ocx v2features use that same runtime so sync cannot silently pick an older PATH binary and stripmax/ultra.ocx status,ocx doctor(including optional--fix-codex-runtime), sync logs, and the Startup dashboard warning.Test plan
bun test tests/codex-runtime.test.tsbun test tests/cli-status-json.test.tsbun test tests/doctor.test.tsbun test tests/codex-catalog.test.ts -t reasoning-effortbun run typecheckbun test+bun run lint:gui/ build on CICODEX_CLI_PATH0.145.0-alpha.30 (clamp warning vs preserve max/ultra; restart/sync keep runtime)Closes / related: #297
Summary by CodeRabbit
ocx doctor --fix-codex-runtimeand expandedocx doctoroutput with Codex runtime selection diagnostics.ocx status(including--json) to report Codex runtime and catalog clamp state.