fix: Alpha cannot reply to filedrop messages + missing debug logging + workspace context not loaded #151

Closed
opened 2026-02-27 20:42:07 +00:00 by Zeus · 0 comments
Collaborator

Problem

The integration test suite (#146) fails because Alpha cannot reply to filedrop messages. After investigation, there are three interconnected issues:

1. No filedrop reply mechanism

When Alpha receives a filedrop message via session.poll_messages, _respond() generates an LLM response but only prints it to stdout. There is no mechanism to route the response back to the sender via filedrop.

The agent.py poll_loop (line ~128) does:

response = await loop._respond(msg.content, sender=msg.sender_name, channel_type=msg.channel_type, channel_id=msg.channel_id)
print(f"\n[Cron: {msg.channel_id}] {response}", flush=True)

The response is printed but never sent back. For filedrop messages, the response should be sent back via the filedrop plugin's send() method to the original sender.

Proposed fix: After _respond() for filedrop channel_type messages, call the filedrop plugin's send(sender, response) to deliver the reply. This could be:

  • A new extension point loop.after_respond that communication plugins can hook into
  • Or direct routing in agent.py poll_loop based on channel_type == "filedrop"

2. Missing debug logging

When filedrop messages are received and processed, there is almost no debug logging. We need:

  • FileDrop plugin: Log when messages are polled, read, moved to processed (currently only logs errors)
  • Agent poll_loop: Log when injected messages are received and what response was generated
  • Loop plugin _respond: Log the channel_type/sender for incoming messages

Alpha's logger config should support level: debug in cobot.yml to enable verbose output:

logger:
  level: debug

The logger plugin already supports this (line 65 of logger/plugin.py), but more debug-level log calls are needed in the filedrop and loop plugins.

3. Workspace context files not loaded (SOUL.md, HEARTBEAT.md)

deploy.sh (#142) deploys workspace context files to workspace/ subdir, but:

  • Alpha's SOUL.md path defaults to ./SOUL.md (CWD), which is /home/alpha/workspace/cobot/SOUL.mdthis file does not exist
  • The deployed SOUL.md is at /home/alpha/workspace/cobot/workspace/SOUL.md — never loaded
  • HEARTBEAT.md is not deployed at all
  • Alpha runs with the default system prompt ("You are Cobot, a helpful AI assistant.")

Proposed fix: Either:

  • a) Update deploy.sh to copy workspace/*.md files to the cobot root dir (where SOUL.md is expected)
  • b) Update cobot.yml to set paths.soul: workspace/SOUL.md
  • c) Update the config plugin to look in workspace/ as a fallback

Option (b) is simplest. Add to cobot.yml:

paths:
  soul: workspace/SOUL.md

Also deploy a proper HEARTBEAT.md with instructions for Alpha to check filedrop and reply.

Expected Behavior

  1. When Alpha receives a filedrop message, it should generate a response AND send it back to the sender via filedrop
  2. Debug logging should show the full message flow: receive → process → respond → send reply
  3. Alpha should load its SOUL.md and have proper identity/instructions

Test Validation

After fixes, tests/integration/test_alpha.sh should pass (at least ping, echo, identity tests).

Priority

🔴 High — This blocks integration testing and Alpha's ability to communicate via filedrop.

Files to Change

File Change
cobot/agent.py Route filedrop responses back to sender
cobot/plugins/filedrop/plugin.py Add debug logging to poll_inbox
cobot/plugins/loop/plugin.py Add debug logging to _respond
cobot.yml Add paths.soul, set logger.level: debug
workspace/SOUL.md Enhance with filedrop reply instructions
deploy.sh Fix workspace context file deployment
## Problem The integration test suite (#146) fails because Alpha cannot reply to filedrop messages. After investigation, there are three interconnected issues: ### 1. No filedrop reply mechanism When Alpha receives a filedrop message via `session.poll_messages`, `_respond()` generates an LLM response but **only prints it to stdout**. There is no mechanism to route the response back to the sender via filedrop. The `agent.py` poll_loop (line ~128) does: ```python response = await loop._respond(msg.content, sender=msg.sender_name, channel_type=msg.channel_type, channel_id=msg.channel_id) print(f"\n[Cron: {msg.channel_id}] {response}", flush=True) ``` The response is printed but never sent back. For filedrop messages, the response should be sent back via the filedrop plugin's `send()` method to the original sender. **Proposed fix:** After `_respond()` for filedrop channel_type messages, call the filedrop plugin's `send(sender, response)` to deliver the reply. This could be: - A new extension point `loop.after_respond` that communication plugins can hook into - Or direct routing in `agent.py` poll_loop based on `channel_type == "filedrop"` ### 2. Missing debug logging When filedrop messages are received and processed, there is almost no debug logging. We need: - **FileDrop plugin:** Log when messages are polled, read, moved to processed (currently only logs errors) - **Agent poll_loop:** Log when injected messages are received and what response was generated - **Loop plugin _respond:** Log the channel_type/sender for incoming messages Alpha's logger config should support `level: debug` in `cobot.yml` to enable verbose output: ```yaml logger: level: debug ``` The logger plugin already supports this (line 65 of logger/plugin.py), but more debug-level log calls are needed in the filedrop and loop plugins. ### 3. Workspace context files not loaded (SOUL.md, HEARTBEAT.md) `deploy.sh` (#142) deploys workspace context files to `workspace/` subdir, but: - Alpha's SOUL.md path defaults to `./SOUL.md` (CWD), which is `/home/alpha/workspace/cobot/SOUL.md` — **this file does not exist** - The deployed SOUL.md is at `/home/alpha/workspace/cobot/workspace/SOUL.md` — never loaded - HEARTBEAT.md is not deployed at all - Alpha runs with the **default system prompt** ("You are Cobot, a helpful AI assistant.") **Proposed fix:** Either: - a) Update `deploy.sh` to copy workspace/*.md files to the cobot root dir (where SOUL.md is expected) - b) Update `cobot.yml` to set `paths.soul: workspace/SOUL.md` - c) Update the config plugin to look in `workspace/` as a fallback Option (b) is simplest. Add to `cobot.yml`: ```yaml paths: soul: workspace/SOUL.md ``` Also deploy a proper HEARTBEAT.md with instructions for Alpha to check filedrop and reply. ## Expected Behavior 1. When Alpha receives a filedrop message, it should generate a response AND send it back to the sender via filedrop 2. Debug logging should show the full message flow: receive → process → respond → send reply 3. Alpha should load its SOUL.md and have proper identity/instructions ## Test Validation After fixes, `tests/integration/test_alpha.sh` should pass (at least ping, echo, identity tests). ## Priority 🔴 High — This blocks integration testing and Alpha's ability to communicate via filedrop. ## Files to Change | File | Change | |------|--------| | `cobot/agent.py` | Route filedrop responses back to sender | | `cobot/plugins/filedrop/plugin.py` | Add debug logging to poll_inbox | | `cobot/plugins/loop/plugin.py` | Add debug logging to _respond | | `cobot.yml` | Add `paths.soul`, set `logger.level: debug` | | `workspace/SOUL.md` | Enhance with filedrop reply instructions | | `deploy.sh` | Fix workspace context file deployment |
Zeus closed this issue 2026-02-27 20:45:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#151
No description provided.