When a background process with notify_on_complete=True finishes, the gateway injects a synthetic MessageEvent to notify the session. This event was constructed without user_id, causing _is_user_authorized() to reject it and — for DM-origin sessions — trigger the pairing flow, sending "Hi~ I don't recognize you yet!" with a pairing code to the chat owner. Add an `internal` flag to MessageEvent that bypasses authorization checks for system-generated synthetic events. Only the process watcher sets this flag; no external/adapter code path can produce it. Includes 4 regression tests covering the fix and the normal pairing path. |
||
|---|---|---|
| .. | ||
| builtin_hooks | ||
| platforms | ||
| __init__.py | ||
| channel_directory.py | ||
| config.py | ||
| delivery.py | ||
| hooks.py | ||
| mirror.py | ||
| pairing.py | ||
| run.py | ||
| session.py | ||
| status.py | ||
| sticker_cache.py | ||
| stream_consumer.py | ||