feat(gchat): option to keep threads in direct messages
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
Start in the Google Chat adapter's handleMessageEvent, where DM messages are mapped to a thread ID, and compare with how the Slack adapter's agentView handles DM thread roots. Check how the proposed threadedDMs flag would alter the :dm ID and whether openDM() subscriptions still match. Done means that with the option on, a new DM thread gets its own ID and reply, the default behaviour is unchanged, and the option name is settled with maintainers first.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem Statement
In a Google Chat direct message, the Google Chat adapter maps every message to one space-only thread ID (gchat:spaces/DM_SPACE:dm) and drops message.thread.name. A DM is therefore one endless conversation for the bot: replies always go to the top level, and a user who starts a new thread in the DM (Google Chat supports threads in DMs) still lands in the same conversation and memory as everything before it.
The Slack adapter handles this differently. In a Slack DM, a reply inside a thread keeps its thread_ts, so it stays a separate conversation, and agentView: true makes every top-level DM message its own thread root, while still routing to the openDM() subscription when that one is subscribed. Google Chat has no equivalent, so the same bot behaves differently on the two platforms.
We build internal agents for colleagues (one case = one thread) and work around this today by replacing the adapter's handleMessageEvent with a copy that keeps the thread name for DMs. That copy breaks with every adapter change.
Proposed Solution
An adapter option, for example threadedDMs: true (name open), with which a DM message is encoded with its thread name, like messages in spaces:
const threadName = isDM && !this.threadedDMs ? undefined : message.thread?.name || message.name;
with the :dm marker kept so thread.isDM stays true. Like Slack's agentView bridge, a message could route to the space-only ID when that ID has a subscription from openDM(), so proactive flows keep working.
Default stays as today, so nothing changes for existing users.
Alternatives Considered
- Overriding
handleMessageEventin our own code (what we do now): works, but depends on adapter internals. - Making thread-aware DMs the default: closer to Slack's default (thread replies keep
thread_ts), but changes behaviour for existing bots.
Use Case
import { createGoogleChatAdapter } from '@chat-adapter/gchat';
const gchat = createGoogleChatAdapter({
// ...
threadedDMs: true,
});
// A new thread in a DM -> its own thread ID, its own conversation and memory;
// the bot's reply goes into that thread instead of the top level.
Priority
Important
Contribution
- I am willing to help implement this feature
Additional Context
Related: #1135 (card clicks in a DM get a different thread ID than the DM's messages). With this option, a click and the messages of the same DM thread would both carry the thread name, which also removes the mismatch described there for threaded DMs.
The Teams adapter has no equivalent, but Teams 1:1 chats have no reply threads, so there is nothing to keep there.
- Lingua principale
- TypeScript
- Stelle
- 2.5k
- Fork
- 355
- Merge medio
- 2g 15h
- PR unite (30g)
- 42
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel/chat
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
X and Twitch: paragraphs inside a block quote are joined with no spaceForse già presa @abhiramshaji-cyber l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
feature request needs triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 69/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
HarperFast/symphony#91 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
solidjs/solid-docs#1716 ·
I maintainer di solito rispondono entro 1 giorno