Skip to content

fix: protect foreign session permissions - #34

Merged
leoncheng57 merged 4 commits into
mainfrom
fix/session-permission-safety
Aug 21, 2026
Merged

fix: protect foreign session permissions#34
leoncheng57 merged 4 commits into
mainfrom
fix/session-permission-safety

Conversation

@leoncheng57

Copy link
Copy Markdown
Owner

Summary

  • establish a session's upstream agent identity from session metadata and persisted messages before activating Plan/Build policy
  • reject foreign or unknown agents with actionable typed 409 errors before PATCH or prompt delivery
  • keep Plan/Build recovery and idempotent permission suffix behavior while showing unsupported sessions honestly in the client

Verification

  • npx vitest run tests/agent-mode.test.ts tests/session-mode-policy.test.ts
  • npm run test:e2e -- --grep "foreign agent|unknown agent identity|recovers Build|fails closed when Plan|supports Build to Plan"
  • npm run typecheck
  • npm test
  • npm run build
  • git diff --check

@leoncheng57
leoncheng57 merged commit f993fc3 into main Aug 21, 2026
3 checks passed
@leoncheng57
leoncheng57 deleted the fix/session-permission-safety branch August 21, 2026 23:58
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.

1 participant