summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-06-17 10:50:03 -0400
committerDax Raad <[email protected]>2025-06-17 10:50:03 -0400
commit57b3051024bb3e684d7601c0dc843ba8637fe264 (patch)
tree6d0f5ccbb14cb4ec521b309cec4d583d4f6d31db
parentae5cf3cc239a05e3031d2f9295fec3ffceed1726 (diff)
downloadopencode-57b3051024bb3e684d7601c0dc843ba8637fe264.tar.gz
opencode-57b3051024bb3e684d7601c0dc843ba8637fe264.zip
fix agent getting caught in summary loop
-rw-r--r--opencode.json10
-rw-r--r--packages/opencode/src/session/index.ts3
2 files changed, 11 insertions, 2 deletions
diff --git a/opencode.json b/opencode.json
index e20209c66..a7d952b77 100644
--- a/opencode.json
+++ b/opencode.json
@@ -1,5 +1,13 @@
{
"$schema": "https://opencode.ai/config.json",
"mcp": {},
- "provider": {}
+ "provider": {
+ "openrouter": {
+ "npm": "@openrouter/ai-sdk-provider",
+ "name": "OpenRouter",
+ "models": {
+ "anthropic/claude-sonnet-4": {}
+ }
+ }
+ }
}
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts
index 8baf7da0f..0dd4e4e62 100644
--- a/packages/opencode/src/session/index.ts
+++ b/packages/opencode/src/session/index.ts
@@ -210,8 +210,9 @@ export namespace Session {
previous.metadata.assistant.tokens.cache.write +
previous.metadata.assistant.tokens.output
if (
+ model.info.limit.context &&
tokens >
- (model.info.limit.context - (model.info.limit.output ?? 0)) * 0.9
+ (model.info.limit.context - (model.info.limit.output ?? 0)) * 0.9
) {
await summarize({
sessionID: input.sessionID,