Skip to content

The agent that grows with you

fix(desktop): omit empty rewind rebind requests

poisdahlbed7e975aa14
diff --git a/apps/desktop/src/app/chat/session-tile-actions.ts b/apps/desktop/src/app/chat/session-tile-actions.ts
index 8eaf52cf8e4..d1479ba4107 100644
--- a/apps/desktop/src/app/chat/session-tile-actions.ts
+++ b/apps/desktop/src/app/chat/session-tile-actions.ts
@@ -37,12 +37,12 @@ import {
applyBranchVisibility,
applyReloadOptimistic,
applyRewindOptimistic,
+ durableRowIdsForRebind,
finalizeInterruptedMessages,
planEdit,
planReload,
planRestore,
rebindSurvivorRowIds,
- durableRowIdsForRebind,
runRewindSubmit,
type SurvivorUserRowIds
} from '../session/hooks/use-prompt-actions/rewind'
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
index a3ecc05807c..cd261b14cf6 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts
@@ -56,12 +56,12 @@ import {
applyBranchVisibility,
applyReloadOptimistic,
applyRewindOptimistic,
+ durableRowIdsForRebind,
finalizeInterruptedMessages,
planEdit,
planReload,
planRestore,
rebindSurvivorRowIds,
- durableRowIdsForRebind,
runRewindSubmit,
type SurvivorUserRowIds
} from './rewind'
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.ts
index 7ff9dc6db8e..e964f4d96cd 100644
--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.ts
+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.ts
@@ -341,7 +341,9 @@ export async function runRewindSubmit(
// first-active-tip cut; the gateway ignores this when the prefix is
// non-empty.
...(resolvedRowId !== undefined && resolvedOrdinal === undefined ? { confirm_empty_truncate: true } : {}),
- ...(rebindRowIds ? { rebind_survivor_row_ids: [...new Set(rebindRowIds.filter(Number.isInteger))] } : {})
+ ...(rebindRowIds?.length
+ ? { rebind_survivor_row_ids: [...new Set(rebindRowIds.filter(Number.isInteger))] }
+ : {})
},
PROMPT_SUBMIT_REQUEST_TIMEOUT_MS
)