Files
plugins/packages
yetone e6c457112a factory 0.1.51: dsh's web_search goes out as WebSearch, and a tool set refused for a name not listed yet goes once more renamed in full
@a1pha1nthefog on X (2026-11-19): dsh (DeepSeek Harness) on Factory's
claude-opus-5-5 is still refused (content_policy_rejected) on magpie
v0.1.4532, whose Factory mover installs 0.1.50. 0.1.50 renamed the six dsh
tools on our list, but dsh also declares web_search, and two real accounts
saw Factory refuse web_search, read_file and execute_command the same day,
and every listed name behind leading underscores (_read, _web_search), while
omp_read and WebSearch pass (can1357/oh-my-pi#19553, single-tool probes with
a passing system block). 0.1.50's dsh test passed because its fake Factory
refused only the names the plugin itself listed.

- tool-names.mjs lists web_search, read_file and execute_command (as
  WebSearch, Read and Execute, droid's own names) and refuses a listed
  name behind leading underscores (refusedName).
- Factory adds names without notice, so one more missing name would refuse
  every request again. A 403 content_policy_rejected for a request that
  declares tools now goes once more with every tool renamed (droid's
  names and mcp__ tools kept): if Factory takes it, that tool set goes
  renamed in full for the rest of the process (at most 256 sets kept); if
  it refuses again, the refusal is about the content and is the answer, as
  before. A request with no tools is never sent twice.
- The tests' fake Factory now refuses what real accounts were seen
  refusing (SEEN_REFUSED), apart from the plugin's own list, and dsh's
  first request must be taken on the first try.

Only name fields change, as in 0.1.50: descriptions, schemas, arguments and
dsh's prompt go as written, and replies carry the caller's names back.

Run (mote, at origin/main 5f320200 plus this change): HOME=$(mktemp -d)
bun test is 9139 tests, 0 fail; bun test packages/factory is 220 pass, 0 fail;
bun scripts/check.mjs factory passes. Real dsh 0.2.1-rc.2 headless in a
sandbox HOME against the plugin's fetch, with a fake Factory refusing the
seen names plus web_fetch (standing in for a name Factory adds next): the
first try declared Execute, Edit, Glob, Grep, Read, WebSearch and Create and
was refused for web_fetch; the second went with every tool renamed and was
taken; dsh ran "echo dsh-ran-$((6*7))" through bash and its next turn went
renamed in full at once.

Broken by hand: without web_search, read_file and execute_command in the
list, 5 of tool-names.test.mjs's 18 tests fail, both dsh ones among them;
with the second try taken out, both second-try tests fail.

Not tried: a real Factory account. None is here, so Factory's own answer to
the renamed dsh request is not seen; the refused names come from two real
accounts' probes on 2026-11-19, not ours. Whether Factory reads an
Anthropic server tool's name (web_search_20250305) was not probed; those
keep Anthropic's name.
2026-11-19 18:41:29 +08:00
..
middleware: param-override, model-map, system-prompt, word-guard and think-tags — gateway middleware that magpie runs on every agent's requests and replies, mostly New API's channel settings with the same JSON (the owner) — magpie can now run a plugin as gateway middleware (onRequest, onEvent, onResponse, in-process on moejs), and these are the first ones: param-override is New API's param_override (both forms, operations with gjson paths and conditions, return_error); model-map is model_mapping (chains, /regex/ keys with $1) and puts the asked-for name back into replies; system-prompt adds a prompt in each API's own place, keeping an agent's own unless override (New API's semantics), by agent or model; word-guard is the sensitive-word filter (reject or mask the user's text, optionally replies); think-tags strips a leading <think>…</think> from replies across stream chunks, or puts Chat reasoning_content into the text (thinking_to_content). Each is one file with no imports, named @magpie-community/middleware-<name>, with magpie.options as the example the app's editor starts from; registry.json lists them with "kind": "middleware" and no providers; check.mjs skips middleware-only packages. scripts/middleware.mjs calls the hooks as the gateway does (events split, [DONE] passed by) and runs each package's cases.json. Tested with a real DeepSeek account and real Claude Code through magpie's gateway: a mapped model named back in message_start, max_tokens capped, a system prompt appended for claude only, a word turned away as a 400 in Anthropic's shape, return_error as a 403 in Chat's, <think> stripped from Chat and Responses streams and an Anthropic whole reply, reasoning_content moved into the text. bun test (61 for these five) and bun scripts/check.mjs pass; packages/devin's two image tests fail on this machine only, as on main. Their first npm version has to be published by hand (trusted publishing can't create a package); until then magpie shows them as Coming soon.
2026-10-05 20:49:42 +08:00