treeMan on Discord: with masking on, weaker models refuse to search
with a {{NAME_xxxxxxxx}} placeholder, ask to verify it, or rewrite it as
"an example name", which breaks long tasks. A request in which masking
swapped a value (maskHits.n > 0) now carries one short note, on each try:
Values written like {{NAME_ab12cd34}} are placeholders for real values.
Use them exactly as written, in replies and in tool calls alike: they
are filled in with the real values before anything runs. Don't ask to
verify them, and don't replace them with examples.
It names neither magpie nor a vendor or client (TestPlaceholderNoteIsNeutral
fails on magpie, Codex, Claude, a vendor's name, "provider", "gateway"...).
Its example uses a '1', outside the placeholder alphabet, so it is never
taken for a real placeholder or restored.
Where: where placeholders first appear, so it is new text the first time
and the same text on every later turn (the cached prefix holds). In the
instructions when they or the tools hold one (Anthropic system's last
block, Chat's first system/developer message, Gemini systemInstruction's
parts); otherwise on the earliest message that holds one, as a block or
part after its content (a string content becomes [text, note] blocks on
Anthropic, a paragraph on Chat), and on Responses as a developer message
after that item and the tool outputs following it. Responses
`instructions` (Codex's base_instructions) is never touched. A note
appended after text starts with a blank line, so a translator that joins
blocks (Anthropic to Chat) keeps it apart from the user's words.
Not added:
- a Claude subscription: the bridge puts the caller's instructions into
the run's first message, which Anthropic classifies; text added there is
risk for no gain;
- a ChatGPT/Codex sign-in (Account.Agent codex); Codex's own turns on
codexUpstreamOn don't pass this loop either;
- a Responses turn with previous_response_id: the note would pile up in
the stored conversation.
count_tokens counts without it.
A first version put the note in the system prompt. The full suite showed
TestMaskedConversationKeepsItsCachedPrefix red (a secret first found in a
tool output changed the system at turn 1 and rewrote the cache), hence
the first-appearance placement.
Run (mote, through mote-run):
- go test ./internal/gateway ./internal/redact -run
'TestPlaceholderNote|TestMaskedRequestTold|TestMaskedConversation|
TestUnredacted|TestRedacted|TestMask|TestMiddlewareThroughGateway': ok.
- Full suite at 46bdbad8f (-timeout 45m, log kept whole): red in
internal/gateway TestMiddlewareThroughGateway (mine: its fake echoes the
last message, which now holds the note; the fake strips it now), and
five tests red alone on origin/main cc81ad4ea too, filed as #4362
(TestAntigravityTurnsCodexsGPT5ThreadAwayOnce, TestAntigravityTurnedAway*,
TestCodexSpentGrokFailingIsTold); internal/gui TestMainWindowCorners
(#3949). Every other package ok.
- At 79c6a487c (this change on cc81ad4ea): go test -timeout 45m
./internal/gateway ./internal/redact ./internal/masking/...: redact and
masking ok; gateway red only in the five #4362 tests.
- go vet ./internal/gateway ./internal/redact on macOS, CGO_ENABLED=0
GOOS=windows go vet ./... on mote, go vet of both in WSL (Linux): ok.
(CGO_ENABLED=0 GOOS=linux go vet ./... stops in wails' menu_linux.go on
main too, so Linux was vetted natively.)
Broken by hand:
- note always in Anthropic's system (`if true ||`):
TestMaskedConversationKeepsItsCachedPrefix, TestPlaceholderNotePlaces,
TestMaskedRequestTold and the TestUnredacted* echo tests red.
- wiring off in serve: TestMaskedRequestTold red.
- the claude/previous_response_id skips removed:
TestPlaceholderNoteNotOnClientPaths red.
Not tried: no real vendor or weak model was run with the note, so whether
it stops the refusals treeMan saw is not measured; no real Claude
subscription or Codex sign-in request (both skipped by design).