mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 14:01:18 +00:00
Fix API key priority and compaction bugs
- getEnvApiKey: ANTHROPIC_OAUTH_TOKEN now takes precedence over ANTHROPIC_API_KEY - findCutPoint: Stop scan-backwards loop at session header (was decrementing past it causing null preparation) - generateSummary/generateTurnPrefixSummary: Throw on stopReason=error instead of returning empty string - Test files: Fix API key priority order, use keepRecentTokens=1 for small test conversations
This commit is contained in:
parent
c58d5f20a4
commit
251fea752c
7 changed files with 98 additions and 110 deletions
|
|
@ -23,8 +23,15 @@ export default function (pi: HookAPI) {
|
|||
|
||||
ctx.ui.notify("Custom compaction hook triggered", "info");
|
||||
|
||||
const { messagesToSummarize, messagesToKeep, previousSummary, tokensBefore, resolveApiKey, entries, signal } =
|
||||
event;
|
||||
const {
|
||||
messagesToSummarize,
|
||||
messagesToKeep,
|
||||
previousSummary,
|
||||
tokensBefore,
|
||||
resolveApiKey,
|
||||
entries: _,
|
||||
signal,
|
||||
} = event;
|
||||
|
||||
// Use Gemini Flash for summarization (cheaper/faster than most conversation models)
|
||||
const model = getModel("google", "gemini-2.5-flash");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue