Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Closedmaslinedwin(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/7175/headopened View on GitHub

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](https://cursor.com/bugbot) for commit 60e34631c6e367819d8e84e487ed6426e7feef3d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

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.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

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

      Posted via Macroscope — Effect Service Conventions
      @@ -165,7 +166,21 @@
      165166
      167+ const lastGoodSlashCommands = yield* Ref.make<ServerProvider["slashCommands"]>([]);
      166168 const checkProvider = checkClaudeProviderStatus(
      167169 effectiveConfig,
      168170 () => Cache.get(capabilitiesProbeCache, capabilitiesCacheKey),
      169171 processEnv,
      170172 cwd,
      171173 ).pipe(
      174+ Effect.flatMap((snapshot) =>
      175+ Effect.gen(function* () {
      176+ if (snapshot.slashCommands.length > 0) {
      177+ yield* Ref.set(lastGoodSlashCommands, snapshot.slashCommands);
      178+ return snapshot;
      179+ }
      180+ const previous = yield* Ref.get(lastGoodSlashCommands);
      181+ if (previous.length === 0) {
      182+ return snapshot;
      183+ }
      184+ return { ...snapshot, slashCommands: previous };
      185+ }),
      186+ ),
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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

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

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

    4. 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](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 84347eade2cd1591a7ad2a9ee22f7dbc0cdc4352. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. 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.

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

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

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

    10. juliusmarminge closed this

Sign in to join this conversation.