Merge the seam log line (V-483)

This commit is contained in:
2026-08-05 13:52:41 +04:00
+10 -2
View File
@@ -159,21 +159,28 @@ func (p *Pair) set(up bool) {
// admission answer is a cache and can be one interval out of date, so an error // admission answer is a cache and can be one interval out of date, so an error
// here is expected rather than exceptional. // here is expected rather than exceptional.
// //
// This is the silent half of the degradation rule. It must be indistinguishable // This is the silent half of the degradation rule: he is not told which model
// from today's behaviour when the workstation is down. // phrased his reply. The log is told, one line per call, because the seam was
// otherwise unreadable after the fact — the transition lines say the card was
// free at 11:27, not which side answered the turn at 13:24. QA had no way to
// tell an offloaded turn from a floor one.
func (p *Pair) Complete(ctx context.Context, r Req) (string, error) { func (p *Pair) Complete(ctx context.Context, r Req) (string, error) {
if p.floor == nil { if p.floor == nil {
return "", ErrNoFloor return "", ErrNoFloor
} }
why := "workstation down"
if p.Available() { if p.Available() {
out, err := p.remote.Complete(ctx, r) out, err := p.remote.Complete(ctx, r)
if err == nil { if err == nil {
log.Print("llm: served by the workstation model")
return out, nil return out, nil
} }
// The cached answer was wrong. Correct it now rather than sending the // The cached answer was wrong. Correct it now rather than sending the
// next request into the same hole, then fall back. // next request into the same hole, then fall back.
p.set(false) p.set(false)
why = "workstation failed mid-request"
} }
log.Printf("llm: served by the resident model (%s)", why)
return p.floor.Complete(ctx, r) return p.floor.Complete(ctx, r)
} }
@@ -189,5 +196,6 @@ func (p *Pair) CompleteRemote(ctx context.Context, r Req) (string, error) {
p.set(false) p.set(false)
return "", errors.Join(ErrRemoteUnavailable, err) return "", errors.Join(ErrRemoteUnavailable, err)
} }
log.Print("llm: served by the workstation model, no floor for this caller")
return out, nil return out, nil
} }