fix(flag): read every documented ALTIMATE_CLI_* name, not only two of them
Issue for this PR
Closes #1329
Type of change
- Bug fix
What does this PR do?
docs/docs/usage/cli.md documents the flags under ALTIMATE_CLI_*, but flag.ts read that spelling for only two of them (YOLO, DISABLE_AUTOUPDATE). So ALTIMATE_CLI_DISABLE_EXTERNAL_SKILLS=true did nothing — the issue — and a cross-check of the whole table found the same for DISABLE_AUTOCOMPACT, DISABLE_DEFAULT_PLUGINS, DISABLE_LSP_DOWNLOAD, DISABLE_MODELS_FETCH, DISABLE_PROJECT_CONFIG, DISABLE_PRUNE, DISABLE_TERMINAL_TITLE, ENABLE_EXA, the EXPERIMENTAL* family, CONFIG, CONFIG_CONTENT, CONFIG_DIR, GIT_BASH_PATH, PERMISSION, SERVER_USERNAME and SERVER_PASSWORD. One instance was reported; the class is what's fixed.
There are three places a flag is read, and the first cut fixed only one — cubic caught that the gate the issue is about (RuntimeFlags.disableExternalSkills, an Effect Config) never went through it. The rule is now defined once, in packages/core's flag/flag.ts (documentedAlias / env: documented name first, empty counts as unset), and applied on every path:
- the core
Flagobject (31 importers,config/config.tsamong them — soALTIMATE_CLI_CONFIGworks too), including its two EffectConfigflags; - the opencode
Flagnamespace, which imports the rule instead of its own copy —altTruthy/altEnvlet a set documented value win outright, so a documentedfalsebeats a fallbacktrue; - the Effect
Config-backed services (RuntimeFlags,ServerAuthConfig):effect/config-service.tswraps whatever ConfigProvider is active so the documented spelling is tried first (built withConfigProvider.make;orElse's fallback bypassesmapInput); - the two remaining direct
process.envreads,config.ts(OPENCODE_CONFIG_CONTENT) andrun --attach(OPENCODE_SERVER_PASSWORD/_USERNAME).
The OPENCODE_ spellings keep working.
How did you verify your code works?
test/flag/external-skills-flag.test.ts(13 tests): the namespace in a subprocess (documented name alone,OPENCODE_fallback, documented wins, theCLAUDE_CODEfamily, copy-on-select explicitfalse); everyALTIMATE_CLI_*name in the docs table reaches its flag;RuntimeFlagsandServerAuthConfigbuilt through afromEnvprovider —ALTIMATE_CLI_DISABLE_EXTERNAL_SKILLSalone setsdisableExternalSkills, documentedfalsebeats fallbacktrue, empty documented falls back, numeric flags; the coreFlagobject in a subprocess (config paths,altTruthyprecedence, the EffectConfigflag).- Mutation: bypassing the provider wrap fails four tests. Restored.
test/flag,test/config,test/effect,test/server,test/skill,test/cli/cmd: 1,669 pass.packages/coretest/config,test/filesystem: two pre-existing failures on the base (macOS tmp path, watcher timing), unrelated. Typecheck (all packages) and marker guard clean.
Screenshots / recordings
N/A.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
🤖 Generated with Claude Code