Repository navigation
fix(hooks): the Claude Code and Codex hooks stay inside their session's namespace - #698
Merged
Merged
Conversation
…'s namespace The hooks inherit the session's PLUMB_NAMESPACE but never sent it, so the daemon matched a hook's conversation in any namespace: a default-namespace hook could read a namespaced session's unread count, hint root or /clear handover. The mailbox probe, the context-hint request and the /clear notice now carry the token; the daemon resolves it (connRegistry.namespaceForToken) and answers only from that namespace's connections — the default namespace for no token, nobody for a released or expired one. /clear markers are keyed by namespace, and an id carrying ':' cannot forge another namespace's key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is refused, not answered from the default namespace Pins namespaceForToken against the real registry (live, none, released). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the handover, hint and wiring paths Review of #698: hookPeerCount counted sessions of every namespace, which both extended a watcher for nobody and revealed another namespace's sessions. It now counts only the caller's namespace. Hint state (window, seeds) is keyed by namespace; a malformed token skips the /clear notice rather than sending it as the default namespace; the daemon's registry-backed control handlers are built by registryCtrlHandlers so their wiring is testable. New tests pin the namespaced /clear handover, both hint resolve calls and the wiring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dow or seeds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wance The context-hint allowance (per-turn and per-agent bytes) is now keyed by the namespace-qualified id (namespacedID, renamed from clearMarkerKey); the default namespace's rows are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
golimpio
approved these changes
Oct 16, 2026
atlas-from-plumb
added a commit
that referenced
this pull request
Oct 16, 2026
Hooks stay inside their session's namespace (#698); context-hint uptake credits a hint's use on a connection its session alone declared (#699); the shared file watcher leaves linked git worktrees out (#700); an [lsp] restart can no longer land on a superseded config (#701). Plumb-Session: forest-ridge Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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.
What
plumb hooks run-claude/run-codexinherit the session'sPLUMB_NAMESPACEbut never sent it, so the daemon matched a hook's conversation in any namespace: a default-namespace hook could read a namespaced session's unread count, resolve its hint root, or hand over its/clearmarker (follow-up from PLAN-520 slice C)./clearnotice now carry the token (hooks_namespace.go).connRegistry.namespaceForToken) and answers only from that namespace's connections: the default namespace for no token, nobody for a released/expired token, and nobody for a tokened request when no resolver is wired — never a fallback to the default namespace./clearmarkers are keyed by namespace; a conversation id carrying:cannot forge another namespace's key./clearline's second word only makes an old daemon store a marker nobody takes (advisory).Verification
internal/cli/hooks_namespace_test.go: token read; each handler scoped and refusing; probe and hint lookups filtered by namespace; the hook senders carry the token (fake control socket); marker keys separate namespaces; id forgery; resolver against the real registry (live / none / released).🤖 Generated with Claude Code