GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400 · Issue #2938 · developing-today/code

clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400 #2938

New issue
Copy link
New issue
Copy link
Closed
#4449
Closed
clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400#2938
#4449
Copy link
Assignees
dezren39
Labels
app/clef-proxybin/clef-proxy.mjseffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Oct 31, 2026
Issue body actions

Summary

bin/clef-proxy.mjs is held up in #2816 as one of the two proxies that
already handle non-object JSON bodies correctly — the oracle the other
seven are to copy. Its guard does not actually reject arrays:

// bin/clef-proxy.mjs:211 (main 16bae8ea)
if (!body || typeof body !== 'object') { /* 400 */ }

typeof [] === 'object', so a JSON array body passes the guard. The
handler then reads body.model / body.state / body.questions off the
array (all undefined) and fabricates an upstream Clef call with the
default model and the payload { state: {}, questions: {} } — the same
fabrication class #2821 filed for antigravity-direct, in the one proxy
#2816's fix is most likely to skip because its body text calls clef
already-correct (its acceptance bullet 4 even says "no behaviour change
for ... the guarded clef / opencode-route proxies").

The sibling oracle gets this right: opencode-route-proxy.mjs:659-660
defines isPlainObject as
typeof v === "object" && v !== null && !Array.isArray(v). Clef is the
only bin/*-proxy.mjs handler using the bare typeof guard (grep over
bin/*.mjs, this run).

Evidence (verified this run, main 16bae8ea)

Probe on the laptop (~/git/fleet/probe-2026-10-30-laneB-clefarray/,
real clef-proxy.mjs + proxy-port.mjs, md5-identical to main —
clef-proxy 5e55c6637574d1c69c143bd4430bc030), proxy spawned on a
scratch port with a dummy CLOUDFLARE_API_TOKEN, POST /v1/systemone:

body result
[] HTTP 401 from the upstream call — i.e. NOT a 400: the proxy fabricated {state:{}, questions:{}}, called the Cloudflare gateway with the default model, and relayed its auth error
[1,2] same 401 upstream relay
{} (valid control) same 401 upstream relay — the array responses are indistinguishable from a valid empty-object request
"hello" HTTP 400 "Invalid JSON body: expected an object"
null HTTP 400 (the #2816 case — this part of the guard works)
42 HTTP 400

Process stayed alive throughout (this is a fabrication bug, not the
#2816 crash).

Why it matters

  • A client bug or stray probe that POSTs an array gets a real upstream
    Clef execution attempted with a defaulted model and empty
    state/questions, and the response it gets back (an upstream
    status/error) points at Cloudflare, not at its own malformed request.
  • Process-of-record risk: bin proxies: a JSON null body crashes seven chat proxies — parse succeeds, first deref throws, process exits 1 (clef and opencode-route already 400) #2816's evidence names clef as the pattern to
    copy. If its fix lands by copying clef's guard shape — or by skipping
    clef per its "no behaviour change" bullet — the array hole is
    cemented into whichever proxies adopt the bare typeof check, and
    bin proxies: a JSON null body crashes seven chat proxies — parse succeeds, first deref throws, process exits 1 (clef and opencode-route already 400) #2816 closes with this still live. This issue exists so clef is in
    somebody's evidence set; if the bin proxies: a JSON null body crashes seven chat proxies — parse succeeds, first deref throws, process exits 1 (clef and opencode-route already 400) #2816 PR fixes clef too, close this
    as completed by that PR and say so.

Acceptance criteria

  • POST /v1/systemone (and /systemone, /) with a JSON array
    body returns the proxy's existing 400 "expected an object" error
    before any upstream call is attempted; null, string, and
    number bodies still 400; object bodies are unchanged.
  • The guard matches the opencode-route-proxy.mjs isPlainObject
    semantics (plain object only), or an equivalent shared check —
    triage pins whether clef imports/copies it.
  • A regression test in bin/clef-proxy.test.mjs (existing harness
    style): array body → 400 and no upstream fetch attempted;
    object-body control still reaches the upstream path.
  • Cross-check bin proxies: a JSON null body crashes seven chat proxies — parse succeeds, first deref throws, process exits 1 (clef and opencode-route already 400) #2816's PR when it lands: any proxy that adopted a
    bare typeof body !== 'object' guard gets the same array test.

Dedup checked this run: open/closed search for "clef array",
"clef-proxy body" — no hits. #2816 covers the seven crashing proxies
and names clef as a correct oracle (its secondary note mentions array
bodies only for design-code's dispatch); #2821 is antigravity-direct,
a different file outside the bin proxy set.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued queue task
    effort/xsTrivial: expected under 30 minutes of work
    app/clef-proxybin/clef-proxy.mjs
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b (new-issue-creator job, Lane B)
    • Session / ID: cron new-issue-creator-code-b, run 2026-10-31T03:50Z
    • Found via: filed this run
    • Task: Filed this issue after verifying on the laptop that clef-proxy's non-object guard (bin/clef-proxy.mjs:211) passes JSON array bodies, which fabricate an upstream Clef call instead of returning 400 — despite bin proxies: a JSON null body crashes seven chat proxies — parse succeeds, first deref throws, process exits 1 (clef and opencode-route already 400) #2816 naming clef as the correct oracle. Queued a triage packet for routing.
    • Expectation: effort/xs — triage pins the guard shape (match opencode-route's isPlainObject) and routes the fix; if bin proxies: a JSON null body crashes seven chat proxies — parse succeeds, first deref throws, process exits 1 (clef and opencode-route already 400) #2816's PR fixes clef too, close this as completed by it.
    • Links: probe laptop ~/git/fleet/probe-2026-10-30-laneB-clefarray/ · related: bin proxies: a JSON null body crashes seven chat proxies — parse succeeds, first deref throws, process exits 1 (clef and opencode-route already 400) #2816, antigravity-direct: a non-object JSON body is never a 400 — 'null' 500s at body.model, and scalar/array bodies fabricate an empty upstream request for model '-medium' and return 200 #2821
  3. github-actions
    assigned
    dezren39
    on Oct 31, 2026
  4. dezren39
    added a parent issue on Oct 31, 2026
    • Design: parsed is not validated — one shape contract at every JSON trust boundary #3068
  5. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Oct 31, 2026
  6. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Design-architect pass 26 (2026-10-31) — agent note: this issue is adopted as part of Phase 1 of design #3068 ("parsed is not validated"). Triage: do NOT re-file, re-scope or split it — record the phase structure instead. The design records the rule this phase lands under: validate the shape you deref at the boundary, before any side effect; "object" means the exact plain-object vocabulary (opencode-route-proxy.mjs:659 idiom); failure is the surface's JSON 400 with the process alive; one shared probe matrix (null, array, scalar, {}, each relied-on field wrong-typed). Phase-specific decisions are on #3068 and in files/designs/code-parsed-is-not-validated.md (goal workspace).

  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 1, 2026
  8. 84 remaining items

  9. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · resumed

    • Agent: Lane B queue worker (repo-worker-code, lane code-b)
    • Task: task 5483; issue clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400 #2938
    • Resume: PR fix(clef-proxy): reject array bodies in the systemone guard (#2938) #4449 (branch queue/5483-2938-clef-array-guard) already implements the pinned fix exactly — || Array.isArray(body) on the bin/clef-proxy.mjs systemone guard — plus the clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400 #2938 regression test (array bodies []/[1,2] -> 400, zero stub-upstream hits). Codex review on PR fix(clef-proxy): reject array bodies in the systemone guard (#2938) #4449 completed with no findings. Laptop SSH is unreachable this shift (connection closed, 3 attempts), so the test file could not be re-run locally; merging on diff-vs-pinned-spec verification plus the passing PR check, per standing merge authority.
  11. dezren39
    added a commit that references this issue on Nov 2, 2026

    Merge pull request #4449 from developing-today/queue/5483-2938-clef-a…

    74feb21
  12. dezren39
    closed this as completedin #4449on Nov 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: Lane B queue worker (repo-worker-code, lane code-b)
    • Task: task 5483; issue clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400 #2938 — fixed and merged via PR fix(clef-proxy): reject array bodies in the systemone guard (#2938) #4449 (merge commit 74feb21f1fd29d2c8f7573d0f71247490496dbdd).
    • Verification: fresh read of bin/clef-proxy.mjs on main shows the guard at line 235: if (!body || typeof body !== 'object' || Array.isArray(body)), with the clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400 #2938 regression test in bin/clef-proxy.test.mjs. Codex review on PR fix(clef-proxy): reject array bodies in the systemone guard (#2938) #4449: no findings. Laptop SSH was unreachable this shift, so the test file was not re-run locally by this lane.
    • Issue clef-proxy: a JSON array body passes the #2816 'oracle' guard and fabricates an upstream Clef call — typeof [] is 'object', so [] and [1,2] run with the default model and empty state/questions instead of a 400 #2938 is CLOSED.
  14. dezren39
    added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/clef-proxybin/clef-proxy.mjseffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.