Skip to content

feat: per-repository settingSources override - #1375

Open
yscivideo wants to merge 1 commit into
cyrusagents:mainfrom
yscivideo:cedric/per-repo-setting-sources
Open

yscivideo wants to merge 1 commit into
cyrusagents:mainfrom
yscivideo:cedric/per-repo-setting-sources

Conversation

@yscivideo

Copy link
Copy Markdown

What

Adds repositoryConfig.settingSources so a self-hosted multi-repo setup can opt a specific repository out of the Claude Agent SDK's default ["user", "project", "local"] setting sources.

Why

When one Cyrus install serves several repositories, every session inherits the operator's global ~/.claude user-scope surface — skills, slash commands, agents, plugin MCP servers. For a repo that ships its own project-scope .claude/ config, that inherited surface is dead weight in every session's context (in our install: 133 slash commands → 35, 104 skills → 15 after opting the repo down to ["project", "local"]).

How

  • New optional settingSources field on RepositoryConfig (JSON schema + types), validated by a shared isValidSettingSourcesOverride helper in cyrus-core: must be a non-empty array of "user"/"project"/"local".
  • Threaded through RunnerConfigBuilder (Claude runner only) and the prewarm path in EdgeWorker, mirroring the existing repository.model / repository.fallbackModel precedence pattern.
  • Unset or invalid override falls back to the stock default — behavior is unchanged unless a repo opts in.

Testing

  • 11 new tests (ClaudeRunner, RunnerConfigBuilder, core validator); full monorepo build + pnpm test:packages:run green.
  • Running in production on our self-hosted install as a local dist patch; upstreaming as a proper config-schema feature.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QUrjDzWxhuTbN53VT9a13K

Adds repositoryConfig.settingSources so a self-host multi-repo setup
can opt a specific repo out of the Claude Agent SDK's default
["user", "project", "local"] settingSources — useful when a repo
should not inherit the operator's global ~/.claude user-scope
settings (per-repo context hygiene).

Validated via the shared isValidSettingSourcesOverride helper
(cyrus-core): must be a non-empty array of "user"/"project"/"local".
An unset or invalid override falls back to the existing stock
default, so behavior is unchanged unless a repo opts in. Threaded
through RunnerConfigBuilder (Claude runner only) and the prewarm
path in EdgeWorker, mirroring the existing repository.model /
repository.fallbackModel precedence pattern.

This has been running in production on our self-hosted install as a
local patch; upstreaming it now as a proper config-schema feature.
@Connoropolous

Copy link
Copy Markdown
Contributor

Hi @yscivideo

Which company are you running Cyrus at that you ran into this?

Thanks for contributing, I've taken a quick look at the code.

@yscivideo

Copy link
Copy Markdown
Author

Thanks for taking a look. It's a self-hosted install driving an educational-content pipeline out of a single Linear workspace. The operator account on that machine has a large user-scope ~/.claude — 133 slash commands and 104 skills, mostly unrelated to this repo — and every session inherited all of it even though the repo ships its own .claude/ config with the ~15 skills it needs. Opting it down to ["project", "local"] cut that to 35 commands / 15 skills. I'd expect it anywhere one install serves several repos and the operator account carries its own user-scope config. Happy to adjust anything in the implementation.

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.

3 participants