@friendlyrobot/discord-pi-agent 0.7.6 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -163,6 +163,12 @@ async function collectReply(session, prompt, options = {}) {
|
|
|
163
163
|
}
|
|
164
164
|
if (finalText) {
|
|
165
165
|
const transformed = await transformMarkdownTablesToCodeBlocks(finalText);
|
|
166
|
+
console.info(`========== reply-buffer BEFORE (${finalText.length} chars) ==========
|
|
167
|
+
${finalText}
|
|
168
|
+
========== reply-buffer BEFORE END ==========`);
|
|
169
|
+
console.info(`========== reply-buffer AFTER (${transformed.length} chars) ==========
|
|
170
|
+
${transformed}
|
|
171
|
+
========== reply-buffer AFTER END ==========`);
|
|
166
172
|
logger3.debug({
|
|
167
173
|
logPrefix,
|
|
168
174
|
model,
|
|
@@ -357,6 +363,12 @@ class AgentService {
|
|
|
357
363
|
await this.ensureModelForSession(this.requireSession());
|
|
358
364
|
}
|
|
359
365
|
async ensureModelForSession(session) {
|
|
366
|
+
if (session.model) {
|
|
367
|
+
logger4.debug({
|
|
368
|
+
model: `${session.model.provider}/${session.model.id}`
|
|
369
|
+
}, "retaining existing session model");
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
360
372
|
const desiredModel = this.modelRegistry.find(this.config.modelProvider, this.config.modelId);
|
|
361
373
|
const availableModels = await this.modelRegistry.getAvailable();
|
|
362
374
|
logger4.debug({
|
|
@@ -368,16 +380,9 @@ class AgentService {
|
|
|
368
380
|
if (!desiredModel) {
|
|
369
381
|
throw new Error(`Configured model not found: ${this.config.modelProvider}/${this.config.modelId}. Check your pi agent config and installed extensions.`);
|
|
370
382
|
}
|
|
371
|
-
if (isSameModel(session.model, desiredModel)) {
|
|
372
|
-
logger4.debug({
|
|
373
|
-
model: `${desiredModel.provider}/${desiredModel.id}`
|
|
374
|
-
}, "model already selected");
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
383
|
logger4.info({
|
|
378
|
-
from: session.model ? `${session.model.provider}/${session.model.id}` : null,
|
|
379
384
|
to: `${desiredModel.provider}/${desiredModel.id}`
|
|
380
|
-
}, "
|
|
385
|
+
}, "setting initial session model");
|
|
381
386
|
await session.setModel(desiredModel);
|
|
382
387
|
await this.applyConfiguredThinkingLevelForSession(session);
|
|
383
388
|
}
|