Fix business plans

This commit is contained in:
2026-03-02 00:23:27 +00:00
parent b3e183eb0a
commit a9f5f3f75d
5 changed files with 117 additions and 9 deletions

View File

@@ -330,8 +330,17 @@ class BPCommandHandler(CommandHandler):
)
fanout_stats = {"sent_bindings": 0, "failed_bindings": 0}
fanout_text = summary
if ai_warning:
warning_text = str(ai_warning or "").strip()
if len(warning_text) > 300:
warning_text = warning_text[:297].rstrip() + "..."
fanout_text = (
"[bp] AI generation failed. Draft document was saved in fallback mode."
+ (f"\nReason: {warning_text}" if warning_text else "")
)
if "post_result" in action_types:
fanout_stats = await self._fanout(run, summary)
fanout_stats = await self._fanout(run, fanout_text)
if "status_in_source" == profile.visibility_mode:
status_text = f"[bp] Generated business plan: {document.title}"