Files
liangmouse 16769b21dc joycode 0.2.7: an empty or unterminated Responses stream is an error, not a silent success (liangmouse, #720)
JoyCode's Responses SSE is checked one event at a time, never buffered whole:

- a JoyCode FAILED_RESPONSE envelope (code non-zero) becomes a Responses
  "error" event that keeps its code, message and cause; anything after it
  is dropped;
- a response.completed with no output seen and none in its output list
  becomes error empty_response (an unreadable completed frame too);
- EOF with no completed, incomplete, failed or error event becomes error
  incomplete_response;
- text, refusals, tool and *_call items, reasoning with a summary or
  encrypted content, and explicit incomplete/failed pass byte for byte,
  CRLF included. A completed with no [DONE] after it passes as it came.

magpie's gateway reads a Responses "error" event as a failed turn and owns
the retries; the plugin sends no request of its own. Tests that called
t.mock.method(fetch) several times in one test leaked the mock under Bun
(copilot's tests got "Body already used"); each fixture is its own test now.

Run at the reviewed head 7b74d0c (main d9a6c45 plus this PR, Bun 1.4.4
38afee6c8, CI's version):
- Linux (WSL magpie-desktop), fresh HOME: bun test 5501 pass, 18 skip,
  0 fail; bun scripts/check.mjs ok.
- macOS (mote): bun test packages/joycode 94/94; node --test
  packages/joycode/*.test.mjs 100/100; joycode chat + copilot in one Bun
  process 104 pass, 0 fail (53bf359 alone: 4 fails, "Body already used").
- Broken by hand: index.mjs back to 0.2.6 with the new tests, the 4
  behaviour tests go red; payload.response without ?. , the malformed
  completed test goes red (Bun and Node).
- Probes through loader.fetch: completed without [DONE] or a trailing
  blank line, completed then [DONE], and a double-wrapped full stream pass
  untouched; [DONE] alone, a comment alone, created + [DONE] and a delta
  cut mid-line each end in one incomplete_response.

Not tried: a real JoyCode account (the author ran GPT-6 Astra through
magpie 0.1.2392).
2026-11-04 19:18:48 +08:00

35 lines
3.1 KiB
JSON

{
"name": "@magpie-community/opencode-joycode-auth",
"version": "0.2.7",
"description": "OpenCode provider plugin: JoyCode (JD Cloud JoyCoder IDE credits)",
"type": "module",
"main": "./opencode.mjs",
"exports": { ".": "./opencode2.mjs" },
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/joycode"
},
"scripts": {
"test": "bun test"
},
"files": [
"index.mjs",
"opencode.mjs",
"opencode2.mjs",
"README.md",
"CHANGELOG.md",
"icon.png"
],
"keywords": [
"opencode",
"opencode-plugin",
"joycode"
],
"license": "MIT",
"magpie": {
"maxConcurrency": 4,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEk0AABJNAfOXxKcAAAa5SURBVFhH7ZhpUFVlGMf1QzX1IRzl3vdsLMIlFQ0tRAXNBSNKRExx15Rppi9OGmbpZE46SiAiKdi4hAjoNCM1zliDmoosYmoCpuICyiLKJrIKLjD6b54H700PiygXv+gz88yFc97zvr/zrO95e/R4JS+59OzTx04RQh2nKNpMSVLnWUNpLoNBHmljY9OL1tAv2ikRQhiFUL4RQj0jhFIvSUqTNVUIpUYI9YAQykRXV9fX9et3KEaj0UmS1EQhlHuSpKI7VQj1liyraxRF6aPnaFPIcgQnSUqzfrLu0keG+EXTtN56Hr30lCRlqRDKXf0kz6JCKNA0ezg7vwNZ1vh//Ri9CqE2CqEF6YGeEFtbW1kINVv/8LMowXh4DEdERCSSk49i2bLl0DSHVuPa0T979+79tp7LIpKkjRFCqWvjwaeq0Sjz79Sp03DixEk0NjaioaEBFRU34ek5srNWzFVV1UXPZREhlBktWdb64faUXOjk5IIJE/wQGxuH8vJyZGdnIzh4CWJiYtHYeAc+Ph9bXqBjVW7Isuyu57KILGtzOgtIFnFwcMKUKYGIi0vA9evX8fDhQ2RmZsHPbxKDb9jwE+7ceSbAEknSPPRcFnkWwBEjvBjg0qXLKC0tRVNTEyorK/nvPXsSMWnSZERHb2ZXv1BARbFDUNDnOHv2HKqqqpGQkIAVK75HdXU1tmzZipUrf0BBQSHy8wuQm5uHhoZGjB//0YsBJLdOmOCPgoIClJaWYfHiYPTta8LkyVPYeiEhoTyO3J6amspWbW5uxtKl38LOzqET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