atomcode 0.3.1: send x-atomcode-session-id (#1185)

AtomCode's glm5.3-flash group answers 403 "access disabled by request policy" when a request has no x-atomcode-session-id (#1186). The plugin now sends one:
- chat.headers fills it with the session id of the conversation the agent is in;
- the loader falls back to one random UUID per signed-in account when the hook didn't run or the session is empty.
Version 0.3.1.

Run at bbdbcc7a, with no atomcode changes on main since its base:
- `bun test packages/atomcode` on mote: 164 pass, 0 fail.
- `bun scripts/check.mjs atomcode`: ok.

Broken by hand: with main's index.mjs and the PR's tests, run on mica, 3 tests fail (header and signature, per-account stability, chat.headers). The other 161 pass.

Not tried: the live AtomCode gateway. The author's probes compare the same request with and without the header (200 against 403).

Co-authored-by: aqiu817 <19250671+aqiu817@users.noreply.github.com>
This commit is contained in:
aqiu817
2026-11-15 23:16:33 +08:00
committed by GitHub
co-authored by aqiu817
parent 735e83e621
commit fc0c5a882e
4 changed files with 142 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/opencode-atomcode-auth",
"version": "0.3.0",
"version": "0.3.1",
"description": "AtomCode (AtomGit CodingPlan) for Magpie and OpenCode: browser OAuth or local CLI sign-in, signed requests, persistent diagnostics, native plan claim, live models and quota windows",
"type": "module",
"main": "./opencode.mjs",