clarify: a parked question belongs to the conversation that was asked (V-466)
The clarify store had one key for the whole daemon, so a question asked in the web chat and never answered captured the next three utterances from any source — telegram, or the mic — and answered them against a request the speaker never made. The reach now supplies a conversation id on the IPC Chat call, and the daemon carries it on the context the way it already carries the correlation id, so the six clarify call sites read it instead of a constant. The mic has no id of its own and keeps the key it had, so voice behaves exactly as before. mavweb has no per-browser session, so every tab is one conversation: right for a single-owner box, and still distinct from telegram and the mic. Dialogue sessions stay global on purpose — they are what she remembers about him, not what she is waiting for from one channel.
This commit is contained in:
@@ -77,7 +77,7 @@ func (f *fakeCore) MCPServers(context.Context) ([]ipc.MCPServerStatus, error) {
|
||||
return f.mcpServers, f.mcpErr
|
||||
}
|
||||
|
||||
func (f *fakeCore) Chat(_ context.Context, text string) (string, error) {
|
||||
func (f *fakeCore) Chat(_ context.Context, _, text string) (string, error) {
|
||||
f.chatText = text
|
||||
if f.chatErr != nil {
|
||||
return "", f.chatErr
|
||||
|
||||
+7
-1
@@ -1678,7 +1678,13 @@ func handleChatAPI(w http.ResponseWriter, r *http.Request, core ipc.CoreAPI, ses
|
||||
http.Redirect(w, r, "/chat", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
reply, err := core.Chat(r.Context(), text)
|
||||
// One conversation id for the whole web chat, and a different one from
|
||||
// telegram or the mic. A parked question belongs to the reach that was
|
||||
// asked; before this, a clarify nobody answered on the web ate the next
|
||||
// utterance spoken at the mic (Vikunja #466). This server has no
|
||||
// per-browser session, so every browser tab is the same conversation —
|
||||
// which is right for a single-owner box.
|
||||
reply, err := core.Chat(r.Context(), "web", text)
|
||||
if err != nil {
|
||||
log.Printf("chat api: %v", err)
|
||||
http.Redirect(w, r, "/chat", http.StatusSeeOther)
|
||||
|
||||
Reference in New Issue
Block a user