mirror of
https://github.com/chenhg5/cc-connect.git
synced 2026-07-03 12:28:10 +08:00
When a Slack app has the Agent/Assistant toggle on, users get a 'Chat' tab
in the app sidebar (a dedicated assistant_thread). Messages typed there
arrive as message.im events with ThreadTimeStamp set to the assistant
thread's root ts.
Before this patch, cc-connect's Reply() and Send() ignore that thread_ts
(MsgOptionTS is a no-op on chat.postMessage; Send didn't pass it at all).
Replies thus went to the DM root, surfacing in the 'History' tab feed
rather than the Chat tab — breaking the conversational UX for any bot
configured as an Agent/Assistant.
Changes:
- New helper assistantOrThreadTS() returns ev.ThreadTimeStamp if present
- MessageEvent handler uses assistantOrThreadTS() for replyContext
- Reply() switched from MsgOptionTS (chat.update only) to
MsgOptionPostMessageParameters{ThreadTimestamp} (real thread reply)
- Send() now also includes ThreadTimestamp when present (engine often
falls back to Send when streaming preview is unavailable)
- New AssistantThreadStartedEvent handler logs the event + sets initial
status (informational; Reply path does the actual routing)
Tested against a live Donna Slack app with Agent enabled — replies now
land in Chat tab as expected.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
61 lines
2.4 KiB
Modula-2
61 lines
2.4 KiB
Modula-2
module github.com/chenhg5/cc-connect
|
|
|
|
go 1.25.0
|
|
|
|
require (
|
|
github.com/BurntSushi/toml v1.6.0
|
|
github.com/bwmarrin/discordgo v0.29.0
|
|
github.com/charmbracelet/bubbles v1.0.0
|
|
github.com/charmbracelet/bubbletea v1.3.10
|
|
github.com/charmbracelet/lipgloss v1.1.0
|
|
github.com/creack/pty v1.1.24
|
|
github.com/go-telegram/bot v1.20.0
|
|
github.com/gorilla/websocket v1.5.0
|
|
github.com/larksuite/oapi-sdk-go/v3 v3.5.3
|
|
github.com/line/line-bot-sdk-go/v8 v8.19.0
|
|
github.com/mdp/qrterminal/v3 v3.2.1
|
|
github.com/open-dingtalk/dingtalk-stream-sdk-go v0.9.1
|
|
github.com/robfig/cron/v3 v3.0.1
|
|
github.com/slack-go/slack v0.16.0
|
|
github.com/stretchr/testify v1.9.0
|
|
modernc.org/sqlite v1.49.1
|
|
rsc.io/qr v0.2.0
|
|
)
|
|
|
|
require (
|
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
|
github.com/charmbracelet/colorprofile v0.4.1 // indirect
|
|
github.com/charmbracelet/x/ansi v0.11.6 // indirect
|
|
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
|
|
github.com/charmbracelet/x/term v0.2.2 // indirect
|
|
github.com/clipperhouse/displaywidth v0.9.0 // indirect
|
|
github.com/clipperhouse/stringish v0.1.1 // indirect
|
|
github.com/clipperhouse/uax29/v2 v2.5.0 // indirect
|
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
|
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
|
|
github.com/gogo/protobuf v1.3.2 // indirect
|
|
github.com/google/uuid v1.6.0 // indirect
|
|
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
|
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
github.com/mattn/go-localereader v0.0.1 // indirect
|
|
github.com/mattn/go-runewidth v0.0.19 // indirect
|
|
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
|
|
github.com/muesli/cancelreader v0.2.2 // indirect
|
|
github.com/muesli/termenv v0.16.0 // indirect
|
|
github.com/ncruces/go-strftime v1.0.0 // indirect
|
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
|
github.com/rivo/uniseg v0.4.7 // indirect
|
|
github.com/stretchr/objx v0.5.2 // indirect
|
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
|
golang.org/x/crypto v0.48.0 // indirect
|
|
golang.org/x/sys v0.42.0 // indirect
|
|
golang.org/x/term v0.40.0 // indirect
|
|
golang.org/x/text v0.34.0 // indirect
|
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
modernc.org/libc v1.72.0 // indirect
|
|
modernc.org/mathutil v1.7.1 // indirect
|
|
modernc.org/memory v1.11.0 // indirect
|
|
)
|