fix: handle platform ID prefix mismatch in router, not register
Move prefix handling from register.ts to router.ts. Users register with raw platform IDs (what they naturally have), adapters send prefixed IDs (their internal format). Router now tries stripping the channel type prefix when the exact lookup fails, matching either format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -118,13 +118,6 @@ 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"). Auto-prefix if the user provided a raw ID so the router
|
||||
// matches the adapter's format.
|
||||
if (parsed.platformId && !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