Repository navigation
feat(web): add a setting to turn off compact-before-send for old Claude threads #17234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,6 @@ import { | |
| import { feedbackBannerItem } from "./chat/ComposerFeedback"; | ||
| import { usageLimitsBannerItem } from "./chat/ComposerUsageLimits"; | ||
| import { getTerminalLabel } from "@t3tools/shared/terminalLabels"; | ||
| import * as Schema from "effect/Schema"; | ||
| import { | ||
| questionAttachmentDraftId, | ||
| questionAttachmentDraftPrefix, | ||
|
|
@@ -336,6 +335,7 @@ import { | |
| useClientSettings, | ||
| useClientSettingsHydrated, | ||
| useEnvironmentSettings, | ||
| useUpdateClientSettings, | ||
| } from "../hooks/useSettings"; | ||
| import { useNowMinute } from "../hooks/useNowMinute"; | ||
| import { usePanelAnimationSettings, usePanelPresence } from "../panelAnimations"; | ||
|
|
@@ -699,6 +699,9 @@ const PreviewPanel = lazy(() => | |
| import("./preview/PreviewPanel").then((module) => ({ default: module.PreviewPanel })), | ||
| ); | ||
| const DiffPanel = lazy(() => import("./DiffPanel")); | ||
| const selectClaudeResumeCompactionEnabled = (settings: { | ||
| claudeResumeCompactionEnabled: boolean; | ||
| }) => settings.claudeResumeCompactionEnabled; | ||
| const selectAutoShowFloatingPreview = (settings: { browserAutoShowFloatingPreview: boolean }) => | ||
| settings.browserAutoShowFloatingPreview; | ||
| const DevicePanel = lazy(() => | ||
|
|
@@ -4162,12 +4165,8 @@ export default function ChatView(props: ChatViewProps) { | |
| selectedProvider, | ||
| ], | ||
| ); | ||
| const [resumeCompactionPermanentlyDismissed, setResumeCompactionPermanentlyDismissed] = | ||
| useLocalStorage( | ||
| `t3code:resume-compaction-dismissed:${environmentId}:${activeProviderInstanceId ?? "claudeAgent"}`, | ||
| false, | ||
| Schema.Boolean, | ||
| ); | ||
| const resumeCompactionEnabled = useClientSettings(selectClaudeResumeCompactionEnabled); | ||
| const updateClientSettings = useUpdateClientSettings(); | ||
| const nativeResumeCompactionDismissed = useMemo( | ||
| () => | ||
| hasDismissedResumeCompaction( | ||
|
|
@@ -4181,14 +4180,10 @@ export default function ChatView(props: ChatViewProps) { | |
| [serverProjection?.runtimeRequests], | ||
| ); | ||
| useEffect(() => { | ||
| if (nativeResumeCompactionDismissed && !resumeCompactionPermanentlyDismissed) { | ||
| setResumeCompactionPermanentlyDismissed(true); | ||
| if (nativeResumeCompactionDismissed && resumeCompactionEnabled) { | ||
| void updateClientSettings({ claudeResumeCompactionEnabled: false }); | ||
|
Comment on lines
+4183
to
+4184
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Do not let a past thread dismissal override a later setting choice. If a user turns Compact old Claude threads back on, opening a thread with a recorded native dismissal makes this effect set the global setting to 🤖 Prompt for AI Agents |
||
| } | ||
| }, [ | ||
| nativeResumeCompactionDismissed, | ||
| resumeCompactionPermanentlyDismissed, | ||
| setResumeCompactionPermanentlyDismissed, | ||
| ]); | ||
| }, [nativeResumeCompactionDismissed, resumeCompactionEnabled, updateClientSettings]); | ||
| const providerStatusBannerKey = getProviderStatusBannerKey(activeProviderStatus); | ||
| const [dismissedProviderStatusBannerKey, setDismissedProviderStatusBannerKey] = useState< | ||
| string | null | ||
|
|
@@ -7681,7 +7676,7 @@ export default function ChatView(props: ChatViewProps) { | |
| // multi-model sends never compact first, so the offer hides for them. | ||
| const resumeCompactionTokens = | ||
| activeContextWindow && | ||
| !resumeCompactionPermanentlyDismissed && | ||
| resumeCompactionEnabled && | ||
| !nativeResumeCompactionDismissed && | ||
| !compactDisabled && | ||
| !hasHeldQueuedRuns && | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
components/ChatView.tsx:4183After a thread has a resolved “Don't ask again” request, enabling
claudeResumeCompactionEnabledis immediately undone, so users cannot keep the setting enabled.nativeResumeCompactionDismissedscans historical resolved requests, and this effect writesfalseevery time the setting becomestrue; process each dismissal only once instead of replaying it on re-enablement.🤖 Copy this AI Prompt to have your agent fix this: