Repository navigation
fix(slack): polish threaded replies and proactive delivery - #3475
Merged
Merged
Conversation
Without writing these fields into jobs.json, cron jobs created in a Slack thread lost their thread_ts (and original session_key) after the service was reloaded, so reminders fired into the channel root. Made-with: Cursor
…nder The old prompt framed cron firing as a "task triggered" status report, which led the agent to reply with things like "Done ✅ 已提醒 U0AV8BJPV8D 喝水" — exposing the user id and reading like a system log instead of a friendly reminder. Reword it to instruct the agent to speak directly to the user and forbid status-style language. Made-with: Cursor
…s in thread cmd_restart only persisted channel + chat_id across the os.execv boundary, so when the new process announced "Restart completed" the OutboundMessage had no Slack thread_ts and the reply fell back to the channel root. Serialize msg.metadata into NANOBOT_RESTART_NOTIFY_METADATA, restore it on the RestartNotice, and forward it to OutboundMessage so the completion message follows the same routing as the original /restart invocation. Made-with: Cursor
… buried _with_thread_context prepends conversation history to the message content. This turned "/restart" into "Slack thread context...\n\n Current message:\n/restart", which the command router could not match as a priority command. Skip the context enrichment when the stripped text starts with "/". Made-with: Cursor
Keep the root README focused on the main setup path and leave Slack-specific upload permissions in the chat apps guide. Made-with: Cursor
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
This PR tightens Slack as a first-class chat surface instead of treating it like a plain message sink.
It fixes the thread context path for proactive replies,
/restart, and slash commands, then adds a few Slack-specific UX improvements: long message splitting, Block Kit buttons for ask-user choices, safer thread-context hydration, and clearer docs for file upload permissions.What Changed
Preserve Slack thread routing for proactive messages:
channelMetaandsessionKeyacross store reloads./restartnow carries channel metadata acrossos.execv, soRestart completedlands in the same Slack thread.Improve reminder quality:
Done ✅ 已提醒 U0....Keep slash commands command-shaped:
/./restartfrom being wrapped inside thread history and routed to the LLM as normal chat.Improve Slack message rendering:
OutboundMessage.buttonswith Slack Block Kit.Update docs:
files:writeas required for Slack image/video/file uploads.Test Plan
python -m pytest tests/channels/test_slack_channel.py tests/utils/test_restart.py tests/cli/test_restart_command.py tests/tools/test_message_tool.py tests/agent/test_loop_tool_context.py -qResult:
37 passed