Merge a1a268c222 into da71eaebd2
This commit is contained in:
commit
43de6bd3e3
@ -148,26 +148,16 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void {
|
||||
|
||||
const model = ctx.model;
|
||||
if (!model) {
|
||||
return {
|
||||
compaction: {
|
||||
summary: fallbackSummary,
|
||||
firstKeptEntryId: preparation.firstKeptEntryId,
|
||||
tokensBefore: preparation.tokensBefore,
|
||||
details: { readFiles, modifiedFiles },
|
||||
},
|
||||
};
|
||||
// ctx.model may be undefined when extensionRunner.initialize() was not called
|
||||
// (e.g. embedded runner mode). Fall through to built-in compaction which has
|
||||
// correct model access via AgentSession.model.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const apiKey = await ctx.modelRegistry.getApiKey(model);
|
||||
if (!apiKey) {
|
||||
return {
|
||||
compaction: {
|
||||
summary: fallbackSummary,
|
||||
firstKeptEntryId: preparation.firstKeptEntryId,
|
||||
tokensBefore: preparation.tokensBefore,
|
||||
details: { readFiles, modifiedFiles },
|
||||
},
|
||||
};
|
||||
// Fall through to built-in compaction rather than producing an empty summary.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user