INNER CODE UNIT · Python
_report_rejected_intent
qrak/LLM_trader · src/app.py:517
async def _report_rejected_intent(self) -> None:
"""Alert the operator about a command the bot's own policy refused to send.
A refusal is not a missing confirmation: nothing was sent, so the exchange
never saw the command and the model's request silently died inside the bot.
The next analysis prompt carries it too (see the intent ledger).
"""
alert = None
hook = getattr(self.trading_strategy, "take_rejected_intent_alert", None)
if callable(hook):
try:
alert = hook()
except Exception as e: # noqa: BLE001
self.logger.warning("Failed to read the rejected-intent alert: %s", e)
if not isinstance(alert, str) or not alert:
return
self.logger.warning("REFUSED POSITION INTENT: %s", alert)
if self.discord_notifier is None: