Skip to content

fix(claude): keep last good slash commands after a failed probe - #7175

Closed
maslinedwin wants to merge 6 commits into
pingdotgg:mainfrom
maslinedwin:fix/claude-slash-probe-empty
Closed

maslinedwin wants to merge 6 commits into
pingdotgg:mainfrom
maslinedwin:fix/claude-slash-probe-empty

Conversation

@maslinedwin

@maslinedwin maslinedwin commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #7111.

probeClaudeCapabilities maps a timeout or spawn failure to undefined. checkClaudeProviderStatus then published slashCommands: [], which was written to ~/.t3/caches/claudeAgent.json and 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

  • Type / with Claude skills present — Provider group is populated
  • Point the Claude binary at a wrapper that sleeps past the 25s probe timeout
  • Type / again — Provider group still lists the previous commands

Note

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).

ClaudeDriver now keeps a per-instance last-good slashCommands list. After checkClaudeProviderStatus, empty results are replaced with that list only when the snapshot is not ready. 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 ClaudeDriver after failed probe

  • Adds retainClaudeSlashCommands (pure) and rememberClaudeSlashCommands (Effect-based) helpers to preserve a previous non-empty slashCommands list when a new probe returns empty and snapshot.status is not 'ready'.
  • Wires rememberClaudeSlashCommands into the ClaudeDriver.create probe pipeline via a flatMap step, backed by a lastGoodSlashCommands Ref.
  • A successful empty probe (status 'ready') clears both the snapshot's slashCommands and the lastGoodSlashCommands cache.
  • Behavioral Change: ClaudeDriver probe snapshots now report previously known slash commands during transient non-ready failures instead of an empty list.

Macroscope summarized 60e3463.

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.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 231d5c57-d671-471a-a30c-d1bfbafe9fca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 16, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding: a backend behavior change (slash-command fallback) landed without a focused test. See the inline comment.

Posted via Macroscope — Effect Service Conventions

Comment on lines +174 to +186
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 };
}),
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added retainClaudeSlashCommands in ClaudeSlashCommands.ts with tests for populate / reuse-on-empty / empty-with-no-previous.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/server/src/provider/Drivers/ClaudeDriver.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at c56c600

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:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

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.
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Aug 16, 2026
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.
@t3dotgg

t3dotgg commented Aug 24, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

Please fix the stale slash-command cache before merge.

lastGoodSlashCommands is only updated when the command list is non-empty. A successful empty probe clears the visible menu but leaves the old commands in the cache, so a later failed probe brings those deleted commands back.

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.
@maslinedwin

Copy link
Copy Markdown
Contributor Author

Fixed in b420543.

rememberClaudeSlashCommands now always writes the merged list to lastGoodSlashCommands, including [] after a successful empty probe.

Regression: populated successful probe → empty successful probe → failed empty probe. The snapshot stays empty so deleted commands cannot come back.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 24, 2026
vp check forbids Effect.runSync in new tests. Drive the last-good cache
sequence through @effect/vitest instead.
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 24, 2026 12:58

Dismissing prior approval to re-evaluate c56c600

@shivamhwp

Copy link
Copy Markdown
Collaborator

Note: GPT-6 on behalf of shivam (@shivamhwp).

A failed capability probe on current main still publishes /compact, so incoming.length > 0 returns that builtin-only list and overwrites the cached custom commands. A previously discovered /review still disappears through the real checkClaudeProviderStatus → rememberClaudeSlashCommands path.

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.

@juliusmarminge

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: One failed Claude capability probe empties the slash-command menu for 5 minutes and persists the empty list

4 participants