feat(copilot): carry over host settings into container#438
Open
abezzub-dr wants to merge 3 commits into
Open
Conversation
dc83862 to
900dfaa
Compare
Contributor
Author
|
this has a dependency on #437, so I will rebase + update this PR once that lands |
Read ~/.copilot/settings.json and optional ~/.moat/copilot/settings.json overrides, filter through an allowlist of safe/useful settings, and write the merged result to the container staging directory. Carried over: statusLine, theme, model, effortLevel, contextTier, mouse, beep, beepOnSchedule, renderMarkdown, scrollbar, compactPaste, copyOnSelect, stream, terminalProgress, updateTerminalTitle, banner, showTipsOnStartup, keepAlive, memory, includeCoAuthoredBy, subagents, tabs, screenReader, stayInAutopilot, continueOnAutoMode. Excluded (unsafe/nonfunctional in containers): proxyUrl, allowedUrls, deniedUrls, notifications, hooks, trustedFolders, ide.*. Precedence: CLI flag / moat.yaml > settings.json > Copilot default. Model/effortLevel/contextTier are stripped from settings.json when the corresponding CLI flag or moat.yaml field is set (they become --flags which naturally override). MergeSettings accepts MergeOpts to avoid coupling to mutable package-level state. MOAT_SKIP_HOST_COPILOT_SETTINGS=1 disables the feature for tests/CI.
900dfaa to
e779f9e
Compare
Strip contextTier/effortLevel from the staged settings.json when --context/--reasoning-effort or copilot.context/copilot.reasoning_effort (added in majorcontext#437) pin them, matching the existing model behavior. PrepareContainer now reads the overrides from provider.PrepareOpts instead of the copilot CLI's package globals, so 'moat run' with agent: copilot applies moat.yaml precedence too. The copilot command's ConfigureAgent writes flag-resolved values back into the config, which the run manager threads through setupCopilotStaging. Document the settings passthrough in the Copilot guide.
Read host Copilot settings from COPILOT_HOME when configured and normalize legacy colorMode values to the current theme key before writing container settings. Co-authored-by: Copilot <223556219+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.
Read
~/.copilot/settings.jsonand optional~/.moat/copilot/settings.jsonoverrides, filter through an allowlist of safe/useful settings, and write the merged result to the container staging directory.Settings carried over
contextTier, effortLevel, footer, includeCoAuthoredBy, model, mouse, subagents, tabs, theme
Security: statusLine
statusLine.commandexecutes arbitrary commands inside the container. It is only allowed from~/.moat/copilot/settings.json(explicit user opt-in), not from the host's~/.copilot/settings.json.Precedence
CLI flag / moat.yaml > settings.json > Copilot default
Model/effortLevel/contextTier are stripped from settings.json when the corresponding CLI flag or moat.yaml field is set.
Design
MergeSettings(MergeOpts{})accepts override values as parameters (no global state coupling)MOAT_SKIP_HOST_COPILOT_SETTINGS=1disables the feature for tests/CI