feat(setup): export OPENCODE_CONFIG_CONTENT for CI-safe OpenCode config isolation#263
Merged
marcusrbrown merged 1 commit intofeat/omo-config-updatesfrom Feb 27, 2026
Conversation
Copilot
AI
changed the title
[WIP] Add OPENCODE_CONFIG_CONTENT as CI-safe environment variable
feat(setup): export OPENCODE_CONFIG_CONTENT for CI-safe OpenCode config isolation
Feb 26, 2026
Co-authored-by: marcusrbrown <831617+marcusrbrown@users.noreply.github.com>
a66351a to
5ed00f4
Compare
marcusrbrown
added a commit
that referenced
this pull request
Mar 2, 2026
* chore: update the project banner * feat(setup): export OPENCODE_CONFIG_CONTENT for CI-safe OpenCode config isolation (#263) feat(setup): export OPENCODE_CONFIG_CONTENT for CI-safe OpenCode config Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * fix(setup): declare and validate opencode-config * feat(setup): add --skip-auth flag to oMo installer for CI reliability (#260) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * feat(setup): add kimi-for-coding to oMo provider inputs (#268) feat(setup): expose kimi-for-coding oMo CLI flag as action input Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * feat(setup): add `omo-config` action input for custom oMo configuration (#274) feat(setup): add omo-config action input for custom oMo configuration Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * fix(inputs): add kimi-for-coding to input validation and types Previously, kimi-for-coding was listed as a valid value in action.yaml and handled in setup.ts's parseOmoProviders, but was absent from inputs.ts. This caused users who set 'omo-providers: kimi-for-coding' to fail input validation with: Invalid omo-providers value: "kimi-for-coding". Valid values: ... Three files updated: 1. src/lib/inputs.ts: added 'kimi-for-coding' to VALID_OMO_PROVIDERS and parseOmoProviders function 2. src/lib/types.ts: added readonly kimiForCoding field to OmoProviders 3. src/lib/agent/opencode.test.ts: updated all OmoProviders test objects Fixes PR #266 blocking issue; all 961 tests pass. * fix(setup): harden opencode/omo config input parsing - trim setup inputs and treat whitespace-only config values as not provided - fail fast with explicit error when opencode-config is invalid JSON - enforce opencode-config and omo-config as JSON objects (not null/array/primitive) - harden oMo deep merge against prototype-pollution keys - add regression tests for null/array/string/invalid JSON and whitespace handling - document opencode-config input in README - rebuild dist/main.js --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
OPENCODE_CONFIG_CONTENTis OpenCode's highest-precedence config source (position 6 in the precedence chain), making it the correct primitive for enforcing CI-safe defaults — unlikeOPENCODE_CONFIG_DIR, which only adds a plugin search path and does not suppress~/.config/opencode/opencode.json.Changes
src/lib/setup/setup.ts: After oMo installation, exportsOPENCODE_CONFIG_CONTENTwithautoupdate: falseas the CI baseline; user-suppliedopencode-configinput is spread on top so user values win on conflicting keys:src/lib/setup/setup.test.ts: Two new tests — baseline export (autoupdate: falsewith no user config) and user-config merge (user values override baseline on conflicting keys).Tools cache strategy is unchanged —
omoConfigPath = ~/.config/opencoderemains stable.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh pr view 263 --repo fro-bot/agent --json baseRefName,headRefName(http block)/usr/bin/gh gh pr edit 263 --repo fro-bot/agent --base feat/omo-config-updates(http block)https://api.github.com/repos/fro-bot/agent/pulls/263/usr/bin/curl curl -s -X PATCH -H Authorization: token ****** -H Accept: application/vnd.github.v3+json REDACTED -d {"base": "feat/omo-config-updates"}(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>feat(setup): isolate oMo/OpenCode config with OPENCODE_CONFIG_CONTENT</issue_title>
<issue_description>## Summary
Set
OPENCODE_CONFIG_CONTENTas a CI-safe environment variable during setup to enforce consistent, predictable OpenCode behavior across all runs — specifically preventing auto-updates and supporting user-supplied config overrides.Motivation
OpenCode's config precedence order (from opencode.ai/docs/config/#precedence-order):
.well-known/opencode)~/.config/opencode/opencode.json)OPENCODE_CONFIGenv var)opencode.jsonin project).opencodedirectoriesOPENCODE_CONFIG_CONTENTenv var — highest priorityThe original proposal used
OPENCODE_CONFIG_DIR(per-run temp directory) for isolation. However,OPENCODE_CONFIG_DIRis not a config replacement — it adds an extra.opencode-style search path for agents/commands/plugins and does not prevent OpenCode from reading~/.config/opencode/opencode.json. Additionally, per-run temp directories would break the tools cache (which keys on stable paths → guaranteed cache misses).OPENCODE_CONFIG_CONTENTis the correct primitive. It has the highest precedence and reliably enforces CI-safe settings regardless of project or global config. This matches the pattern used by OCX, the established OpenCode CLI wrapper.Implementation
File:
src/lib/setup/setup.tsIn
runSetup(), after oMo installation, exportOPENCODE_CONFIG_CONTENTwith CI-appropriate defaults:The existing
opencodeConfigfield inSetupInputs(already parsed from theopencode-configinput) provides user-supplied overrides — no new inputs required for the baseline case.What NOT to Do
❌ Do not use
mkdtempSync()forOPENCODE_CONFIG_DIR:~/.config/opencode/opencode.json(still read at lower precedence)~/.config/opencode/regardless ofOPENCODE_CONFIG_DIRIf
OPENCODE_CONFIG_DIRis ever used, it must point to a stable path (not a temp dir).Considerations
OPENCODE_CONFIG_CONTENTonly wins on conflicting keys. Non-conflicting project-level settings are preserved (e.g., a project's model choice is respected unless explicitly overridden).OPENCODE_DISABLE_PROJECT_CONFIG: Future input for untrusted contexts (e.g., fork PRs). Off by default to preserve expected repo behavior.omoConfigPath = ~/.config/opencoderemains stable and continues to be cached as before. No tools cache changes needed.Acceptance Criteria
OPENCODE_CONFIG_CONTENTexported inrunSetup()withautoupdate: falseas baselineopencode-configinput merged on top of baselineOPENCODE_CONFIG_DIRnot set to a per-run temp directoryomoConfigPath = ~/.config/opencode)OPENCODE_CONFIG_CONTENTis exported with correct contentpnpm build)pnpm test)Context
Identified in PR #236 as an improvement for CI reliability. Research conducted in issue comment —
OPENCODE_CONFIG_DIRvsOPENCODE_CONFIG_CONTENTanalyzed against official docs, OCX source, and reviewed by Oracle.Scope
OPENCODE_CONFIG_CONTENTonly wins on conflicting keys; project configs otherwise preserved)</issue_description>
<agent_instructions>Target the PR to the
feat/omo-config-updatesbranch (each of these setup features will be rolled up into this branch).</agent_instructions>Comments on the Issue (you are @copilot in this section)
@marcusrbrown @fro-bot research `OPENCODE_CONFIG_DI...💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.