the reply seam takes the turn's context (V-638)

voice.Replier.Reply had no context, so llmReplier phrased under
context.Background() and the only bound on a reply was phraser.timeout,
60s in deploy. Both call sites already held a context.

The stub ignores it: it makes no model call.
This commit is contained in:
2026-08-06 22:50:38 +04:00
parent 661b5c1099
commit 1607009215
5 changed files with 18 additions and 13 deletions
+7 -2
View File
@@ -26,6 +26,8 @@
package voice
import (
"context"
"github.com/kami/maven/internal/phraser"
"github.com/kami/maven/internal/router"
)
@@ -38,8 +40,10 @@ import (
// decision's Intent + Slots + Clarify. The Intent largely names the reply
// shape (act/reminder/fact/note/query/clarify); the Slots carry the
// specifics that personalise it ("got it: water at 14:00").
// The context is the turn's, and it is the only bound an LLM-backed impl has
// besides the phraser timeout (V-638). A floor impl ignores it.
type Replier interface {
Reply(d router.Decision) string
Reply(ctx context.Context, d router.Decision) string
}
// StubReplier — the deterministic, no-model floor. Canned per intent;
@@ -54,7 +58,8 @@ func NewStubReplier() *StubReplier { return &StubReplier{} }
// Reply dispatches on Intent + Clarify. Each branch is short; the LLM impl
// will replace this with prompted text and the same dispatch shape.
func (s *StubReplier) Reply(d router.Decision) string {
// It makes no model call, so the context is unused.
func (s *StubReplier) Reply(_ context.Context, d router.Decision) string {
if d.Clarify {
return "не совсем поняла — можешь переформулировать?"
}