Skip to content

fix: address critical review findings for tool guard architecture#190

Merged
SuuBro merged 1 commit intogoal/simplify-t-703f66e2from
goal-goal-simplify-t-703f66e2-coder-161b1630
Apr 2, 2026
Merged

fix: address critical review findings for tool guard architecture#190
SuuBro merged 1 commit intogoal/simplify-t-703f66e2from
goal-goal-simplify-t-703f66e2-coder-161b1630

Conversation

@SuuBro
Copy link
Copy Markdown
Owner

@SuuBro SuuBro commented Apr 2, 2026

Fixes four review findings from the tool guard implementation:

Fix 1 [HIGH]: Guard extension missing after session restart

  • Added writeToolGuardExtension call to buildToolActivationArgs in session-manager.ts
  • Updated all 4 callers to pass sessionId and grantedTools
  • Guard extension is now loaded on session restore, role assignment, personality update, and abort/restart

Fix 2 [HIGH]: Concurrent grant requests clobber each other

  • In requestToolGrant, resolve any existing pending request with { granted: false } before creating a new one

Fix 3 [MEDIUM]: Pass grantedTools to guard on restart

  • Pass plan.effectiveAllowedTools to writeToolGuardExtension in session-setup.ts
  • Pass session's current allowedTools (which include grants) in session-manager.ts restart paths

Fix 4 [LOW]: Remove stale code

  • Remove (sessionManager as any) cast in server.ts for requestToolGrant
  • Remove dead .grantPolicy binding in MessageList.ts
  • Remove dead grantPolicy extraction in AgentInterface.ts
  • Simplify isAllowPolicy/isAskPolicy/isNeverPolicy to check only normalized values

All checks pass: type-check, 327 unit tests, 371 E2E tests.

🤖 Generated with Bobbit

- 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>
@SuuBro SuuBro merged commit 7da6bf7 into goal/simplify-t-703f66e2 Apr 2, 2026
@SuuBro SuuBro deleted the goal-goal-simplify-t-703f66e2-coder-161b1630 branch April 9, 2026 12:23
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.

2 participants