debug: use console.log instead of logVerbose for always-visible logging
This commit is contained in:
@@ -127,7 +127,8 @@ export async function runAgentTurnWithFallback(params: {
|
|||||||
run: (provider, model) => {
|
run: (provider, model) => {
|
||||||
// Notify that model selection is complete (including after fallback).
|
// Notify that model selection is complete (including after fallback).
|
||||||
// This allows responsePrefix template interpolation with the actual model.
|
// This allows responsePrefix template interpolation with the actual model.
|
||||||
logVerbose(
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(
|
||||||
`[responsePrefix] onModelSelected callback exists: ${!!params.opts?.onModelSelected}, provider=${provider}, model=${model}`,
|
`[responsePrefix] onModelSelected callback exists: ${!!params.opts?.onModelSelected}, provider=${provider}, model=${model}`,
|
||||||
);
|
);
|
||||||
params.opts?.onModelSelected?.({
|
params.opts?.onModelSelected?.({
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { logVerbose } from "../../globals.js";
|
|
||||||
import { stripHeartbeatToken } from "../heartbeat.js";
|
import { stripHeartbeatToken } from "../heartbeat.js";
|
||||||
import { HEARTBEAT_TOKEN, isSilentReplyText, SILENT_REPLY_TOKEN } from "../tokens.js";
|
import { HEARTBEAT_TOKEN, isSilentReplyText, SILENT_REPLY_TOKEN } from "../tokens.js";
|
||||||
import type { ReplyPayload } from "../types.js";
|
import type { ReplyPayload } from "../types.js";
|
||||||
@@ -45,15 +44,17 @@ export function normalizeReplyPayload(
|
|||||||
|
|
||||||
// Resolve template variables in responsePrefix if context is provided
|
// Resolve template variables in responsePrefix if context is provided
|
||||||
if (opts.responsePrefix?.includes("{")) {
|
if (opts.responsePrefix?.includes("{")) {
|
||||||
logVerbose(
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(
|
||||||
`[responsePrefix] normalizing: prefix="${opts.responsePrefix}", context=${JSON.stringify(opts.responsePrefixContext)}`,
|
`[responsePrefix] normalizing: prefix="${opts.responsePrefix}", context=${JSON.stringify(opts.responsePrefixContext)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const effectivePrefix = opts.responsePrefixContext
|
const effectivePrefix = opts.responsePrefixContext
|
||||||
? resolveResponsePrefixTemplate(opts.responsePrefix, opts.responsePrefixContext)
|
? resolveResponsePrefixTemplate(opts.responsePrefix, opts.responsePrefixContext)
|
||||||
: opts.responsePrefix;
|
: opts.responsePrefix;
|
||||||
if (opts.responsePrefix?.includes("{") && effectivePrefix !== opts.responsePrefix) {
|
if (opts.responsePrefix?.includes("{")) {
|
||||||
logVerbose(`[responsePrefix] resolved to: "${effectivePrefix}"`);
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`[responsePrefix] resolved to: "${effectivePrefix}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -163,14 +163,16 @@ export const dispatchTelegramMessage = async ({
|
|||||||
disableBlockStreaming,
|
disableBlockStreaming,
|
||||||
onModelSelected: (ctx) => {
|
onModelSelected: (ctx) => {
|
||||||
// Mutate the object directly instead of reassigning to ensure the closure sees updates
|
// Mutate the object directly instead of reassigning to ensure the closure sees updates
|
||||||
logVerbose(
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(
|
||||||
`[responsePrefix] telegram onModelSelected fired: provider=${ctx.provider}, model=${ctx.model}, thinkLevel=${ctx.thinkLevel}`,
|
`[responsePrefix] telegram onModelSelected fired: provider=${ctx.provider}, model=${ctx.model}, thinkLevel=${ctx.thinkLevel}`,
|
||||||
);
|
);
|
||||||
prefixContext.provider = ctx.provider;
|
prefixContext.provider = ctx.provider;
|
||||||
prefixContext.model = extractShortModelName(ctx.model);
|
prefixContext.model = extractShortModelName(ctx.model);
|
||||||
prefixContext.modelFull = `${ctx.provider}/${ctx.model}`;
|
prefixContext.modelFull = `${ctx.provider}/${ctx.model}`;
|
||||||
prefixContext.thinkingLevel = ctx.thinkLevel ?? "off";
|
prefixContext.thinkingLevel = ctx.thinkLevel ?? "off";
|
||||||
logVerbose(`[responsePrefix] telegram prefixContext updated: ${JSON.stringify(prefixContext)}`);
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`[responsePrefix] telegram prefixContext updated: ${JSON.stringify(prefixContext)}`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user