Skip to content

Commit 93c1ef3

Browse files
committed
🤖 Store rawCommand in metadata & remove CompactionBarrier
Changes: - Renamed 'command' to 'rawCommand' in CmuxFrontendMetadata - Clarifies this is the user's exact input for faithful display - Removed CompactionBarrier component - StreamingBarrier now handles both streaming and compaction - Reduces code duplication (37 lines removed) - Updated all references to use rawCommand: - prepareCompactionMessage() in ChatInput - StreamingMessageAggregator display logic - useAutoCompactContinue edit detection - Integration test Benefits: - More semantic field name (rawCommand vs command) - Single barrier component for both streaming states - No functional changes - all tests pass
1 parent 28415b6 commit 93c1ef3

File tree

6 files changed

+180
-225
lines changed

6 files changed

+180
-225
lines changed

src/components/ChatInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function prepareCompactionMessage(
307307

308308
const metadata: CmuxFrontendMetadata = {
309309
type: "compaction-request",
310-
command,
310+
rawCommand: command,
311311
parsed: {
312312
maxOutputTokens: parsed.maxOutputTokens,
313313
continueMessage: parsed.continueMessage,

src/components/Messages/ChatBarrier/CompactionBarrier.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/hooks/useAutoCompactContinue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function useAutoCompactContinue() {
7373
.map((p) => p.text)
7474
.join("");
7575

76-
if (currentContent !== cmuxMeta.command) {
76+
if (currentContent !== cmuxMeta.rawCommand) {
7777
// Message was edited - re-parse
7878
const parsed = parseCommand(currentContent);
7979
continueMessage = parsed?.type === "compact" ? parsed.continueMessage : undefined;

src/types/message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { ToolPolicy } from "@/utils/tools/toolPolicy";
88
export type CmuxFrontendMetadata =
99
| {
1010
type: "compaction-request";
11-
command: string; // The original /compact command for display
11+
rawCommand: string; // The original /compact command as typed by user (for display)
1212
parsed: {
1313
maxOutputTokens?: number;
1414
continueMessage?: string;
@@ -89,7 +89,7 @@ export type DisplayedMessage =
8989
timestamp?: number;
9090
compactionRequest?: {
9191
// Present if this is a /compact command
92-
command: string;
92+
rawCommand: string;
9393
parsed: {
9494
maxOutputTokens?: number;
9595
continueMessage?: string;

0 commit comments

Comments
 (0)