Skip to content

fix(installer): quote model metadata in generated env - #2811

Open
tang-vu wants to merge 1 commit into
Osmantic:mainfrom
tang-vu:fix/model-metadata-dotenv-quoting
Open

fix(installer): quote model metadata in generated env#2811
tang-vu wants to merge 1 commit into
Osmantic:mainfrom
tang-vu:fix/model-metadata-dotenv-quoting

Conversation

@tang-vu

@tang-vu tang-vu commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • quote installer-managed model recommendation metadata in generated dotenv files
  • keep Linux, macOS, and Windows env generators on the same contract
  • verify the real Linux-generated .env can be sourced with spaces, parentheses, and semicolon-separated alternatives

Why this matters

Closes #2617. The production hardware/model selection path writes MODEL_RECOMMENDATION_REASON, MODEL_RECOMMENDED_ALTERNATIVES, and MODEL_PERFORMANCE_LABEL into .env. Those values contain shell-significant spaces, parentheses, and semicolons. Unquoted output made source .env fail and could interpret alternative model entries as commands, preventing operators from loading API keys and other settings after installation.

Overlap check

Searched open and closed PRs for MODEL_RECOMMENDATION_REASON env quote, MODEL_RECOMMENDED_ALTERNATIVES, multiline env, issue #2617, and the three platform env generators. No existing PR covers model-metadata dotenv quoting. The scope is independent of recent atomic-write and sed-escaping changes because it fixes the generated value grammar itself.

Test plan

  • bash -n ods/installers/phases/06-directories.sh ods/installers/macos/lib/env-generator.sh ods/tests/smoke/installer-env-smoke.sh
  • bash ods/tests/smoke/installer-env-smoke.sh — model-metadata, schema, dependency, and compose checks pass; existing unrelated phase-07 ai_err function-resolution check fails
  • PowerShell parser accepts ods/installers/windows/lib/env-generator.ps1
  • git diff --check

Generated with Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Hardware detection script writes unquoted multi-line strings to .env, breaking source commands

1 participant