@@ -11,8 +11,7 @@ const PART_STORAGE = join(homedir(), ".opencode", "parts");
1111const DEFAULT_THRESHOLD = 0.80 ;
1212const MIN_TOKENS_FOR_COMPACTION = 50_000 ;
1313const COMPACTION_COOLDOWN_MS = 30_000 ;
14- const CLAUDE_DEFAULT_CONTEXT_LIMIT = 200_000 ;
15- const CLAUDE_MODEL_PATTERN = / c l a u d e - ( o p u s | s o n n e t | h a i k u ) / i;
14+ const DEFAULT_CONTEXT_LIMIT = 200_000 ;
1615
1716interface CompactionState {
1817 lastCompactionTime : Map < string , number > ;
@@ -98,10 +97,6 @@ This context is critical for maintaining continuity after compaction.
9897` ;
9998}
10099
101- function isSupportedModel ( modelID : string ) : boolean {
102- return CLAUDE_MODEL_PATTERN . test ( modelID ) ;
103- }
104-
105100function getMessageDir ( sessionID : string ) : string | null {
106101 if ( ! existsSync ( MESSAGE_STORAGE ) ) return null ;
107102
@@ -344,13 +339,8 @@ export function createCompactionHook(
344339 }
345340 agent = storedMessage ?. agent ;
346341
347- if ( ! isSupportedModel ( modelID ) ) {
348- log ( "[compaction] skipping unsupported model" , { modelID } ) ;
349- return ;
350- }
351-
352342 const configLimit = getModelLimit ?.( providerID , modelID ) ;
353- const contextLimit = configLimit ?? CLAUDE_DEFAULT_CONTEXT_LIMIT ;
343+ const contextLimit = configLimit ?? DEFAULT_CONTEXT_LIMIT ;
354344 const totalUsed = tokens . input + tokens . cache . read + tokens . output ;
355345
356346 if ( totalUsed < MIN_TOKENS_FOR_COMPACTION ) return ;
0 commit comments