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 — antigravity-direct: ANTIGRAVITY_DIRECT_PORT / _TIMEOUT_MS are bare Number() — bypasses the house strict port helper, so bad ports crash with a stack or bind the wrong port, and bad timeouts start healthy then 502 every request · Issue #2823 · developing-today/code

antigravity-direct: ANTIGRAVITY_DIRECT_PORT / _TIMEOUT_MS are bare Number() — bypasses the house strict port helper, so bad ports crash with a stack or bind the wrong port, and bad timeouts start healthy then 502 every request #2823

New issue
Copy link
New issue
Copy link
Closed
#4935
Closed
antigravity-direct: ANTIGRAVITY_DIRECT_PORT / _TIMEOUT_MS are bare Number() — bypasses the house strict port helper, so bad ports crash with a stack or bind the wrong port, and bad timeouts start healthy then 502 every request#2823
#4935
Copy link
Assignees
dezren39
Labels
app/antigravity-directbin/antigravity-direct.mjs direct Cloud Code dooreffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientqueue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

antigravity-direct: ANTIGRAVITY_DIRECT_PORT / _TIMEOUT_MS are bare Number() — the new door bypasses the house strict port helper, so bad ports crash with a stack or bind the wrong port, and bad timeouts start healthy then 502 every request

Repo: developing-today/code · Main: 2a91ea6c · File: bin/antigravity-direct.mjs:60-62 (landed 2026-10-30 in b0058ec7)

Summary

const PORT = Number(process.env.ANTIGRAVITY_DIRECT_PORT || 18751);        // :60
const TIMEOUT_MS = Number(process.env.ANTIGRAVITY_DIRECT_TIMEOUT_MS || 300000); // :62

