| author | |
| committer | |
| log | ddd98876b5fe3dcb789a36ab799e6e211a1bcb5a |
| tree | 519ccd1a2d7ec1a979ad9583b501ffe136d829c6 |
| parent | dfd41da2fdc7e9268fe0e46d3ab29d1f2161b3a2 |
| signature | Signed by PGP key B5690EEEBB952194 |
3 files changed, 18 insertions(+), 0 deletions(-)
apps/server/src/orchestration/Layers/CheckpointReactor.ts+9| ... | ... | @@ -14,6 +14,7 @@ import { |
| 14 | 14 | checkpointRefForThreadTurn, |
| 15 | 15 | resolveThreadWorkspaceCwd, |
| 16 | 16 | } from "../../checkpointing/Utils.ts"; |
| 17 | import { clearWorkspaceIndexCache } from "../../workspaceEntries.ts"; | |
| 17 | 18 | import { CheckpointStore } from "../../checkpointing/Services/CheckpointStore.ts"; |
| 18 | 19 | import { ProviderService } from "../../provider/Services/ProviderService.ts"; |
| 19 | 20 | import { CheckpointReactor, type CheckpointReactorShape } from "../Services/CheckpointReactor.ts"; |
| ... | ... | @@ -218,6 +219,10 @@ const make = Effect.gen(function* () { |
| 218 | 219 | checkpointRef: targetCheckpointRef, |
| 219 | 220 | }); |
| 220 | 221 | |
| 222 | // Invalidate the workspace entry cache so the @-mention file picker | |
| 223 | // reflects files created or deleted during this turn. | |
| 224 | clearWorkspaceIndexCache(checkpointCwd); | |
| 225 | ||
| 221 | 226 | const files = yield* checkpointStore |
| 222 | 227 | .diffCheckpoints({ |
| 223 | 228 | cwd: checkpointCwd, |
| ... | ... | @@ -493,6 +498,10 @@ const make = Effect.gen(function* () { |
| 493 | 498 | return; |
| 494 | 499 | } |
| 495 | 500 | |
| 501 | // Invalidate the workspace entry cache so the @-mention file picker | |
| 502 | // reflects the reverted filesystem state. | |
| 503 | clearWorkspaceIndexCache(sessionRuntime.value.cwd); | |
| 504 | ||
| 496 | 505 | const rolledBackTurns = Math.max(0, currentTurnCount - event.payload.turnCount); |
| 497 | 506 | if (rolledBackTurns > 0) { |
| 498 | 507 | yield* providerService.rollbackConversation({ |
apps/server/src/workspaceEntries.ts+5| ... | ... | @@ -409,6 +409,11 @@ async function getWorkspaceIndex(cwd: string): Promise<WorkspaceIndex> { |
| 409 | 409 | return nextPromise; |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | export function clearWorkspaceIndexCache(cwd: string): void { | |
| 413 | workspaceIndexCache.delete(cwd); | |
| 414 | inFlightWorkspaceIndexBuilds.delete(cwd); | |
| 415 | } | |
| 416 | ||
| 412 | 417 | export async function searchWorkspaceEntries( |
| 413 | 418 | input: ProjectSearchEntriesInput, |
| 414 | 419 | ): Promise<ProjectSearchEntriesResult> { |
apps/web/src/routes/__root.tsx+4| ... | ... | @@ -22,6 +22,7 @@ import { preferredTerminalEditor } from "../terminal-links"; |
| 22 | 22 | import { terminalRunningSubprocessFromEvent } from "../terminalActivity"; |
| 23 | 23 | import { onServerConfigUpdated, onServerWelcome } from "../wsNativeApi"; |
| 24 | 24 | import { providerQueryKeys } from "../lib/providerReactQuery"; |
| 25 | import { projectQueryKeys } from "../lib/projectReactQuery"; | |
| 25 | 26 | import { collectActiveTerminalThreadIds } from "../lib/terminalStateCleanup"; |
| 26 | 27 | |
| 27 | 28 | export const Route = createRootRouteWithContext<{ |
| ... | ... | @@ -192,6 +193,9 @@ function EventRouter() { |
| 192 | 193 | if (needsProviderInvalidation) { |
| 193 | 194 | needsProviderInvalidation = false; |
| 194 | 195 | void queryClient.invalidateQueries({ queryKey: providerQueryKeys.all }); |
| 196 | // Invalidate workspace entry queries so the @-mention file picker | |
| 197 | // reflects files created, deleted, or restored during this turn. | |
| 198 | void queryClient.invalidateQueries({ queryKey: projectQueryKeys.all }); | |
| 195 | 199 | } |
| 196 | 200 | void syncSnapshot(); |
| 197 | 201 | }, |