Repository navigation
fix: five behaviour fixes (allowlists, MEMORY.md guard, link summaries, WhatsApp shutdown, .env docs) - #24
Merged
Merged
Conversation
On Slack an empty SLACK_ALLOWED_USERS let everyone in, while on Telegram an empty ALLOWED_USER_IDS let nobody in, and Telegram's start banner still said "allowed users: all". Who may use the bot is now deny-by-default everywhere: is_allowed() only lets in who is on the list, and the Slack wizard asks for SLACK_ALLOWED_USERS as required. SLACK_ALLOWED_CHANNELS stays optional: empty means any channel the allowed users write in (DMs included), a list still restricts to those channels. At start each platform prints its allowlists and warns, naming the env var, when the user list is empty. WhatsApp keeps its self-chat rule.
A backend can return error text instead of raising ("API Error:
Connection refused", Cursor's "I couldn't generate a response."), or a
reply can be empty or cut off. Consolidation wrote any of these over
MEMORY.md, replacing the user's whole profile.
Consolidator._replace_memory, the only MEMORY.md writer, now checks the
reply has what the prompt requires (starts with "# Personal Memory", has
"## Index"; the prompt now asks for the index heading even when empty).
Anything else logs a warning with a short preview and raises, like a
failed backend call: MEMORY.md, .history/ and meta.json are untouched and
the background run waits an hour instead of paying for a new call after
every reply. An empty reply, which used to return False, takes this path.
LinkProcessor.summarize returned "Could not summarize: <error>" when the OpenAI call failed, and the pipeline handed that to the agent as "[Link summary] <url>: Could not summarize: ... Save it if the content is worth remembering." It now logs the failure and returns None, the same as for a page that couldn't be fetched, so that link gets no summary block. The parity tests pin this on Telegram, Slack and WhatsApp.
Telegram and Slack run the async shutdown (consolidation, the backend's aclose, reminders) when they stop; WhatsApp only called the sync close(), so the AI backend was never shut down. Slack and WhatsApp now both stop through run_until_stopped() in memclaw.bot: run the bot until it returns or Ctrl+C, then always await its aclose(). WhatsAppBot gets aclose() in place of close(); the sync Inbound.close() / TelegramBot.close() had no callers left and are gone.
docs/configuration.md said a .env in the current directory is picked up. It isn't: load_dotenv() in memclaw/config.py uses python-dotenv's find_dotenv(), which searches upward from the installed memclaw package's folder (the current folder only in a REPL or debugger). Describe the real order instead: shell environment, then that .env, then ~/.memclaw/.env.
emanuilo
force-pushed
the
fix/behavior
branch
from
November 24, 2026 09:51
1668111 to
6798826
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five behaviour fixes kept out of the code-shape refactor, one commit each.
Evidence
Each fix started with a failing test.
test_slack_empty_allowlist_lets_everyone_in(parity). After:test_slack_empty_allowlist_blocks_everyone,test_slack_empty_channel_list_means_any_channel(allowed user in from a DM, stranger ignored), banner/warning tests for Telegram and four Slack list combinations..history/andmeta.jsonuntouched; a valid reply is still written.test_link_that_cannot_be_summarized_adds_nothingon Telegram, Slack and WhatsApp.pytest: 620 passed, 20 skipped (was 603); every commit checked individually (pytest, ruff,code-shape check); baseline still empty.Merge Danger
Door: two-way
Blast Radius: Slack users, consolidation
SLACK_ALLOWED_USERS(which used to mean everyone) is now locked out until they list users. README calls it out; the bot warns at start.## Index("even when there is nothing to index yet"), which the new guard relies on. A bad reply makesmemclaw consolidateexit with an error, like a failed call.close()methods on the inbound pipeline and Telegram bot were removed.🤖 Generated with Claude Code