fix(broker): teach AI difference between mesh names and peer names
Some checks failed
CI / Typecheck (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-13 21:06:08 +01:00
parent 6836a495a4
commit a9858ef876
2 changed files with 14 additions and 7 deletions

View File

@@ -1603,7 +1603,7 @@ function setupBotCommands(
// Gather context for the AI
const firstMeshId = meshIds[0]!;
const firstConn = meshConnections.get(firstMeshId);
const meshSlug = meshSlugs.get(firstMeshId) ?? firstMeshId.slice(0, 12);
const allMeshSlugs = meshIds.map(id => meshSlugs.get(id) ?? id.slice(0, 12));
let recentPeers: string[] = [];
if (firstConn?.isConnected()) {
try {
@@ -1613,7 +1613,8 @@ function setupBotCommands(
}
const result = await processMessage(text, {
meshSlug,
meshSlug: allMeshSlugs[0],
meshSlugs: allMeshSlugs,
userName: ctx.from?.first_name,
recentPeers,
});