diff options
| -rw-r--r-- | opencode.json | 10 | ||||
| -rw-r--r-- | packages/opencode/src/session/index.ts | 3 |
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, |
