fix(cli): ignore CLI-originated backfill prompts (#1192)

This commit is contained in:
Junpo Yu
2026-07-28 10:48:32 +08:00
committed by GitHub
parent e2631a553a
commit e957d2fc2b
2 changed files with 192 additions and 5 deletions
+6
View File
@@ -627,6 +627,12 @@ export class ApiSessionClient extends EventEmitter {
const userResult = UserMessageSchema.safeParse(message.content)
if (userResult.success) {
// User messages mirrored from a local agent transcript are history,
// not new remote input. Keep them in the incoming filter above so
// reconnect backfill still advances and deduplicates correctly.
if (userResult.data.meta?.sentFrom === 'cli') {
return
}
this.enqueueUserMessage(userResult.data, message.localId ?? undefined)
return
}