unsupportedpastels f7322744fc fix(plugins): send a key-less inject_message to the session the plugin is working for
Before the one-gateway runtime each classic CLI loaded its own plugins, so
ctx.inject_message(text) without a session key meant that CLI's own chat.
On a gateway session the classic CLI now loads no plugin code (PLG-7): the
only copy of a plugin is the gateway's (or its plugin host's), which serves
every session of its profile, so a key-less inject had no chat to target
and was refused.

The gateway now picks the target, in order:

1. The plugin is handling a local session's own call (its slash command, a
   hook fired for that session, a tool or hook in its turn): the message
   goes to that session. The key is read from the calling context, so this
   never guesses, however many sessions are open. pre_command deliveries
   now bind the session they fire for. Under plugins.isolation: host the
   forwarded ctx call already runs in its caller's context.
2. No session in the calling context (a timer, the plugin's own thread):
   the one local session of the plugin's profile launched by the classic
   CLI (frozen policy source "cli") with a viewer attached. TUI, Desktop,
   messaging and other profiles' sessions are never picked this way.
3. Otherwise (none, or several): refused. inject_message returns False,
   nothing is injected, and one warning per plugin and reason (rate
   limited) names the plugin and says to pass a session key.

A resolved target is committed through the keyed path's producer
admission: a queued input in that session's FIFO, run once and in order.
A key-less call made for a messaging chat keeps main's refusal; a keyed
inject is unchanged; allow_gateway_injection is still required.

The classic chat view's client-side inject slot (gateway_chat_inject) is
removed: nothing in that process calls it any more. Off the gateway the
in-process _cli_ref path is unchanged. The plugin guide describes the three
rules and recommends passing a session key.

Refs #134889 (PLG-7)
Refs #139523
Refs #139847
2026-10-16 19:39:48 -04:00
..
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
…
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
…
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:28:23 +02:00
2026-10-09 17:34:38 +02:00
…
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-15 22:25:22 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
…
…
2026-10-09 17:34:38 +02:00
…
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00