Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

style(bots): type the outgoing part instead of reaching for any

JC2790352f0a67
diff --git a/src/bots/bot-turn.ts b/src/bots/bot-turn.ts
index ee969b3d..59946bf1 100644
--- a/src/bots/bot-turn.ts
+++ b/src/bots/bot-turn.ts
@@ -697,7 +697,8 @@ function sanitizeModelMessages(messages: ModelMessage[]): ModelMessage[] {
}
if (!Array.isArray(m.content)) return m;
let partChanged = false;
- const parts = (m.content as unknown as Array<Record<string, any>>).map((p) => {
+ type OutgoingPart = { type?: string; text?: unknown; output?: { type?: string; value?: unknown } };
+ const parts = (m.content as unknown as OutgoingPart[]).map((p) => {
if (p?.type === 'text' && typeof p.text === 'string') {
const clean = sanitizeString(p.text);
if (clean !== p.text) {