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

@@ -331,14 +331,31 @@ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
# Show typing indicator
await context.bot.send_chat_action(chat_id=chat_id, action=ChatAction.TYPING)
# Track intermediate messages 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 chat."""
nonlocal sent_count
chunks = split_message(text_block)
for chunk in chunks:
asyncio.run_coroutine_threadsafe(
context.bot.send_message(chat_id=chat_id, text=chunk), loop
)
sent_count += 1
try:
response, _is_cmd = await asyncio.to_thread(
route_message, str(chat_id), str(user_id), text
route_message, str(chat_id), str(user_id), text,
on_text=on_text,
)
chunks = split_message(response)
for chunk in chunks:
await message.reply_text(chunk)
# Only send combined response if no intermediates were delivered
if sent_count == 0:
chunks = split_message(response)
for chunk in chunks:
await message.reply_text(chunk)
except Exception:
logger.exception("Error processing Telegram message from %s", user_id)
await message.reply_text("Sorry, something went wrong processing your message.")