Skip to content

Commit 8c1c6be

Browse files
refactor(web): inline the /compact guard into planComposerTurn
The helper had one caller; keep the guard where the decision is made. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 111533a commit 8c1c6be

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

‎apps/web/src/components/ChatView.logic.ts‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -935,18 +935,6 @@ export function shouldShowPlanFollowUpPrompt(input: {
935935
// bare one ahead of it would run an uninstructed compaction first and charge for two.
936936
const COMPACT_COMMAND_PATTERN = /^\/compact(?:\s|$)/i;
937937

938-
export function shouldCompactBeforeSend(input: {
939-
resumeCompactionTokens: number | null;
940-
keepFullHistory: boolean;
941-
messageText: string;
942-
}): boolean {
943-
return (
944-
input.resumeCompactionTokens !== null &&
945-
!input.keepFullHistory &&
946-
!COMPACT_COMMAND_PATTERN.test(input.messageText)
947-
);
948-
}
949-
950938
const sessionDismissedBranchMismatchKeys = new Set<string>();
951939

952940
export function dismissBranchMismatchForSession(key: string): void {
@@ -1554,7 +1542,10 @@ export function planComposerTurn(input: {
15541542
// A stale Claude session compacts before this message so the turn does not re-read the
15551543
// old history. The message queues behind the /compact run, since steering into it is
15561544
// rejected.
1557-
const compactBeforeSend = shouldCompactBeforeSend(input);
1545+
const compactBeforeSend =
1546+
input.resumeCompactionTokens !== null &&
1547+
!input.keepFullHistory &&
1548+
!COMPACT_COMMAND_PATTERN.test(input.messageText);
15581549
return {
15591550
// In worktree mode, require an explicit base branch so we don't silently
15601551
// fall back to local execution when branch selection is missing.

0 commit comments

Comments
 (0)