Commit Graph
3 Commits
Author SHA1 Message Date
William WANG b83e3dee36 factory 0.1.41: ZCode's environment paragraph reaches Factory as runtime context, not refused (#211, William-AIdev)
ZCode embeds its generated environment paragraph, with unindented bullets, inside a larger system prompt. No runtime-context adapter matched it, so "You have been invoked in the following environment:" and "You are powered by the model named" reached Factory unchanged in the system prompt (403). This renames a complete standalone paragraph in system prompts, later system messages and Gemini's system instruction, keeping every value. Also releases factory 0.1.41, which carries #213.

Reviewed at d4ef7d4e; the maintainer commits on top (eb016a4d) merge main b76a577, keep main's Gemini escape test beside this one, expect main's #258 escape in the Gemini user part, add a fenced-paragraph case and bump to 0.1.41.
- On main b76a577, a probe through _internal.droidBody still sends the paragraph unchanged on Responses and Messages; the PR's new tests fail there.
- At eb016a4d: `bun test` in packages/factory (sandbox HOME, on mote): 189 pass, 0 fail. `bun scripts/check.mjs factory`: ok.
- Broken by hand: zcodeRuntimeContext returning its input turns 5 tests red (Responses, Chat, Messages, Gemini, no-Shell). Dropping the insideFence check passed every original test (the fenced inputs never matched); the added fenced case goes red with it, green with it back.
- Not tried: a live Factory account (the PR body records the 403 on all four routes).
2026-10-29 21:09:00 +08:00
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
yetone 60c905410e factory: Gemini 4 Argon and Gemini 3.x reach Factory's own Gemini route (yetone/magpie#2080)
The plugin offered no Gemini model, so Gemini 4 Argon, new in droid
0.241.1's picker, and the Gemini 3.x models magpie's built-in has were
missing for everyone moved onto the plugin.

- Gemini 4 Argon, Gemini 3.1 Pro, Gemini 3.8/3.7/3.6/3.5 Flash and
  Gemini 3 Flash are offered on @ai-sdk/google at /api/llm/g/v1, with
  droid 0.241.1's names, total context 1M, output 65536, efforts and
  images. Each effort is a thinkingConfig thinkingLevel, as the zed
  plugin sends Gemini's.
- send() takes the Google package's models/<id>:streamGenerateContent
  to Factory's /api/llm/g/v1/generate, as the built-in does (pathOf
  Gemini, FactoryGemini): the model in the body, no stream field, the
  system instruction without a role and opened with droid's line like
  factoryDroidGoogle. x-api-provider is google; the Google package's
  x-goog-api-key is dropped. A rewritten body no longer keeps the
  caller's content-length.
- Gemini counts in standard's windows, not Droid Core's, as the
  built-in's factoryCore has it.
- Gemini 4 Argon is behind a Factory feature flag (featureFlag
  Gemini4Argon, unreleased) in droid 0.241.1; an account it isn't on for
  may be refused it.

testdata/droid-0.241.1-gemini.txt is droid 0.241.1's picker and Gemini
entries, byte for byte from @factory/cli-darwin-arm64@0.241.1 bin/droid
(each line checked present in the binary). muse-spark-1.2, also new in
that picker, is not added here.

Run: bun test in packages/factory (130 pass), bun scripts/check.mjs.
Broken by hand: without the route rewrite the three gemini.test.mjs
tests fail; without google in CORE's exclusion usage.test.mjs fails.
Not tried: a real Factory account (none signed in here), so neither
Factory's answer to these bodies nor Gemini 4 Argon's flag was seen.
2026-10-14 14:25:43 +08:00