With Settings' masking on, a /v1/systemone request went to the decision
model's vendor as the agent wrote it: serveSystemOneBody and
serveDecideTries never called the masker, so a secret or a name in the
state or a question's instructions left unmasked. c7810ea5c then sent a
/v1/decisions request for a System One model down that same path, where
before it went through serveRetrieval, which masks, or was refused.
serveDecideTries, which every System One request reaches (one provider,
a decision group, a translated Decisions request), now masks the body
once before its tries (redactedHits), unless every try goes where the
user set requests to go unmasked (SkipsRedaction), as embeddings do. A
masker that fails, or is wanted and missing, sends nothing (maskStatus).
The answer is restored on its way back, the mask is recorded as
"systemone" in Settings › Privacy and on the route, and Recent calls
keeps the body as it went. systemOneByDecisions still masks in
serveRetrieval, before this point, so nothing is masked twice.
Run (mote, at c7810ea5c + this change):
- go test -timeout 45m ./internal/gateway ./internal/redact ./internal/maskrec: ok (gateway 811s)
- GOOS=linux and GOOS=windows go vet ./internal/gateway: ok
- gofmt -l: clean
Broken by hand: with the decide_group.go change stashed,
TestSystemOneMasked/systemone and /decisions fail (secret sent whole);
the two unmasked cases pass on both.
Not tried: a real decision vendor (Bailian, Jev) with masking on.