GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — pm-dispatch(opencode): auth-file and API-response JSON parsed unguarded — null/malformed state file escapes as raw Type/SyntaxError, non-string password silently coerced into the credential · Issue #7085 · developing-today/code Closed Labels app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DescriptionProblem
Evidence (verified this run, laptop primary main
|
| Case | Observed |
|---|---|
control {"password":"pw123"} + {"data":{"id":…}} |
resolves, session id returned |
control {} (no password) |
OpenCodeError: opencode auth file carries no password (the intended vocabulary) |
auth file null |
raw TypeError: null is not an object (evaluating 'data.password') — not an OpenCodeError |
auth file {not json (truncated/mid-write state file) |
raw SyntaxError: JSON Parse error — not an OpenCodeError |
auth file {"password":12345} |
request succeeds: the number is string-coerced into the Authorization: Basic credential |
auth file {"password":{"x":1}} |
request succeeds: the credential sent is the literal [object Object] string |
valid auth + HTTP 200 non-JSON body (<html>…, e.g. the wrong service answering on the OpenCode port) |
raw SyntaxError: JSON Parse error: Unrecognized token '<' — not an OpenCodeError |
There is no test file for this client at all: pm-stack/dispatch/test/ covers auth/config/packet/queue/server/validate/launch_*, but no opencode.test.ts exists.
service-prod.json, config.ts opencodeAuthFile), read on every API call. A truncated or mid-write read, a hand-edited file, or a schema drift in what the server writes turns every dispatch launch into a raw crash whose message names no file and no cause; the dispatch handler (server.ts) only special-cases Auth/Validation/Queue errors, so these surface as generic 500s / launch-failure notes instead of the client's diagnosable 502 shape.id type; createSession itself validates the returned session id at opencode.ts:61-64) — the auth file and the 2xx body are the two unguarded doors in the same file.authHeader(): malformed JSON, a non-object document (null/array/scalar), and a missing, non-string, or empty password all throw OpenCodeError naming the auth file / the shape problem — never a raw TypeError/SyntaxError, and a non-string password is never coerced into a credential.api(): a 2xx response whose body is not valid JSON throws OpenCodeError naming the method/path — never a raw SyntaxError.pm-stack/dispatch/test/opencode.test.ts pins all of the probe cases above (valid control still resolves; {} control still yields the existing no-password OpenCodeError).bun test in pm-stack/dispatch).Found by new-issue-creator-code-b (Lane B), run 2026-11-07 20:50 CST. Dedup: searched open + closed issues for OpenCodeClient / "opencode auth" / dispatch opencode parsing — no existing issue covers this client; #3009 (orphaned session) and #3010 (body-cap units) are different defects in different files.
🤖 Agent note · filed
🤖 Agent note · picked up
Merge pull request #7088 from developing-today/creator-b/7085-opencod…
🤖 Agent note · done