fix(bridge): step structure discovery + approval watcher + AI text relay

- plannerResponse.response = user-facing text field (confirmed)
- step.runCommand.commandLine = command (not toolCall.argumentsJson)
- Add response watcher: bridge/response/ → ResolveOutstandingSteps RPC
- Fix AI text: use modifiedResponse/response, last-wins, dedup
- Fix flooding: slice(-delta) to skip old steps on reload
- Bot: 404 cache invalidation for deleted Discord channels
This commit is contained in:
2026-03-08 02:29:17 +09:00
parent 876143d397
commit 0c3d6cdb6d
6 changed files with 488 additions and 159 deletions

11
bot.py
View File

@@ -579,7 +579,16 @@ class GravityBot(commands.Bot):
color=discord.Color.purple(),
timestamp=datetime.now(timezone.utc),
)
await channel.send(embed=embed)
try:
await channel.send(embed=embed)
except discord.NotFound:
# Channel was deleted — invalidate cache and retry once
logger.warning(f"Channel deleted for {project}, re-creating...")
self.project_channels.pop(project, None)
channel = await self._get_channel(project)
if channel:
await channel.send(embed=embed)
break
f.unlink() # Cleanup
except (json.JSONDecodeError, OSError) as e: