diff options
| author | Juhani Pelli <[email protected]> | 2025-06-26 02:39:51 +0300 |
|---|---|---|
| committer | Jay V <[email protected]> | 2025-06-26 17:21:53 -0400 |
| commit | 47c401cf25b0e087835eb19948c0afeea255e5ef (patch) | |
| tree | e408e4a8a71c52c2da6bac87e51b25384ac8aeea | |
| parent | fab8dc9e6fe565c56c02ad32830c6598b3d125cb (diff) | |
| download | opencode-47c401cf25b0e087835eb19948c0afeea255e5ef.tar.gz opencode-47c401cf25b0e087835eb19948c0afeea255e5ef.zip | |
fix: guard against large output limit causing infinite summarize loop (#399)
| -rw-r--r-- | packages/opencode/src/session/index.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index 21fb23699..ba8787d8b 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -287,7 +287,10 @@ export namespace Session { if ( model.info.limit.context && tokens > - (model.info.limit.context - (model.info.limit.output ?? 0)) * 0.9 + Math.max( + (model.info.limit.context - (model.info.limit.output ?? 0)) * 0.9, + 0, + ) ) { await summarize({ sessionID: input.sessionID, |
