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

@@ -166,7 +166,7 @@ class TestRegularMessage:
response, is_cmd = route_message("ch-1", "user-1", "hello")
assert response == "Hello from Claude!"
assert is_cmd is False
mock_send.assert_called_once_with("ch-1", "hello", model="sonnet")
mock_send.assert_called_once_with("ch-1", "hello", model="sonnet", on_text=None)
@patch("src.router.send_message")
def test_model_override(self, mock_send):
@@ -174,7 +174,7 @@ class TestRegularMessage:
response, is_cmd = route_message("ch-1", "user-1", "hello", model="opus")
assert response == "Response"
assert is_cmd is False
mock_send.assert_called_once_with("ch-1", "hello", model="opus")
mock_send.assert_called_once_with("ch-1", "hello", model="opus", on_text=None)
@patch("src.router._get_channel_config")
@patch("src.router._get_config")
@@ -190,6 +190,20 @@ class TestRegularMessage:
assert "Error: API timeout" in response
assert is_cmd is False
@patch("src.router._get_channel_config")
@patch("src.router._get_config")
@patch("src.router.send_message")
def test_on_text_passed_through(self, mock_send, mock_get_config, mock_chan_cfg):
mock_send.return_value = "ok"
mock_chan_cfg.return_value = None
mock_cfg = MagicMock()
mock_cfg.get.return_value = "sonnet"
mock_get_config.return_value = mock_cfg
cb = lambda t: None
route_message("ch-1", "user-1", "hello", on_text=cb)
mock_send.assert_called_once_with("ch-1", "hello", model="sonnet", on_text=cb)
# --- _get_channel_config ---
@@ -230,7 +244,7 @@ class TestModelResolution:
mock_chan_cfg.return_value = {"id": "ch-1", "default_model": "haiku"}
route_message("ch-1", "user-1", "hello")
mock_send.assert_called_once_with("ch-1", "hello", model="haiku")
mock_send.assert_called_once_with("ch-1", "hello", model="haiku", on_text=None)
@patch("src.router._get_channel_config")
@patch("src.router._get_config")
@@ -244,7 +258,7 @@ class TestModelResolution:
mock_get_config.return_value = mock_cfg
route_message("ch-1", "user-1", "hello")
mock_send.assert_called_once_with("ch-1", "hello", model="opus")
mock_send.assert_called_once_with("ch-1", "hello", model="opus", on_text=None)
@patch("src.router._get_channel_config")
@patch("src.router._get_config")
@@ -258,7 +272,7 @@ class TestModelResolution:
mock_get_config.return_value = mock_cfg
route_message("ch-1", "user-1", "hello")
mock_send.assert_called_once_with("ch-1", "hello", model="sonnet")
mock_send.assert_called_once_with("ch-1", "hello", model="sonnet", on_text=None)
@patch("src.router.get_active_session")
@patch("src.router.send_message")
@@ -268,4 +282,4 @@ class TestModelResolution:
mock_get_session.return_value = {"model": "opus", "session_id": "abc"}
route_message("ch-1", "user-1", "hello")
mock_send.assert_called_once_with("ch-1", "hello", model="opus")
mock_send.assert_called_once_with("ch-1", "hello", model="opus", on_text=None)