Conversation
Point the stale contract-test mock at the current Codex runtime module and instantiate the provider directly for the one mock-sensitive fallback case. This keeps the fallback covered without changing production refresh behavior or the separate registry contract coverage. Regeneration-Prompt: | Fix MAR-231, the unrelated prep blocker on PR #54392. The failing surface was src/plugins/contracts/runtime.contract.test.ts for the OpenAI Codex refresh fallback case. Keep production behavior unchanged. The contract loader uses Jiti for bundled providers, which bypasses the Vitest mock of the runtime wrapper and caused the test to hit the real OAuth refresh path. Update the stale runtime mock path and make only that fallback assertion use the direct provider module, while leaving registry coverage in src/plugins/contracts/registry.contract.test.ts intact. Validate with the focused Codex runtime contract test and the registry contract test.
Greptile SummaryThis test-only PR fixes two issues in Confidence Score: 5/5This PR is safe to merge — it is a test-only fix with no production code changes. The diff touches a single test file, corrects a stale mock path to match the real file location, and switches one provider instantiation to bypass a known Jiti loader limitation. Both changes are technically correct and narrowly scoped. No logic, APIs, or production behavior is affected. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/plugins/contracts/runtime.contract.test.ts | Fixes stale Codex runtime mock path and switches fallback test to direct provider instantiation to avoid Jiti mock bypass. |
Reviews (1): Last reviewed commit: "test: fix codex contract refresh fallbac..." | Re-trigger Greptile
What
Fixes the OpenAI Codex provider runtime contract so the refresh-fallback assertion uses the current runtime mock path and avoids the bundled loader's Jiti mock bypass for that one case.
Why
This is a Forge follow-up for an unrelated test failure discovered while preparing PR #54392.
Changes
Testing
pnpm test -- src/plugins/contracts/runtime.contract.test.ts -t "owns refresh fallback for accountId extraction failures"pnpm test -- src/plugins/contracts/registry.contract.test.ts