fix: normalize platform ID at registration, not router lookup
Channel adapters prefix platform IDs with their channel type (e.g. "telegram:123"). Normalize in register.ts so the DB always stores the canonical format. Removes fallback lookup from router. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -118,6 +118,13 @@ export async function run(args: string[]): Promise<void> {
|
||||
process.exit(4);
|
||||
}
|
||||
|
||||
// Chat SDK adapters prefix platform IDs with the channel type
|
||||
// (e.g. "telegram:123", "discord:guild:channel"). Normalize here so
|
||||
// the stored ID always matches what the adapter sends at runtime.
|
||||
if (!parsed.platformId.startsWith(`${parsed.channel}:`)) {
|
||||
parsed.platformId = `${parsed.channel}:${parsed.platformId}`;
|
||||
}
|
||||
|
||||
log.info('Registering channel', parsed);
|
||||
|
||||
// Init v2 central DB
|
||||
|
||||
Reference in New Issue
Block a user