fix(collaboration): stop reporting unknown catalog state as a catalog change - #1407
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe v2 multi-agent guidance now handles ChangesCatalog Guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
… change
v2 guidance mapped `unknown` to the same text as `stale`:
The model catalog changed after Codex started; do not set model or
reasoning_effort overrides until Codex restarts.
`unknown` does not mean the catalog changed. It means the comparison could not
be made at all — `collectCodexAppServerCatalogState` returns `unknown` when the
catalog mtime is unreadable, when process enumeration fails, or when any
app-server's start time is unreadable. A transient code-mode-host process that
exits between enumeration and the start-time read lands here, which is why the
message appears intermittently and alternates with normal guidance turn to turn.
So the text asserts a cause that was never established, and prescribes a remedy
that cannot work: restarting Codex does not clear `unknown`, because the state
is a failed measurement rather than a stale process.
Suppressing overrides while the state is unknown is still correct and is
unchanged. Only the claim changes: `unknown` now gets its own message mirroring
the honest phrasing `ocx doctor` already uses for the same state
(src/cli/doctor.ts), so an operator can tell "the catalog changed" from
"we could not check".
Verified:
bun test tests/multi-agent-compat.test.ts -> 42 pass, 0 fail
bun x tsc --noEmit -> clean
coverage src/server/responses/collaboration.ts -> 84.00% lines
Fixes lidge-jun#1354
6b496df to
96132bc
Compare
Fixes #1354.
Summary
v2 collaboration guidance mapped
unknownto the same text asstale:unknowndoes not mean the catalog changed. It means the comparison could not be made at all.collectCodexAppServerCatalogStatereturnsunknownwhen the catalog mtime is unreadable, when process enumeration fails, or when any app-server's start time is unreadable:A transient
code-mode-hostprocess that exits between enumeration and the start-time read lands exactly there, which is why the message appears intermittently and alternates with normal guidance from turn to turn, as the reporter describes.So the text asserted a cause that was never established, and prescribed a remedy that cannot work — restarting Codex does not clear
unknown, because the state is a failed measurement rather than a stale process.Suppressing overrides while the state is unknown is still correct and is unchanged. Only the claim changes.
unknownnow gets its own message, mirroring the honest phrasingocx doctoralready uses for the same state (src/cli/doctor.ts):An operator reading a turn can now tell "the catalog changed" apart from "we could not check", and is no longer told to perform a restart that would not help.
Verification
Reproduced with a failing test before the fix —
unknownreturned the stale text verbatim:Commands run against the
devbase (branch is on3976d34):The new test pins four things:
stalekeeps its exact wording;unknownasserts neither the cause nor the restart remedy; both still suppress the override instruction and positive model claims (so the #857 behaviour cannot regress); and the two messages stay distinguishable from each other.The existing #857 test — which asserts both states suppress positive claims — passes unchanged.
Checklist
unknownwording is deliberately aligned with the existingocx doctortext so the two surfaces agree. Happy to add a note if you'd like one.Notes for review
not_runningandfreshare untouched.unknowntext so the instruction itself is unchanged; only the justification and the remedy differ.doctor.tson purpose — if you'd rather the two surfaces diverge, or prefer different phrasing, happy to adjust.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
Bug Fixes
Tests