chore(omp): manage config via dotfiles templates - #1221
Conversation
📝 WalkthroughWalkthroughAdds a new OMP configuration module: includes it in the composed Nix config, adds template and final YAML configs, provides a Home Manager activation to deploy the config, and extends the template-processing script to generate the file. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Script as llm-update.sh
participant Repo as Repository (config/omp)
participant HM as Home Manager activation
participant FS as User FS (~/.omp/agent)
Dev->>Repo: Add `config.tpl.yml`, `config.yml`, `default.nix`, update `config/default.nix`
Script->>Repo: Read `config/omp/config.tpl.yml` + `models.json`
Script->>Repo: Write substituted `config/omp/config.yml`
HM->>Repo: Home Manager activation reads module `config/omp/default.nix`
HM->>FS: Create `~/.omp/agent/` (after writeBoundary)
HM->>FS: Copy module `config.yml` -> `~/.omp/agent/config.yml`
HM->>FS: Set permissions to 0644
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request centralizes the management of OMP (Open Mind Platform) configuration within the existing dotfiles infrastructure. It introduces a dedicated Nix module to deploy OMP's Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Mesa DescriptionTL;DRManage OMP configuration through dotfiles templates and Home Manager, ensuring the config is copied into What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request introduces configuration management for OMP via dotfiles templates, which is a good addition. The changes are well-structured, adding a new Nix module for OMP, a configuration template, and integrating it with the existing llm-update.sh script. My review found one area for improvement in the Nix activation script for better robustness. Overall, the changes are clear and follow the repository's conventions.
| $DRY_RUN_CMD mkdir -p ~/.omp/agent | ||
| $DRY_RUN_CMD cp -f ${./config.yml} ~/.omp/agent/config.yml | ||
| $DRY_RUN_CMD chmod 644 ~/.omp/agent/config.yml |
There was a problem hiding this comment.
For better robustness in shell scripting within Nix expressions, it's preferable to use the $HOME environment variable instead of the tilde ~ for referring to the user's home directory. While ~ often works, $HOME is more explicit and less prone to expansion issues in certain shell contexts. Quoting the path is also a good practice to handle potential special characters.
$DRY_RUN_CMD mkdir -p "$HOME"/.omp/agent
$DRY_RUN_CMD cp -f ${./config.yml} "$HOME"/.omp/agent/config.yml
$DRY_RUN_CMD chmod 644 "$HOME"/.omp/agent/config.yml
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
There was a problem hiding this comment.
Pull request overview
Adds dotfiles-managed configuration for OMP under config/omp, wires it into the existing Nix config import list, and integrates it into the repo’s template→generated-config workflow via scripts/llm-update.sh.
Changes:
- Add
config/ompHome Manager module that copies a tracked OMP config into~/.omp/agent/config.ymlon activation (no symlink). - Introduce
config/omp/config.tpl.ymland generateconfig/omp/config.ymlviascripts/llm-update.sh. - Import
./ompfromconfig/default.nixto enable the module.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/llm-update.sh | Adds template mapping to generate config/omp/config.yml from config.tpl.yml. |
| config/omp/default.nix | New HM activation script to copy OMP config into ~/.omp/agent/. |
| config/omp/config.yml | Generated concrete OMP config (post-template substitution). |
| config/omp/config.tpl.yml | Template OMP config using __GPT__ placeholder for model selection. |
| config/default.nix | Imports ./omp so the new module is activated. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $DRY_RUN_CMD cp -f ${./config.yml} ~/.omp/agent/config.yml | ||
| $DRY_RUN_CMD chmod 644 ~/.omp/agent/config.yml |
There was a problem hiding this comment.
The activation script installs the OMP config with mode 644, which makes it world-readable if the user's home directory is not 0700. If this file can ever contain tokens/identifiers (now or in future OMP versions), this is an avoidable information exposure; prefer chmod 600 (matching config/codex/default.nix) and consider also tightening directory perms if needed.
| $DRY_RUN_CMD cp -f ${./config.yml} ~/.omp/agent/config.yml | |
| $DRY_RUN_CMD chmod 644 ~/.omp/agent/config.yml | |
| $DRY_RUN_CMD chmod 700 ~/.omp/agent | |
| $DRY_RUN_CMD cp -f ${./config.yml} ~/.omp/agent/config.yml | |
| $DRY_RUN_CMD chmod 600 ~/.omp/agent/config.yml |
| @@ -0,0 +1,12 @@ | |||
| lastChangelogVersion: 13.13.2 | |||
| modelRoles: | |||
| default: codex/__GPT__ | |||
There was a problem hiding this comment.
The PR description says the generated config keeps the default role on codex/__GPT__, but scripts/llm-update.sh replaces __GPT__ placeholders with the concrete value from models.json (so the generated config.yml becomes codex/gpt-5.4). Please update the PR description or adjust the template/substitution behavior if you intended the placeholder to remain in the generated file.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
config/omp/config.tpl.yml (1)
1-1: Add a provenance header to reduce generated-file drift.A brief comment here makes it explicit that
config/omp/config.ymlis generated and should not be edited directly.Proposed change
+ # Template source for config/omp/config.yml (generated via scripts/llm-update.sh). + # Edit this file, then regenerate. lastChangelogVersion: 13.13.2🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@config/omp/config.tpl.yml` at line 1, Add a short provenance header comment at the top of the template file to indicate that config/omp/config.yml is generated and must not be edited directly; update config/omp/config.tpl.yml by inserting a brief human-readable comment above the existing key (e.g., above lastChangelogVersion) that states the file is generated, lists the generator or template name and optionally the generation timestamp or commit id to reduce churn in generated-file diffs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@config/omp/config.tpl.yml`:
- Line 1: Add a short provenance header comment at the top of the template file
to indicate that config/omp/config.yml is generated and must not be edited
directly; update config/omp/config.tpl.yml by inserting a brief human-readable
comment above the existing key (e.g., above lastChangelogVersion) that states
the file is generated, lists the generator or template name and optionally the
generation timestamp or commit id to reduce churn in generated-file diffs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 257475ae-93be-4155-aca7-558e9e8bd02d
📒 Files selected for processing (5)
config/default.nixconfig/omp/config.tpl.ymlconfig/omp/config.ymlconfig/omp/default.nixscripts/llm-update.sh
Add dotfiles-managed OMP config under config/omp and wire it into the existing Nix config module list.
This keeps only ~/.omp/agent/config.yml under dotfiles control while leaving OMP runtime state such as databases and session files untouched. The Home Manager module uses copy semantics instead of symlinks so the tracked config behaves like other mutable CLI configs in this repo.
The OMP config also follows the existing models.json template convention by introducing config/omp/config.tpl.yml and adding it to scripts/llm-update.sh. The generated config keeps the default role on codex/GPT.
Additional context:
Summary by cubic
Manage
ompconfig via dotfiles using a Home Manager activation step that copies the tracked config to~/.omp/agent/config.ymlwithout touching runtime state. Adds a template wired toscripts/llm-update.shfor automatic regeneration../ompinconfig/default.nix.config/omp/config.ymlto~/.omp/agent/config.ymlon activation (no symlink); leave runtime files unmanaged; chmod 644.config/omp/config.tpl.ymland map it inscripts/llm-update.sh; template keeps default role oncodex/__GPT__.doubleEscapeAction: none.Written for commit 96842af. Summary will update on new commits.