fix: address critical review findings for tool guard architecture#190
Merged
SuuBro merged 1 commit intogoal/simplify-t-703f66e2from Apr 2, 2026
Merged
Conversation
- Fix 1: Add writeToolGuardExtension call to buildToolActivationArgs so guard is loaded on session restart/restore/role-change (was missing) - Fix 2: Resolve pending grant request before creating new one to prevent concurrent requests from clobbering each other - Fix 3: Pass grantedTools to writeToolGuardExtension in session-setup.ts so restarted sessions preserve existing grants - Fix 4: Remove stale code — (sessionManager as any) cast, dead grantPolicy bindings in UI, legacy string checks in policy helpers Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
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.
Fixes four review findings from the tool guard implementation:
Fix 1 [HIGH]: Guard extension missing after session restart
writeToolGuardExtensioncall tobuildToolActivationArgsin session-manager.tsFix 2 [HIGH]: Concurrent grant requests clobber each other
requestToolGrant, resolve any existing pending request with{ granted: false }before creating a new oneFix 3 [MEDIUM]: Pass grantedTools to guard on restart
plan.effectiveAllowedToolstowriteToolGuardExtensionin session-setup.tsallowedTools(which include grants) in session-manager.ts restart pathsFix 4 [LOW]: Remove stale code
(sessionManager as any)cast in server.ts for requestToolGrant.grantPolicybinding in MessageList.tsgrantPolicyextraction in AgentInterface.tsisAllowPolicy/isAskPolicy/isNeverPolicyto check only normalized valuesAll checks pass: type-check, 327 unit tests, 371 E2E tests.
🤖 Generated with Bobbit