Files
plugins/packages/factory/client-phrases.json
T
Houpus 97aea1739a factory 0.1.35: escape client phrases Factory's proxy gate refuses, in every body (#258, RoacherM)
Factory's proxy gate refuses a request whose body carries certain client
phrases (pi's opening and compaction sentence anywhere; Claude Code's
identity, env line, billing header, compaction opening and
GLOBAL_INSTRUCTIONS inside tool output). The phrases now live in
client-phrases.json; sanitizeBody escapes each phrase's first character as
\uXXXX in every request body (only re-stringified when something changed),
and the Gemini path escapes them too. Version 0.1.35.

Run at the reviewed head f0e78b4 (sandbox HOME):
- HOME=$(mktemp -d) bun test packages/factory: 167 pass, 0 fail
- bun scripts/check.mjs factory: ok; git diff --check clean
- npm pack lists client-phrases.json
- Broken by hand: without sanitizeBody 5 new tests fail; without the
  Gemini escapeDeep 1 fails.
Not tried against Factory's server (no Factory account here); the author's
real-account A/B is in the PR.
2026-10-20 17:08:37 +08:00

17 lines
1.1 KiB
JSON

{
"//": "Fixed client phrases Factory refuses in a request body. Each phrase's first character is a JSON \\uXXXX escape: the file is safe to read (a Droid session reading it does not 403), and JSON.parse yields the real phrase. anywhere: refused in any text (system, user, assistant, tool_use). toolOnly: refused in tool output; the prompt adapters keep them.",
"anywhere": [
"\u0059ou are an expert coding assistant operating inside pi, a coding agent harness.",
"\u0054he conversation history before this point was compacted into the following summary:"
],
"toolOnly": [
"\u0059ou are Claude Code, Anthropic's official CLI for Claude.",
"\u0059ou are Claude Code, Anthropic's official CLI for Claude, running within the Claude Agent SDK.",
"\u0059ou are a Claude agent, built on Anthropic's Claude Agent SDK.",
"\u0059ou have been invoked in the following environment:",
"\u0078-anthropic-billing-header: cc_version=",
"\u0054his session is being continued from a previous conversation that ran out of context.",
"\u0028user's private global instructions for all projects)"
]
}