fix(agent): 修复上下文压缩检查点保存失败
This commit is contained in:
1 parent
258422757c
commit
367145010f
4 files changed
+189
-16
No files matched your search
@@ -76,6 +76,13 @@ func TestCloudAgentEstimatedTokensIsConservativeForChinese(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCloudAgentCompactionReadingDoesNotTrustInvalidConfiguredWindow(t *testing.T) {
|
||||
budget := cloudAgentContextBudget{InputBudgetTokens: 1000, CompactAtTokens: 850, Source: "channel-model", Configured: false}
|
||||
if _, configured := cloudAgentCompactionReadingFor(budget, 900); configured {
|
||||
t.Fatal("invalid capability window was treated as a real token budget")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFitCloudAgentModelContextUsesTokenBudget(t *testing.T) {
|
||||
request := canonicalAgentRequest{Messages: []map[string]any{{"role": "user", "content": strings.Repeat("中文", 5000)}}}
|
||||
if err := fitCloudAgentModelContext(&request, 1_000); err == nil {
|
||||
|
||||
Reference in new issue
Block a user