feat(agent-core-v2): add dedicated compaction model with fallback - #1
Conversation
Mirror the visual/secondary-model pattern: when the compaction-model experiment is enabled and [compaction_model] is configured, context compaction uses that dedicated model instead of the current one. If the dedicated model errors or is inaccessible (an uncatalogued alias), compaction transparently falls back to the current model on the same round, so the dedicated model is never a single point of failure. Adds resolver unit tests and end-to-end fallback integration tests.
|
@coderabbitai review |
|
|
Warning Review limit reached
Next review available in: 59 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Fetch URLs effectiveMaxOutputSize is never updated on CompactionTruncatedError retry, breaking truncation handling.
@@ -662,6 +663,7 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
@@ -673,7 +675,7 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
@@ -751,6 +753,11 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
@@ -758,6 +765,10 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
local review verdict: findings — 1) effectiveMaxOutputSize never recomputed on CompactionTruncatedError retry, breaking truncation handling; 2) thinking_effort telemetry reports caller model's level instead of dedicated compaction model's level — reviewed #1 |
|
Fetch URLs effectiveMaxOutputSize is declared const and never recomputed when compactionMaxOutputSize is halved on CompactionTruncatedError, so every retry after truncation still requests the original (too-large) limit. The same variable is also not recomputed after falling back to the current model, so the fallback request may carry the dedicated model's cap instead of the current model's cap.
@@ -662,6 +663,7 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
@@ -673,7 +675,7 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
@@ -751,6 +753,11 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
@@ -758,6 +765,10 @@ export class AgentFullCompactionService extends Service implements IAgentFullCom
diff --git a/packages/agent-core-v2/test/agent/fullCompaction/compaction-model.test.ts b/packages/agent-core-v2/test/agent/fullCompaction/compaction-model.test.ts
|
Related Issue
Internal feature work on a personal fork — no upstream issue to link.
Problem
Context compaction always ran against the current conversation model. There was no way to route compaction/summarization through a dedicated, potentially cheaper or specialized model — the same capability the visual model already provides for vision tasks.
What changed
[compaction_model]config section plus acompaction-modelexperimental flag, mirroring the existing visual-model pattern.AgentFullCompactionServiceresolves the dedicated model and issues the compaction request against it instead of the current model.test/session/compaction/configSection.test.ts) and end-to-end fallback integration tests (test/agent/fullCompaction/compaction-model.test.ts).Checklist
.changeset/).