Repository navigation
fix(claude): keep last good slash commands after a failed probe - #7175
maslinedwin wants to merge 6 commits into
Conversation
A timed-out or failed Claude capability probe was cached as an empty slash-command list for five minutes and written to the provider cache. The / menu then lost every provider command until the next success.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
One finding: a backend behavior change (slash-command fallback) landed without a focused test. See the inline comment.
Posted via Macroscope — Effect Service Conventions
| Effect.flatMap((snapshot) => | ||
| Effect.gen(function* () { | ||
| if (snapshot.slashCommands.length > 0) { | ||
| yield* Ref.set(lastGoodSlashCommands, snapshot.slashCommands); | ||
| return snapshot; | ||
| } | ||
| const previous = yield* Ref.get(lastGoodSlashCommands); | ||
| if (previous.length === 0) { | ||
| return snapshot; | ||
| } | ||
| return { ...snapshot, slashCommands: previous }; | ||
| }), | ||
| ), |
There was a problem hiding this comment.
This changes backend snapshot behavior (an empty slashCommands probe result is now replaced by the last non-empty result), but no focused test covers it. Consider extracting the fallback into a small testable helper next to the other Claude driver helpers (e.g. ClaudeSlashCommands.ts, alongside ClaudeHome.ts / ClaudeSkills.ts) and adding a test that asserts: first probe populates, empty probe reuses the previous list, and empty-with-no-previous passes through unchanged.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Added retainClaudeSlashCommands in ClaudeSlashCommands.ts with tests for populate / reuse-on-empty / empty-with-no-previous.
There was a problem hiding this comment.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 84347ea. Configure here.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This narrowly scoped Claude provider fix preserves previously discovered slash commands across transient failed probes while correctly clearing them after successful empty probes. The behavior is isolated to provider snapshots and is covered by focused helper tests. Notes:
You can add or adjust custom eligibility rules. Learn more. |
… reuse A failed capability probe must keep the last non-empty slash-command list. The merge now lives next to the other Claude driver helpers.
A successful empty probe must clear the / menu. Keep the last good list only when the snapshot is not ready, so a transient capability failure does not wipe commands and a real empty result does not linger.
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo Please fix the stale slash-command cache before merge.
Clear the cached commands after a successful empty probe. Add a driver-level regression test for this sequence: populated successful probe, empty successful probe, then failed empty probe. The final snapshot must stay empty. |
A successful empty probe already hid the commands in the snapshot, but lastGoodSlashCommands kept the old list. The next failed probe then restored deleted commands. Always write the merged list, including empty.
|
Fixed in b420543.
Regression: populated successful probe → empty successful probe → failed empty probe. The snapshot stays empty so deleted commands cannot come back. |
vp check forbids Effect.runSync in new tests. Drive the last-good cache sequence through @effect/vitest instead.
Dismissing prior approval to re-evaluate c56c600
|
Note: GPT-6 on behalf of shivam (@shivamhwp). A failed capability probe on current main still publishes Use the capability probe outcome to distinguish a failed probe from a successful empty discovery, and preserve discovered commands across failure even when builtins are present. Add a regression through the real snapshot builder. This also needs to coexist with #11094, which adds more fallback builtins. |
|
Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work. Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look. |

Summary
Fixes #7111.
probeClaudeCapabilitiesmaps a timeout or spawn failure toundefined.checkClaudeProviderStatusthen publishedslashCommands: [], which was written to~/.t3/caches/claudeAgent.jsonand shown in the/menu for the rest of the 5-minute cache TTL.This keeps the last non-empty slash-command list when a probe returns nothing, so a single slow or failed probe cannot wipe the Provider group.
Test plan
/with Claude skills present — Provider group is populated/again — Provider group still lists the previous commandsNote
Low Risk
Small, well-tested snapshot-cache tweak for Claude slash commands. It only affects what the
/menu shows after a probe failure, not auth or request handling.Overview
Stops a timed-out or failed Claude capabilities probe from wiping the
/menu for the rest of the 5-minute cache TTL (#7111).ClaudeDrivernow keeps a per-instance last-goodslashCommandslist. AftercheckClaudeProviderStatus, empty results are replaced with that list only when the snapshot is notready. A successful empty probe still clears the menu and the cache so deleted commands cannot come back on a later failure.Reviewed by Cursor Bugbot for commit 60e3463. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Keep last good slash commands in
ClaudeDriverafter failed proberetainClaudeSlashCommands(pure) andrememberClaudeSlashCommands(Effect-based) helpers to preserve a previous non-emptyslashCommandslist when a new probe returns empty andsnapshot.statusis not'ready'.rememberClaudeSlashCommandsinto theClaudeDriver.createprobe pipeline via aflatMapstep, backed by alastGoodSlashCommandsRef.'ready') clears both the snapshot'sslashCommandsand thelastGoodSlashCommandscache.ClaudeDriverprobe snapshots now report previously known slash commands during transient non-ready failures instead of an empty list.Macroscope summarized 60e3463.