Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/browser/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { usePersistedState, updatePersistedState } from "./hooks/usePersistedSta
import { matchesKeybind, KEYBINDS } from "./utils/ui/keybinds";
import { useResumeManager } from "./hooks/useResumeManager";
import { useUnreadTracking } from "./hooks/useUnreadTracking";
import { useAutoCompactContinue } from "./hooks/useAutoCompactContinue";
import { useWorkspaceStoreRaw, useWorkspaceRecency } from "./stores/WorkspaceStore";
import { ChatInput } from "./components/ChatInput/index";
import type { ChatInputAPI } from "./components/ChatInput/types";
Expand Down Expand Up @@ -116,9 +115,6 @@ function AppInner() {
// Auto-resume interrupted streams on app startup and when failures occur
useResumeManager();

// Handle auto-continue after compaction (when user uses /compact -c)
useAutoCompactContinue();

// Sync selectedWorkspace with URL hash
useEffect(() => {
if (selectedWorkspace) {
Expand Down
2 changes: 1 addition & 1 deletion src/browser/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ const webApi: IPCApi = {
invokeIPC(IPC_CHANNELS.WORKSPACE_RESUME_STREAM, workspaceId, options),
interruptStream: (workspaceId, options) =>
invokeIPC(IPC_CHANNELS.WORKSPACE_INTERRUPT_STREAM, workspaceId, options),
clearQueue: (workspaceId) => invokeIPC(IPC_CHANNELS.WORKSPACE_QUEUE_CLEAR, workspaceId),
clearQueue: (workspaceId) => invokeIPC(IPC_CHANNELS.WORKSPACE_CLEAR_QUEUE, workspaceId),
truncateHistory: (workspaceId, percentage) =>
invokeIPC(IPC_CHANNELS.WORKSPACE_TRUNCATE_HISTORY, workspaceId, percentage),
replaceChatHistory: (workspaceId, summaryMessage) =>
Expand Down
115 changes: 0 additions & 115 deletions src/browser/hooks/useAutoCompactContinue.ts

This file was deleted.

11 changes: 1 addition & 10 deletions src/browser/stores/WorkspaceStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,6 @@ export class WorkspaceStore {
const historicalUsage =
currentUsage.usageHistory.length > 0 ? sumUsageHistory(currentUsage.usageHistory) : undefined;

// Extract continueMessage from compaction-request before history gets replaced
const compactRequestMsg = findCompactionRequestMessage(aggregator);
const muxMeta = compactRequestMsg?.metadata?.muxMetadata;
const continueMessage =
muxMeta?.type === "compaction-request" ? muxMeta.parsed.continueMessage : undefined;

const summaryMessage = createMuxMessage(
`summary-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`,
"assistant",
Expand All @@ -697,10 +691,7 @@ export class WorkspaceStore {
metadata && "systemMessageTokens" in metadata
? (metadata.systemMessageTokens as number | undefined)
: undefined,
// Store continueMessage in summary so it survives history replacement
muxMetadata: continueMessage
? { type: "compaction-result", continueMessage, requestId: compactRequestMsg?.id }
: { type: "normal" },
muxMetadata: { type: "normal" },
}
);

Expand Down
2 changes: 1 addition & 1 deletion src/common/constants/ipc-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const IPC_CHANNELS = {
WORKSPACE_SEND_MESSAGE: "workspace:sendMessage",
WORKSPACE_RESUME_STREAM: "workspace:resumeStream",
WORKSPACE_INTERRUPT_STREAM: "workspace:interruptStream",
WORKSPACE_QUEUE_CLEAR: "workspace:queue:clear",
WORKSPACE_CLEAR_QUEUE: "workspace:clearQueue",
WORKSPACE_TRUNCATE_HISTORY: "workspace:truncateHistory",
WORKSPACE_REPLACE_HISTORY: "workspace:replaceHistory",
WORKSPACE_STREAM_HISTORY: "workspace:streamHistory",
Expand Down
11 changes: 0 additions & 11 deletions src/common/constants/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ export const PREFERRED_COMPACTION_MODEL_KEY = "preferredCompactionModel";
*/
export const VIM_ENABLED_KEY = "vimEnabled";

/**
* Get the localStorage key for the compact continue message for a workspace
* Temporarily stores the continuation prompt for the current compaction
* Should be deleted immediately after use to prevent bugs
*/
export function getCompactContinueMessageKey(workspaceId: string): string {
return `compactContinueMessage:${workspaceId}`;
}

/**
* Get the localStorage key for hunk expand/collapse state in Review tab
* Stores user's manual expand/collapse preferences per hunk
Expand Down Expand Up @@ -164,7 +155,6 @@ export function getReviewSearchStateKey(workspaceId: string): string {

/**
* List of workspace-scoped key functions that should be copied on fork and deleted on removal
* Note: Excludes ephemeral keys like getCompactContinueMessageKey
*/
const PERSISTENT_WORKSPACE_KEY_FUNCTIONS: Array<(workspaceId: string) => string> = [
getModelKey,
Expand All @@ -183,7 +173,6 @@ const PERSISTENT_WORKSPACE_KEY_FUNCTIONS: Array<(workspaceId: string) => string>
*/
const EPHEMERAL_WORKSPACE_KEY_FUNCTIONS: Array<(workspaceId: string) => string> = [
getCancelledCompactionKey,
getCompactContinueMessageKey,
];

/**
Expand Down
5 changes: 0 additions & 5 deletions src/common/types/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ export type MuxFrontendMetadata =
rawCommand: string; // The original /compact command as typed by user (for display)
parsed: CompactionRequestData;
}
| {
type: "compaction-result";
continueMessage: string; // Message to send after compaction completes
requestId?: string; // ID of the compaction-request user message that produced this summary (for idempotency)
}
| {
type: "normal"; // Regular messages
};
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const api: IPCApi = {
interruptStream: (workspaceId: string, options?: { abandonPartial?: boolean }) =>
ipcRenderer.invoke(IPC_CHANNELS.WORKSPACE_INTERRUPT_STREAM, workspaceId, options),
clearQueue: (workspaceId: string) =>
ipcRenderer.invoke(IPC_CHANNELS.WORKSPACE_QUEUE_CLEAR, workspaceId),
ipcRenderer.invoke(IPC_CHANNELS.WORKSPACE_CLEAR_QUEUE, workspaceId),
truncateHistory: (workspaceId, percentage) =>
ipcRenderer.invoke(IPC_CHANNELS.WORKSPACE_TRUNCATE_HISTORY, workspaceId, percentage),
replaceChatHistory: (workspaceId, summaryMessage) =>
Expand Down
9 changes: 9 additions & 0 deletions src/node/services/agentSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,15 @@ export class AgentSession {

this.emitChatEvent(userMessage);

// If this is a compaction request with a continue message, queue it for auto-send after compaction
const muxMeta = options?.muxMetadata;
if (muxMeta?.type === "compaction-request" && muxMeta.parsed.continueMessage && options) {
// Strip out edit-specific and compaction-specific fields so the queued message is a fresh user message
const { muxMetadata, mode, editMessageId, ...continueOptions } = options;
this.messageQueue.add(muxMeta.parsed.continueMessage, continueOptions);
this.emitQueuedMessageChanged();
}

if (!options?.model || options.model.trim().length === 0) {
return Err(
createUnknownSendMessageError("No model specified. Please select a model using /model.")
Expand Down
2 changes: 1 addition & 1 deletion src/node/services/ipcMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ export class IpcMain {
}
);

ipcMain.handle(IPC_CHANNELS.WORKSPACE_QUEUE_CLEAR, (_event, workspaceId: string) => {
ipcMain.handle(IPC_CHANNELS.WORKSPACE_CLEAR_QUEUE, (_event, workspaceId: string) => {
try {
const session = this.getOrCreateSession(workspaceId);
session.clearQueue();
Expand Down