Invalidate Codex model listing after CLI update - #945
Conversation
|
🚨 SLOP COP 🚨 · I am the SlopCop. I started the security, code quality, performance, architecture, and end-to-end review phases. |
|
🚨 SLOP COP 🚨 · Browser and validation phase complete. The Codex picker loaded seven models, including 5.6-Sol, 5.6-Terra, and 5.6-Luna. The Updates screen showed Codex 0.146.0. It offered no update action, so I could not execute the external update path. Focused host-daemon tests passed: 11 tests. Focused app tests passed: 3 tests. Both affected package type checks passed. |
|
🚨 SLOP COP 🚨 · Security phase complete. I found no security defect. The new stream function stays inside the daemon. Parsed wire input cannot set it. The change adds no command interpolation, new process spawn, data exposure, or protocol field. I found one low availability race in the shared maintenance runtime. I cover it in the performance phase. |
|
🚨 SLOP COP 🚨 · Code quality and architecture phase complete. The core design is sound. The server has no model-list cache. The daemon replaces the long-lived Codex runtime before the client refetches. I found no duplicate production abstraction. The new injection seam follows an existing dispatch test pattern. No daemon protocol change exists, so the protocol version does not need a change. Low findings: Prettier rejects command-dispatch.ts, the Codex-only rule needs a rationale comment, and the test does not cover failed or non-Codex installs. Other app windows also keep their client cache until a later refetch. |
|
🚨 SLOP COP 🚨 · Performance phase complete. The normal path has good order. The daemon finishes runtime invalidation before the client starts its refetch. Runtime creation also has a generation guard. Two low findings remain. The client invalidates active execution-option queries for every host, although only one host changed. The runtime shutdown can also reject a concurrent model-list or thread-unarchive call. |
| if (completedEvent?.success) { | ||
| if (queryClient !== null) { | ||
| void invalidateHostProviderCliStatus({ queryClient, hostId }); | ||
| void invalidateSystemExecutionOptions({ queryClient }); |
There was a problem hiding this comment.
🚨 slopcop/review — Limit and share the cache refresh
This prefix invalidates active execution-option queries for all hosts, although only hostId changed.
This query client also belongs to one app window. Other windows keep the old model list until a later refresh.
Use a host-scoped key. Publish a real-time system change for other windows.
| env, | ||
| }), | ||
| ); | ||
| if (shouldInvalidateProviderMaintenanceRuntimeAfterProviderCliInstall({ |
There was a problem hiding this comment.
🚨 slopcop/review — Apply the project format
Prettier rejects this new if layout. Run Prettier on this file before merge.
| expect(runtime.startThread).toHaveBeenCalledOnce(); | ||
| }); | ||
|
|
||
| it("invalidates the provider maintenance runtime after a successful Codex CLI update", async () => { |
There was a problem hiding this comment.
🚨 slopcop/review — Test the negative branches
This test covers only a successful Codex event. The predicate also contains failure and non-Codex branches.
Add cases that confirm those events do not shut down the runtime.
| command, | ||
| events, | ||
| })) { | ||
| await options.runtimeManager.invalidateProviderMaintenanceRuntime(); |
There was a problem hiding this comment.
🚨 slopcop/review — Protect current maintenance calls before shutdown
This runtime also serves provider.list_models and thread.unarchive. Shutdown rejects their pending calls and can break the unarchive barrier.
Add a runtime lease. Alternatively, mark the runtime stale and wait for current calls before shutdown.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
The core mechanism is correct. I found no blocking defect and no security issue.
Findings:
- Low: runtime shutdown can reject a concurrent model-list or thread-unarchive call.
- Low: the client refresh covers all hosts but only one window.
- Low: Prettier rejects the new condition layout.
- Low: tests do not cover failed or non-Codex install events.
The Codex-only condition matches the current adapters. Codex keeps a long-lived model catalog, while other adapters refresh through separate paths.
No wire contract changed. The daemon protocol version does not need a change.
Validation:
- The focused host-daemon suite passed 11 tests.
- The focused app suite passed 3 tests.
- Both affected package type checks passed.
- All GitHub checks passed.
- Browser QA loaded the Updates screen and seven live Codex models.
The test host offered no Codex update. I did not execute the external update path.
846ebac to
2b539e4
Compare
|
Review follow-up pushed in Addressed:
Not addressed in this PR:
|
Summary
Testing