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 — proxies: single-source remaining ports + publish endpoint files (follow-up to #431) by dezren39 · Pull Request #438 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Oct 20, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Stacked on #431 (base: codex-proxy-port). Fixes #435. Design evaluation: #437.

What this does

Commit 1 — single-source the remaining three proxy ports, exactly the #431 pattern:

proxy port let binding service env session var opencode.jsonc
clef-proxy 18742 clefProxyPort CLEF_PROXY_PORT ✅ no consumer (models ride the Cloudflare gateway)
agy-proxy 18743 agyProxyPort AGY_PROXY_PORT ✅ antigravity-agy baseURL → {env:AGY_PROXY_PORT}
antigravity-ls-proxy 18745 antigravityLsProxyPort ANTIGRAVITY_LS_PROXY_PORT ✅ antigravity-ls baseURL → {env:ANTIGRAVITY_LS_PROXY_PORT}

The bin/*.mjs fallbacks keep the same numbers. After this, the only 1874x literals in home/common/default.nix are the four let-block definitions, and opencode.jsonc has none.

Commit 2 — endpoint publication (port-file discovery, publish half). Each proxy writes $XDG_STATE_HOME/<name>/endpoint.json ({host, port, pid, url}) on listen and removes it on exit — atomic temp+rename, failures swallowed so publication can never take a proxy down. This is the mechanism #437 evaluates (Chrome DevTools' DevToolsActivePort / Jupyter runtime files pattern): file-capable tooling can now find a running proxy without assuming its port. It is a separate commit so it can be dropped independently if unwanted.

Verification

  • nix-instantiate --parse home/common/default.nix — OK.
  • node --check on all four bin/*.mjs — OK.
  • Throwaway opencode serve (1.18.31) with the edited config and the vars set resolved all three provider baseURLs: 127.0.0.1:18743, :18744, :18745.
  • Smoke test: clef-proxy on a scratch port with a temp XDG_STATE_HOME wrote the correct endpoint.json and removed it on SIGTERM.

Caveats

  • The new {env:...} baseURLs inherit codex-proxy: PR #431's {env:CODEX_PROXY_PORT} baseURL has no fallback — opencode outside a home-manager shell gets an empty port #434's known behaviour (no fallback when the variable is unset) — identical to what codex-proxy: single-source the port via CODEX_PROXY_PORT #431 established for CODEX_PROXY_PORT, no better and no worse. Local proxy discovery: port files, sockets, or a registry instead of fixed ports? #437 covers the possible fork-level fixes ({file:...} substitution / {env:VAR:-default}).
  • Not done here, by design: port-increment fallback (evaluated and rejected in Local proxy discovery: port files, sockets, or a registry instead of fixed ports? #437 — it breaks static-config consumers) and systemd socket activation for the proxies (recommended in Local proxy discovery: port files, sockets, or a registry instead of fixed ports? #437 as an independent reliability win; OpenChamber already uses it on :3000).
  • Not merged — for Drew's review, stacked behind opencode: enable web-search backends + experimental feature flags #430/codex-proxy: single-source the port via CODEX_PROXY_PORT #431.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Muse Sweep added 2 commits October 20, 2026 20:11
Muse Sweep
proxies: single-source clef/agy/antigravity-ls ports via env (follow-…
11990be
…up to #431)

PR #431 single-sourced the codex-proxy port (CODEX_PROXY_PORT) and left the sibling proxies as a follow-up (tracked as #435). This applies the identical pattern to the remaining three:

- home/common/default.nix: clefProxyPort = 18742, agyProxyPort = 18743, antigravityLsProxyPort = 18745 join codexProxyPort in the let block. Each flows to its systemd user service Environment and to home.sessionVariables (CLEF_PROXY_PORT / AGY_PROXY_PORT / ANTIGRAVITY_LS_PROXY_PORT).
- .opencode/opencode.jsonc: the antigravity-agy and antigravity-ls providers now build their baseURL from {env:AGY_PROXY_PORT} / {env:ANTIGRAVITY_LS_PROXY_PORT}, with the same do-not-hardcode comment as openai-codex. clef-proxy has no opencode.jsonc consumer (its models ride the Cloudflare gateway), so it gets the nix-side single source only.
- The bin/*.mjs proxies keep their current ports as fallback defaults, unchanged.

Verified: nix-instantiate --parse on default.nix; a throwaway opencode serve (1.18.31) with the edited config and the three vars set resolved all three provider baseURLs to 127.0.0.1:18743/18744/18745. After this change the only 1874x literals left in default.nix are the four let-block definitions, and opencode.jsonc has none.

Known caveat, shared with #431 and tracked separately in #434: {env:...} substitution has no fallback when a variable is unset, so these baseURLs inherit exactly the behaviour CODEX_PROXY_PORT has today — no better, no worse.
Muse Sweep
proxies: publish endpoint.json so clients can discover the bound port
b047a2b
Each of the four proxies now writes $XDG_STATE_HOME/<name>/endpoint.json ({host, port, pid, url}) when it starts listening and removes it on exit (SIGTERM/SIGINT/exit; antigravity-ls-proxy reuses its existing signal handlers via the exit hook). Atomic write via temp file + rename, and every failure is swallowed — publication can never take a proxy down.

This is the publish half of the port-file discovery design evaluated in #437 (the pattern Chrome DevTools' DevToolsActivePort and Jupyter's runtime files use): any tool that can read a file can now find the running proxy without assuming its port, which is what makes future dynamic ports possible. The fixed single-sourced ports remain the contract for static-config consumers like opencode.jsonc, which cannot read files; #437 lays out the options and the decision needed there.

Verified: node --check on all four files; smoke test — clef-proxy on a scratch port with a temp XDG_STATE_HOME wrote the correct endpoint.json (port taken from the bound env port, not the default) and removed it on SIGTERM.
@dezren39
dezren39 requested a review from a team as a code owner October 20, 2026 20:11
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned dezren39 Oct 20, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T00:30:59.045941Z bd19d63 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 20, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b047a2b460

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .opencode/opencode.jsonc Outdated
// Port comes from AGY_PROXY_PORT (set by home config from the
// same single definition the agy-proxy service binds) — never
// hardcode a port here; see the openai-codex provider note.
"baseURL": "http://127.0.0.1:{env:AGY_PROXY_PORT}/v1",

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Export proxy ports to the services that launch OpenCode

When OpenCode is launched by openchamber.service or through the t3code.service provider driver, these variables are absent because the units' Environment lists in home/common/default.nix do not include AGY_PROXY_PORT or ANTIGRAVITY_LS_PROXY_PORT, while home.sessionVariables only populates sourced user sessions. Consequently both newly substituted base URLs are unresolved in the repository's managed-service flows, making the agy and direct-LS providers unusable there; pass the port variables to every service that launches OpenCode rather than only to shell sessions and the proxy units.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/clef-proxy.mjs
const file = path.join(dir, 'endpoint.json');
fs.writeFileSync(
`${file}.tmp`,
JSON.stringify({ host: HOST, port: PORT, pid: process.pid, url: `http://${HOST}:${PORT}` }) + '\n',

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish the port returned by the listening server

When a proxy is configured with port 0 to request an ephemeral port—a natural use case for the new discovery file—Node binds a real nonzero port, but this code publishes {port: 0, url: ...:0}. I reproduced this with CLEF_PROXY_PORT=0: the server listened on an OS-assigned port while endpoint.json advertised port 0. All four copied implementations should derive the published address from server.address() after listen completes.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/clef-proxy.mjs
Comment on lines +31 to +34
process.on('exit', cleanup);
process.on('SIGTERM', () => {
cleanup();
process.exit(0);

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove endpoint files when foreground proxies receive SIGHUP

When one of the packaged proxy commands is run in a terminal and that terminal closes, the process receives SIGHUP; Node's exit event is not emitted for this unhandled signal, so the cleanup registered here never runs. I reproduced this by sending SIGHUP to clef-proxy and found its endpoint.json still present after the process exited, leaving discovery clients pointed at a dead PID and potentially at an unrelated process if the port is reused. The four implementations should handle SIGHUP (and other catchable terminating signals used by their launch contexts) through the same cleanup path.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/clef-proxy.mjs
const file = path.join(dir, 'endpoint.json');
fs.writeFileSync(
`${file}.tmp`,
JSON.stringify({ host: HOST, port: PORT, pid: process.pid, url: `http://${HOST}:${PORT}` }) + '\n',

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Format IPv6 hosts as valid endpoint URLs

When a supported host override is an IPv6 address such as CLEF_PROXY_HOST=::1, this interpolation publishes http://::1:<port>, which URL parsers reject because IPv6 literals must be bracketed. The same construction appears in all four proxies, so consumers using the advertised url cannot discover any proxy bound to IPv6; construct the URL with an IPv6-aware formatter while retaining the unbracketed value in the separate host field.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Muse Sweep
fix(proxies): give every {env:} proxy baseURL a :- fallback port (#434)
2a23007
Stacked on #438 (base: proxy-ports-single-source). Fixes #434.

The {env:VAR} baseURLs from #431/#438 resolve to an empty port in any
launch that does not inherit the home-manager session variables
(systemd service, desktop, VS Code) — a silently dead provider. The
:- form resolves to the proxy's own fallback port when the variable
is unset or empty, so the client and the proxy script (which keeps
the same literal as its fallback) can no longer disagree.

The fallback syntax is added to the opencode fork in
developing-today/opencode PR #232 (ConfigVariable.substitute); on an
opencode without it, the token degrades to the old empty
substitution — no worse than #431 as-is.

- .opencode/opencode.jsonc: CODEX_PROXY_PORT:-18744,
  AGY_PROXY_PORT:-18743, ANTIGRAVITY_LS_PROXY_PORT:-18745.
- New .github/scripts/check-proxy-port-fallbacks.sh, run by nix-ci on
  every PR: every fallback copy (script defaults + config defaults)
  must match the single let-block definition in
  home/common/default.nix; a bare {env:VAR} or a literal port in
  opencode.jsonc fails by name. Ablation-verified both ways.
This was referenced Oct 21, 2026
fix(proxies): give every {env:} proxy baseURL a :- fallback port (#434) #478
Merged
codex-proxy: PR #431's {env:CODEX_PROXY_PORT} baseURL has no fallback — opencode outside a home-manager shell gets an empty port #434
Closed
feat(bin): add muse-proxy — OpenAI-compatible bridge to the Muse CLI #479
Merged
bin proxies: *_PROXY_PORT parsed with bare parseInt — invalid values crash opaquely or bind the wrong port #483
Closed
Base automatically changed from codex-proxy-port to main October 23, 2026 00:21
dezren39 added 3 commits October 22, 2026 19:22
@dezren39
Merge pull request #478 from developing-today/sweep/434-env-fallback
7153874
fix(proxies): give every {env:} proxy baseURL a :- fallback port (#434)
@dezren39
Merge origin/main into proxy-ports-single-source
36089b5
@dezren39
fix(home): single-source design-code port, teach guard parseProxyPort
bd19d63
@dezren39
dezren39 merged commit 607160e into main Oct 23, 2026
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the proxy-ports-single-source branch October 23, 2026 00:29
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 23, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd19d6313d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread home/common/default.nix
agyProxyPort = 18743;
codexProxyPort = 18744;
antigravityLsProxyPort = 18745;
designCodeProxyPort = 18746;

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish a discovery endpoint for design-code

Include design-code-proxy in the endpoint-publication feature: it is now one of the five configured local proxies, but a repo-wide search for endpoint.json shows publishers only in clef, agy, codex, and antigravity-ls, while bin/design-code-proxy.mjs:300-303 merely starts listening. Consequently, tooling that uses the new discovery mechanism cannot locate design-code when its port is overridden, even though its port is otherwise managed identically to the other proxies.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bin/clef-proxy.mjs
Comment on lines +27 to +30
const cleanup = () => {
try {
fs.unlinkSync(file);
} catch {}

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Only remove endpoint files owned by the exiting process

When two copies of the same proxy run on different configured ports—for example, a managed service alongside a manual test—the newer process replaces endpoint.json, but the older process still unconditionally unlinks that shared path when it exits. I reproduced this with two clef instances: both remained listening, yet terminating one removed the sole discovery record for the other; the shared ${file}.tmp name also lets concurrent publishers race. Make the temporary file process-specific and only unlink the final file when its recorded PID still matches this process; the same pattern occurs in all four publishers.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@developing-today developing-today Bot mentioned this pull request Nov 8, 2026
Sweep remaining held-or-Drew-owned phrasing to the label-based held definition (Drew ruling 2026-11-07) #7077
Closed
@dezren39 dezren39 mentioned this pull request Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 24, 2026
codex-proxy follow-up from PR #431: single-source the agy-proxy, clef-proxy and antigravity-ls-proxy ports too #435
Closed
This was referenced Nov 24, 2026
AUDIT-7 Lane 2 — Closed-Issues Review (past month, since 2026-10-23) #13878
Closed
Audit programme: seven-lane review of PRs, issues and designs (2026-11-23) #13871
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

codex-proxy follow-up from PR #431: single-source the agy-proxy, clef-proxy and antigravity-ls-proxy ports too

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.