mirror of
https://github.com/sst/opencode.git
synced 2025-08-31 18:27:22 +00:00
fix: guard against large output limit causing infinite summarize loop (#399)
This commit is contained in:
parent
d240f4c676
commit
f4c0d2d2fd
1 changed files with 4 additions and 1 deletions
|
@ -287,7 +287,10 @@ export namespace Session {
|
||||||
if (
|
if (
|
||||||
model.info.limit.context &&
|
model.info.limit.context &&
|
||||||
tokens >
|
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({
|
await summarize({
|
||||||
sessionID: input.sessionID,
|
sessionID: input.sessionID,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue