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 — feat(core): support {env:VAR:-fallback} defaults in config substitution by dezren39 · Pull Request #232 · developing-today-forks/opencode

Conversation

@dezren39

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

Uh oh!

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

Copy link
Copy Markdown

Problem

Config {env:VAR} substitution had no fallback: a missing variable substituted the empty string. developing-today/code#434 (developing-today/code#434) documents the concrete failure: PR developing-today/code#431 single-sources a local proxy port as http://127.0.0.1:{env:CODEX_PROXY_PORT}/v1, so any opencode process launched without that variable in its environment (systemd service, desktop/VS Code launch) resolves the provider to http://127.0.0.1:/v1 — silently dead, looking like a network/auth problem. code#437 names {env:VAR:-default} fallback syntax as one of the fork-level fixes.

Solution

ConfigVariable.substitute now parses the shell-style {env:VAR:-fallback} form: the fallback is used when the variable is unset or empty (matching both shell :- semantics and the existing || "" treatment of empty values). Plain {env:VAR} behaviour is unchanged. The fallback may itself contain colons, so a full URL default works.

Verification

  • New test uses the :- fallback when an env variable is unset or empty covers set-wins, unset, empty, plain-missing-still-empty, and a URL fallback. It fails with the implementation reverted (ablation) and passes with it.
  • Full packages/core/test/config/config.test.ts: 52/52 pass.
  • tsc --noEmit for packages/core: clean.
  • Docs: the Variables section of config.mdx documents the new form with the proxy-port example from code#434.

Cross-repo set (origin: developing-today/code#434)

This is the opencode half. The code half — adopting {env:CODEX_PROXY_PORT:-18744} (and the agy/antigravity-ls equivalents) in .opencode/opencode.jsonc — is stacked on code PR #438 in the same sweep run and references that issue. Until this lands, the new syntax in a config degrades to the old empty substitution, i.e. no worse than code#431's current behaviour.


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
@dezren39
feat(core): support {env:VAR:-fallback} defaults in config substitution
d2cd1f0
A missing {env:VAR} substituted the empty string, so a config that
derives a value from an optional variable (e.g. a local proxy port
exported only by some launch contexts) silently resolved to a broken
value. The :- form resolves to the fallback when the variable is unset
or empty, matching shell semantics; plain {env:VAR} is unchanged.

Origin issue for the cross-repo set: developing-today/code#434
developing-today/code#434
@github-actions github-actions Bot added the needs:compliance label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

All reactions

Sorry, something went wrong.

Uh oh!

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

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fee4475a-9b69-4933-b407-665ff54b5aba
📥 Commits

Reviewing files that changed from the base of the PR and between dc951d4 and d2cd1f0.

📒 Files selected for processing: 3
  • packages/core/src/config/variable.ts
  • packages/core/test/config/config.test.ts
  • packages/web/src/content/docs/config.mdx
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-21T12:18:50.396422Z d2cd1f0 PR opened
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 21, 2026

Copy link
Copy Markdown

The following comment was made by an LLM, it may be inaccurate:

All reactions

Sorry, something went wrong.

Uh oh!

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

@dezren39 dezren39 mentioned this pull request Oct 21, 2026
codex-proxy: PR #431's {env:CODEX_PROXY_PORT} baseURL has no fallback — opencode outside a home-manager shell gets an empty port developing-today/code#434
Closed
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 21, 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: d2cd1f03e9

ℹ️ 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 packages/web/src/content/docs/config.mdx

If the environment variable is not set, it will be replaced with an empty string.

Add a default with `{env:VARIABLE_NAME:-fallback}` to substitute a fallback value instead when the variable is unset or empty:

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 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 Document the fallback in the deployed docs tree

This addition will not reach the published documentation: .github/workflows/deploy-www.yml:28-36 builds and deploys services/www, whose loader reads services/www/src/docs/content (services/www/src/content.config.ts:5-10), while that tree's config.mdx still only documents the empty-string behavior. Move or duplicate this section into the deployed config guide so users can discover the new syntax.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/core/src/config/variable.ts
const env = (escape: boolean) =>
input.text.replace(/\{env:([^}]+)\}/g, (_, name: string) => {
const value = (input.env?.[name] ?? process.env[name]) || ""
input.text.replace(/\{env:([^}]+)\}/g, (_, token: string) => {

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 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 Preserve braces that occur inside fallback values

When an unset variable's fallback contains a closing brace before the end, this regex terminates the placeholder at that brace and effectively moves it to the end of the fallback. For example, the supported unquoted-fragment form {env:X:-{"nested":{"enabled":true},"other":1}} silently becomes {"nested":{"enabled":true,"other":1}}, changing the configuration's structure while remaining valid JSON. Parse the placeholder in a way that preserves nested or otherwise embedded braces in fallback values.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
@dezren39
dezren39 merged commit dc72b96 into main Oct 21, 2026
16 of 19 checks passed

Uh oh!

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

@dezren39
dezren39 deleted the env-fallback branch October 21, 2026 12:23
This was referenced Oct 21, 2026
docs: ROADMAP Done table omits the #197 completion (PR #229) and the {env:VAR:-fallback} feature (PR #232) #235
Closed
docs: ROADMAP Done table omits the #231 completion (PR #234) #244
Closed
docs: record the #197 and #232 completions in ROADMAP Done (#235) #249
Merged
dezren39 added a commit that referenced this pull request Oct 21, 2026
@dezren39
docs: record the #197 and #232 completions in ROADMAP Done (#235) (#249)
e430fd7
This was referenced Oct 21, 2026
docs: ROADMAP Done table omits the #241, #243, #246 and #235 completions (PRs #242, #248, #247, #249) #250
Closed
docs: record the #241, #243, #246 and #235 completions in ROADMAP Done #251
Merged
docs: ROADMAP Done table omits the #244 and #250 completions (PRs #245, #251) #253
Closed
@dezren39 dezren39 mentioned this pull request Nov 1, 2026
Preserved branch: creator/235-roadmap-done-229-232 — decision needed (merge / cherry-pick / drop) #1172
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

needs:compliance

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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.