fix(toolexec): repair build after approvalMu removal#3576
Merged
Conversation
Semantic merge conflict: PR #3490 removed Dispatcher.approvalMu and moved permission locking into the session package, but sessionPermissionsAllow still referenced c.d.approvalMu. Rewrites it to use sess.ClonePermissions() instead. Assisted-By: Claude
Sayt-0
approved these changes
Jul 10, 2026
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.
Main currently fails to compile due to a semantic merge conflict. PR #3490 removed
Dispatcher.approvalMuand moved permission locking into the session package's own mutex, but an earlier commit (0a2dafd) that fixed the preempt-yolo "always allow" path had already addedsessionPermissionsAllow()inpkg/runtime/toolexec/dispatcher.go— a function that referencesc.d.approvalMu. Both changes merged cleanly at the text level, but the combined result references a field that no longer exists.The fix rewrites
sessionPermissionsAllowto usesess.ClonePermissions(), the thread-safe accessor that the new locking model exposes, eliminating the direct mutex reference on the dispatcher entirely. The behavior is identical: permissions are read under the session's own lock rather than a separate dispatcher-level one.No API or behavior changes; this is a pure build fix.