mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 02:07:26 +00:00
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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user