Every other bin/* proxy parses its listen port through the strict house helper bin/proxy-port.mjs (parseProxyPort, built for #483 precisely because "a bare parseInt is not a validator"): agy (:39), antigravity-ls (:10), claude-code (:42), clef (:8), codex (:12), commandcode (:58), design-code (:6), muse (:39), opencode-route (:49), proxy-relay (:39/:55). The door seated today is the sole exception — it validates neither value, and each bad spelling fails differently, none of them naming the variable at fault.

Evidence (verified this run, real module)

Laptop probe (~/git/fleet/probe-2026-10-30-laneB-antigrav-port/; bin/antigravity-direct.mjs md5 de11cfa24df8200d66fd788422667ef8, identical on sandbox main 2a91ea6c and the laptop). Stub secret-tool + local stub/hanging upstreams; no real keyring read, no real Google call.

PORT cases:

ANTIGRAVITY_DIRECT_PORT Result
abc, 18941abc Process exits 1 at startup: RangeError [ERR_SOCKET_BAD_PORT]: options.port should be >= 0 and < 65536. Received type number (NaN) at antigravity-direct.mjs:660 — a Node stack that never names ANTIGRAVITY_DIRECT_PORT or the offending value
18941.9 Same exit-1 ERR_SOCKET_BAD_PORT (Received type number (18941.9))
99999 Same exit-1 ERR_SOCKET_BAD_PORT, variable/value unnamed
0 Starts "healthy", binds a random ephemeral port, while endpoint.json records {"port":0,"url":"http://127.0.0.1:0"} and the log claims listening on http://127.0.0.1:0 — every client reading the endpoint file dials port 0 and fails
0x4a35 Silently binds 18997 — a port nobody configured — and endpoint.json ratifies it ("port":18997); /healthz answers there
18941 (control) Starts, endpoint.json correct, serves normally

TIMEOUT_MS cases (upstream stub that accepts and never responds):

ANTIGRAVITY_DIRECT_TIMEOUT_MS Result
300 (control) Request fails in ~0.32 s: HTTP 502 upstream timeout after 300ms — the intended behaviour
abc Proxy starts and listens healthy, but every upstream request returns HTTP 502 in ~14 ms with Node's raw The value of "timeout" is out of range. It must be a non-negative finite number. Received NaN — naming neither the variable nor that this is a config error; the catalog pull fails the same way at startup and is logged only as "keeping fallback list"
-5000 Same healthy-start / 502-every-request shape (Received -5000)
3000000000 Starts with TimeoutOverflowWarning: 3000000000 does not fit into a 32-bit signed integer; a request against the hanging upstream is still unanswered after the client's 6 s cap — the configured 50-minute bound is neither honoured nor rejected

Why it matters

This door was seated in opencode today as the replacement for the agy / antigravity-ls seats, so its systemd unit will be started with these env vars by home-manager like every sibling proxy. The failure taxonomy is the worst available per value: a typo'd port either kills the unit with a stack that doesn't say which variable is wrong (triage starts from Node internals, not the config), or — worse — the unit stays up on a random or hex-decoded port while endpoint.json advertises a dial-nothing address, so the seat looks alive and every client fails. A typo'd timeout is worse still: the service passes a health check, then converts every real request into a 502 that blames the upstream transport. The fix already exists in-repo and is imported by all ten sibling entry points; this file just never got it.

Dedup

#2821 covers this file's non-object JSON body; #2822 its tool_choice flattening — neither touches env parsing. #2786 is the same bare-Number() timeout pattern in opencode-route-proxy only; #2758 is pm-dispatch's port/hosts. #483 built proxy-port.mjs for the other proxies, before this file existed. No open issue covers ANTIGRAVITY_DIRECT_PORT / ANTIGRAVITY_DIRECT_TIMEOUT_MS.

Acceptance criteria

  • ANTIGRAVITY_DIRECT_PORT is parsed through parseProxyPort from bin/proxy-port.mjs (the sibling import every other bin/* proxy uses), so a non-decimal, fractional, hex, zero, or out-of-range value exits at startup with the variable name and value in the message and no stack; the default stays 18751.
  • ANTIGRAVITY_DIRECT_TIMEOUT_MS is validated at startup with the same strictness shape (decimal integer within a stated positive range that fits a Node timer, i.e. ≤ 2^31−1): an invalid value fails startup naming the variable and value, instead of starting healthy and 502-ing every request or overflowing silently.
  • endpoint.json is only ever written with the actually-bound, validated port.
  • Tests in the existing bin/*.test.mjs node-test style (extend bin/antigravity-direct.test.mjs from 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 if it exists, else create it) cover: abc, 18941abc, 18941.9, 0, 99999, 0x4a35 ports rejected at startup; timeout abc, -5000, 3000000000 rejected at startup; valid port + 300 timeout control still serves and times a hanging upstream out at ~300 ms.
  • Well-formed default startup (no env overrides) is byte-for-byte unchanged.

Activity

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

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b
    • Session / ID: cron job new-issue-creator-code-b, run 2026-10-30 14:50 CDT
    • Found via: filed this run
    • Task: Filed this issue: bin/antigravity-direct.mjs:60-62 parses ANTIGRAVITY_DIRECT_PORT / _TIMEOUT_MS with bare Number() — the only bin entry point not using bin/proxy-port.mjs's parseProxyPort (bin proxies: *_PROXY_PORT parsed with bare parseInt — invalid values crash opaquely or bind the wrong port #483). Verified on the laptop with the real module (md5-matched to main 2a91ea6c): ports abc/18941abc/18941.9/99999 exit 1 with an ERR_SOCKET_BAD_PORT stack naming neither variable; 0 binds a random ephemeral port while endpoint.json advertises port 0; 0x4a35 silently binds 18997; timeouts abc/-5000 start healthy then 502 every request with Node's raw range error, and 3000000000 overflows with the request left hanging past 6 s (300 ms control against the same hanging upstream 502'd in ~0.32 s).
    • Expectation: effort/xs — done when the port goes through parseProxyPort, the timeout is validated at startup in the same strict shape, and node tests pin every rejected spelling plus the valid control. Validation shape/range is triage's pin.
    • Links: probe (laptop) ~/git/fleet/probe-2026-10-30-laneB-antigrav-port/ · evidence body in goal hidden_files/issue-code-antigrav-port-timeout-body.md
  3. dezren39
    added a parent issue on Oct 30, 2026
    • Design: env numbers are arguments — one strict parse for boot-time configuration #2835
  4. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Oct 30, 2026
  5. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    agent-note:v1 — design-architect pass 22 (2026-10-30): ADOPTED as Phase 1 of design #2835 (bin/ proxies, with #2786/#1809/#2096): this issue's port goes through the existing parseProxyPort in bin/proxy-port.mjs and its timeout through the NEW millis helper Phase 1 adds there (digits-only, 1-2^31-1) — not a private guard. Linked as a sub-issue of #2835 (verified in its sub_issues list). Triage: do NOT re-file/re-scope/split this issue; record the phase structure and land it as the phase, with the decisions recorded on #2835 and in its design doc (files/designs/code-env-config-strict-parse.md). This issue keeps its own queued triage packet.

  6. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 1, 2026
  8. 13 remaining items

  9. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: pr opened (awaiting CI)

    Fixed in PR #4935 — queue/8037-2823-antigravity-direct-env-parse, base main @ 115fe4f44.

    • ANTIGRAVITY_DIRECT_PORT → parseProxyPort('ANTIGRAVITY_DIRECT_PORT', 18751); ANTIGRAVITY_DIRECT_TIMEOUT_MS → parseProxyMillis(..., 300000), both from bin/proxy-port.mjs — the same helper the other ten proxies use.
    • Each of the issue's bad-value rows now exits at startup naming the variable and its value, with no ERR_SOCKET_BAD_PORT / RangeError / TimeoutOverflowWarning; 0 and 0x4a35 no longer bind.
    • node --test bin/antigravity-direct.test.mjs — 16/16 pass (six bad ports, three bad timeouts, hanging-upstream 300 ms control, plus the existing tool_choice tests). Defaults unchanged.

    Merge criteria on resume: checks green, diff is those two files, no held/Drew restriction.

    Queue: task 8037, repo-worker-code, lane 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc.

  11. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  12. dezren39
    added a commit that references this issue on Nov 3, 2026

    Merge pull request #4935 from developing-today/queue/8037-2823-antigr…

    d4d7834
  13. dezren39
    closed this as completedin #4935on Nov 3, 2026
  14. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: done (merged)

    PR #4935 merged as d4d78346 (2026-11-03T13:59:30Z). ANTIGRAVITY_DIRECT_PORT and ANTIGRAVITY_DIRECT_TIMEOUT_MS now parse through parseProxyPort / parseProxyMillis; every bad shape in the issue's table exits at startup naming the variable and value. Targeted tests: 16/16 in bin/antigravity-direct.test.mjs.

    Task 8037 closed as pr_opened before the merge landed; this note is the merged-state correction.

  15. dezren39
    added
    queue/queuedHas a queued queue task
    status/needs-triageNot yet triaged; needs a first look
    on Nov 3, 2026
  16. developing-today commented on Nov 3, 2026

    @developing-today
    developing-todayBot
    on Nov 3, 2026 – with developing.today
    Contributor
    More actions

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/low). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

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/antigravity-directbin/antigravity-direct.mjs direct Cloud Code dooreffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientqueue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

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.