Slack: restart a conversation with "new" and replay its messages - #19
Merged
Merged
Conversation
In Slack, "@wirebot new" inside a thread and plain "new" in the bot DM now start a fresh Codex task for that conversation, alongside the existing "@wirebot /new" and "/wirebot new". The connector remembers the restart and, on the next ordinary message there, fetches the thread's replies (or, in a DM, the recent conversation history) from before the restart and prefixes them as plain-text context — the same format a first mention in an existing thread already uses — so the new task knows what was discussed without the previous task's memory. The bridge's confirmation says so on connectors that carry history over.
nocell
force-pushed
the
feat/slack-new-restart
branch
from
September 22, 2026 07:19
de9fccd to
2a14e1b
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
In Slack,
@Wirebot newinside a thread and plainnewin the bot DM now restart that conversation's Codex task, and the fresh task gets the conversation so far as context.Mentioning the bot with
/newalready worked, but Slack's composer swallows a leading slash in DMs, and people naturally write@Wirebot new. More importantly, a restart used to throw away everything the thread had discussed: the new task started blind. Now the connector remembers the restart and, on the next ordinary message in that conversation, replays the messages posted before it — the thread's replies viaconversations.replies, or in a DM the recent history viaconversations.history— as the same plain-textName: textprefix a first mention in an existing thread already uses (8,000-character budget, oldest dropped). The prefix says explicitly that the previous task's memory is gone and this is reference material./wirebot newand@Wirebot /newgained the same carry-over.Implementation
parseSlackCommand(moved toslack/message.ts) accepts/name argsas before plus a small set of bare command words, currently justnew; used both for dispatch and for keeping commands free of context prefixes.SlackChannelkeeps a bounded in-process map of restarted conversation keys → thenewmessage ts;withRestartContextconsumes it on the next message.formatThreadContexttakes an optionalbeforeTscut-off.SlackMessagingApigainsfetchHistory(channel, latestTs, limit).ChannelTraits.restartCarriesHistorylets the bridge'snewconfirmation mention the carry-over on connectors that do it (Slack only for now); Telegram and Discord behave exactly as before.Testing
bun run checkandbun testpass. Manually exercised the parser on the slash form, barenewwith case/punctuation, and non-matches such asreneworwhat's new?, and the restart cut-off informatThreadContext.🤖 Generated with Claude Code