When Loomy answers 400, 413 or 422 with a body that says the content is too long (内容太长了 / 内容过长), the plugin now rewords that body to 上下文超出长度限制, the phrase magpie's too-long matcher recognises. The status code is kept. magpie then treats the reply as a context-length refusal and tries a model with a longer window, where before it gave up on the request. The rewrite is in retryableRefusal() and runs on the loader's !res.ok path. fake.mjs gains chatRefusal. Version 0.1.0 -> 0.1.1.
Reviewed at 2bb41e0 (Mac mini, Bun 1.4.2, through mote-run, sandbox HOME):
- Repo suite (`HOME=$(mktemp -d) bun test`): 3813 pass, 8 skip, 0 fail.
- `bun scripts/check.mjs`: exit 0.
- Broken by hand: with retryableRefusal returning null, 3 loomy tests go red (the over-length Kimi-k2.6 chat test, the 400 rewrite, and the 413/422 cases). They pass again once it is restored.