Files
plugins/packages/factory/testdata
yetone bb849910ac factory 0.1.50: tools Factory refuses by name go out under droid's names, so dsh is not refused
@a1pha1nthefog on X (2026-11-19): dsh (DeepSeek Harness) through magpie on
Factory got "This request was blocked by Factory's usage policy check"
(content_policy_rejected) on its first turn, the user message "1". It reads
like dsh's prompt or skills are blocked, but they are not. Since 2026-11-18
Factory refuses any request that declares a tool under certain exact names,
on every route (#1291, #1306), and dsh 0.2.1 declares six of them: bash,
read, write, edit, glob and grep. It is the request's tool names, not the
account, the model, or dsh's prompt text.

This takes heggria's #1314 (closed unmerged) with credit: tool-names.mjs
declares such a tool under droid's own name for the job (Execute, Read,
Create, Edit, Glob, Grep, Task) or, when droid has none or the request
already declares that name, under its own name with a per-process suffix.
It renames earlier calls, tool_choice, allowed_tools and Gemini's function
names to match, and gives the caller its own names back in JSON and SSE
replies. Only name fields change: descriptions, schemas, arguments and the
prompt go as dsh wrote them. On top of #1314, agent, Shell and StrReplace,
which #1291 also saw refused on 11-18, are in the list, and
testdata/dsh-0.2.1-chat.json is dsh 0.2.1's real first request (captured
as it left dsh in a sandbox HOME, then sanitized), tested on chat
completions and on Messages.

Co-authored-by: heggria <34475327+heggria@users.noreply.github.com>

Run (mote, at 140c513b plus this change): HOME=$(mktemp -d) bun test is
9112 pass, 20 skip, 0 fail (9132 tests, 639 files); bun test
packages/factory is 216 pass; bun scripts/check.mjs factory passes.
Real dsh 0.2.1 in its sandbox HOME, run headless against the plugin's fetch
with a fake Factory that refuses the 11-18 names: it declared Execute, Edit,
Glob, Grep, Read and Create, its Execute call came back as bash, dsh ran
"echo dsh-ran-$((6*7))" and the fake saw "dsh-ran-42" in the tool result.

Broken by hand: with aliasToolNames taken out of send(), 12 of
tool-names.test.mjs's 14 tests fail, both dsh ones among them.

Not tried: a real Factory account. None is here, so Factory's own answer to
the renamed request is not seen. dannykkg reported #1314's renames
accepted with a real account (magpie#6994, 11-19).
2026-11-19 16:48:10 +08:00
..