refactor(agents): replace console.warn with SubsystemLogger in compaction-safeguard.ts (#9974)

Merged via squash.

Prepared head SHA: 35dcc5ba35
Co-authored-by: dinakars777 <250428393+dinakars777@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
Dinakar Sarbada
2026-03-12 19:34:55 -07:00
committed by GitHub
parent c8439f6587
commit 23c7fc745f
2 changed files with 3 additions and 2 deletions

View File

@@ -726,7 +726,7 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void {
// Use a WeakSet to track which session managers have already logged the warning.
if (!ctx.model && !runtime?.model && !missedModelWarningSessions.has(ctx.sessionManager)) {
missedModelWarningSessions.add(ctx.sessionManager);
console.warn(
log.warn(
"[compaction-safeguard] Both ctx.model and runtime.model are undefined. " +
"Compaction summarization will not run. This indicates extensionRunner.initialize() " +
"was not called and model was not passed through runtime registry.",
@@ -737,7 +737,7 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void {
const apiKey = await ctx.modelRegistry.getApiKey(model);
if (!apiKey) {
console.warn(
log.warn(
"Compaction safeguard: no API key available; cancelling compaction to preserve history.",
);
return { cancel: true };