File tree Expand file tree Collapse file tree
packages/opencode/src/session Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ export namespace SessionCompaction {
4646 }
4747
4848 function usable ( input : { cfg : Config . Info ; model : Provider . Model } ) {
49- const reserved =
50- input . cfg . compaction ?. reserved ?? Math . min ( 20_000 , ProviderTransform . maxOutputTokens ( input . model ) )
49+ const reserved = input . cfg . compaction ?. reserved ?? Math . min ( 20_000 , ProviderTransform . maxOutputTokens ( input . model ) )
5150 return input . model . limit . input
5251 ? Math . max ( 0 , input . model . limit . input - reserved )
5352 : Math . max ( 0 , input . model . limit . context - ProviderTransform . maxOutputTokens ( input . model ) )
@@ -183,7 +182,7 @@ export namespace SessionCompaction {
183182 // calls, then erases output of older tool calls to free context space
184183 const prune = Effect . fn ( "SessionCompaction.prune" ) ( function * ( input : { sessionID : SessionID } ) {
185184 const cfg = yield * config . get ( )
186- if ( cfg . compaction ?. prune === false ) return
185+ if ( cfg . compaction ?. prune !== true ) return
187186 log . info ( "pruning" )
188187
189188 const msgs = yield * session
You can’t perform that action at this time.
0 commit comments