Skip to content

handleslack: only bridge assistant app threads once the user posts - #190

Open
iFixRobots wants to merge 7 commits into
mainfrom
iFixRobots/assistant-app-thread
Open

iFixRobots wants to merge 7 commits into
mainfrom
iFixRobots/assistant-app-thread

Conversation

@iFixRobots

@iFixRobots iFixRobots commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Opening a Slack AI app creates a new assistant_app_thread root with the app's greeting in a thread every time, and Slack only shows those chats in the app's history tab. Those chats are now skipped live and in backfill until the user posts in one, and then the root (as a notice) and the earlier thread messages are bridged before the user's message.

Before / after

Opening an AI app twice from Slack, then posting in one of the chats.

Before After
Each open adds a root and a threaded greeting, with notifications. Opens add nothing. Posting brings the root, greeting and message over as one thread. The earlier root is from the before run and was kept by backfill because it has a user reply.

Linear: https://linear.app/beeper/issue/PLAT-40923

View in Indent
Tag @indent to continue the conversation here.

@iFixRobots iFixRobots changed the title msgconv/from-slack: bridge assistant app thread roots as notices handleslack: only bridge assistant app threads once the user posts Nov 20, 2026
@iFixRobots
iFixRobots marked this pull request as ready for review November 20, 2026 16:58
@indent

indent Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Issues

All clear! No issues remaining. 🎉

2 issues already resolved
  • For every thread reply in a D* channel, meta.CreatePortal becomes evt.User == s.UserID, including ordinary human DMs. If the DM has no Matrix room yet, a reply from the other person is dropped before the pre-handler runs, where before this PR it created the room. (fixed by commit b4e40c7)
    Found by Indent Review Agent
  • The pre-handler fetches the whole thread whenever the root isn't in the DB, before knowing it's an assistant thread. This is a rate-limited API call inside the portal event loop for every such reply. On fetch failure it returns nil, so bot replies in never-posted-in assistant threads get bridged anyway. (fixed by commit b4e40c7)
    Found by Indent Review Agent

CI Checks

All required CI checks passed on 673bfe9.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No remaining issues found
Full results

Indent Review Agent

  • Summary: No remaining issues found
  • Last ran on commit: 673bfe96
  • Latest result
    {
      "summary": "No remaining issues found",
      "findings": []
    }

Comment thread pkg/connector/handleslack.go Resolved
Comment thread pkg/connector/handleslack.go Resolved
@indent
indent Bot requested a review from tulir November 23, 2026 13:25
…app-thread

# Conflicts:
#	pkg/connector/client.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant