Repo-local .honcho configuration overlay#44
Conversation
Add an optional per-project configuration overlay: a `.honcho/config.json` inside a repository overrides the global `~/.honcho/config.json` for that working tree. This lets you route a project's memory to its own Honcho workspace so unrelated projects don't pollute each other's representation, without putting secrets in the repo — only the fields you set are overridden; apiKey, endpoint, and the rest inherit from the global config. The overlay is discovered by walking up from the working directory to the nearest `.honcho/config.json` (never the global ~/.honcho) and is honored by all hooks and the MCP server. It is read-only: the plugin never writes the repo file, and a repo-local override can never leak into the global config. Sessions anchor to the project root (the folder containing `.honcho/`) rather than the transient working directory, so a project's subfolders share one session instead of fragmenting; `sessionName` pins an exact name, and the opt-in `splitSubmodules` gives each nested git submodule its own session while inheriting the parent workspace. The injected-context cache is keyed by workspace so concurrent sessions on different workspaces never read each other's at-prompt context hint. Additive and opt-in: with no `.honcho/` present, resolution, hooks, caching, and the MCP server behave exactly as before.
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 18 minutes and 46 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR implements repository-local configuration overlays at ChangesRepository-Local Configuration Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Line 12: The CHANGELOG line incorrectly states that set_config directs edits
to the repo file; update the wording so it matches the implementation: in
local-config mode the MCP server rejects set_config writes and users must edit
.honcho/config.json manually. Edit the sentence referencing get_config and
set_config to note that get_config reports when a repo-local config is active
and that set_config does not write repo-local configs (MCP rejects the write) —
users are instructed to update .honcho/config.json by hand instead.
In `@README.md`:
- Around line 209-210: Update the README wording to reflect current behavior:
change the sentence about set_config to state that when a repo-local config is
active (as shown by /honcho:status) the plugin treats configs as read-only and
set_config returns a read-only response (edits must be made directly to the repo
file) instead of implying set_config still writes; also correct the cache-key
description to state caches in ~/.honcho are keyed by workspace (not by
directory) and explain that workspace-scoped keying prevents cross-project
collisions. Reference the terms set_config, /honcho:status, and ~/.honcho when
making these text edits so the doc accurately matches implementation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5d25dad5-f1dc-4fc7-adc5-2c1c4dae6f21
📒 Files selected for processing (5)
CHANGELOG.mdREADME.mdplugins/honcho/src/cache.tsplugins/honcho/src/config.tsplugins/honcho/src/mcp/server.ts
…ehavior Addresses CodeRabbit review feedback on plastic-labs#44 — the docs described set_config behavior that did not match the implementation. When a repo-local config is active, set_config writes nothing (neither the repo file nor the global config) and returns a read-only notice. The CHANGELOG ("directs edits to the repo file") and README ("continues to target the global config") each implied a write that does not happen, so both now state that set_config won't modify it and points you to edit the repo file directly. The MCP server's runtime notice — previously "set_config only edits the global config", the source of the ambiguity — is reworded to match. The README also still described caches as "keyed by directory"; the injected-context cache is now keyed by workspace (this PR's change), so it now describes both: context hints by workspace, per-project session/git state by directory.
Mirrors the plastic-labs#44 doc/notice fix onto main so the local plugin and docs match the implementation.
Repo-local
.honchoconfiguration overlayAdds an optional per-project configuration overlay: a
.honcho/config.jsoninside a repository overrides the global~/.honcho/config.jsonfor that working tree.Why
Honcho gives Claude Code a single global workspace, so for anyone working across multiple projects, every project's messages, tool activity, and derived conclusions land in the same workspace and shape one shared representation. There's no way to say "this repository's memory belongs to workspace X," which causes cross-project bleed — unrelated work clouding a workspace you'd rather keep focused. This overlay makes per-project isolation possible, declaratively and per repo, without putting credentials in the repo.
How it works
apiKey,endpoint,peerName, and the rest inherit from the global config, so the repo file is usually just{ "workspace": "my-project" }— no secrets in the repo, safe to commit and share across machines..honcho/config.jsonat or above the working directory wins (the global~/.honchois never treated as repo-local). One file at the project root covers the whole tree; another in a subtree scopes that subtree. Honored by all hooks and the MCP server.get_configreports when a repo-local config is active;set_configdirects edits to the repo file.sessionNamepins an exact name; opt-insplitSubmodulesgives each nested git submodule its own session while inheriting the parent's workspace, since submodules are independent codebases you may want tracked separately without adding a file to each.Compatibility
Entirely additive and opt-in: with no
.honcho/present, config resolution, the hook lifecycle, caching, and the MCP server behave exactly as before. The overlay is a thin layer in front ofloadConfig()and existing functions keep their semantics. No version or manifest changes;bunx tsc --noEmitpasses.Verification
Exercised end-to-end against a self-hosted Honcho instance: a repo override routes that project's messages to its own workspace, isolated from the global workspace; the default path still routes to the global workspace and leaves the global config byte-for-byte unchanged; subfolders consolidate to one project-root session;
splitSubmodulesgives nested git repos (including.git-file submodules) their own session while inheriting the workspace; and concurrent workspaces read only their own cached context. Verified via direct resolution checks and by running the real hooks as subprocesses.Summary by CodeRabbit
Release Notes
New Features
.honcho/config.jsonin your repository to override selected fields from global config while inheriting the rest.splitSubmodulesconfiguration option.Documentation