cleanup: remove clawd/openclaw references, fix permissions, add architecture docs

- Replace all ~/clawd and ~/.clawdbot paths with ~/echo-core equivalents
  in tools (git_commit, ralph_prd_generator, backup_config, lead-gen)
- Update personality files: TOOLS.md repo/paths, AGENTS.md security audit cmd
- Migrate HANDOFF.md architectural decisions to docs/architecture.md
- Tighten credentials/ dir to 700, add to .gitignore
- Add .claude/ and *.pid to .gitignore
- Various adapter, router, and session improvements from prior work

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MoltBot Service
2026-02-14 21:44:13 +00:00
parent d585c85081
commit 5928077646
35 changed files with 666 additions and 790 deletions

View File

@@ -721,15 +721,33 @@ def create_bot(config: Config) -> discord.Client:
# React to acknowledge receipt
await message.add_reaction("\U0001f440")
# Track how many intermediate messages were sent via callback
sent_count = 0
loop = asyncio.get_event_loop()
def on_text(text_block: str) -> None:
"""Send intermediate Claude text blocks to the channel."""
nonlocal sent_count
chunks = split_message(text_block)
for chunk in chunks:
asyncio.run_coroutine_threadsafe(
message.channel.send(chunk), loop
)
sent_count += 1
try:
async with message.channel.typing():
response, _is_cmd = await asyncio.to_thread(
route_message, channel_id, user_id, text
route_message, channel_id, user_id, text,
on_text=on_text,
)
chunks = split_message(response)
for chunk in chunks:
await message.channel.send(chunk)
# Only send the final combined response if no intermediates
# were delivered (avoids duplicating content).
if sent_count == 0:
chunks = split_message(response)
for chunk in chunks:
await message.channel.send(chunk)
except Exception:
logger.exception("Error processing message from %s", message.author)
await message.channel.send(