You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
- Remove `_check_task_ownership()` from the MCP tool layer (tools.py) —
the Engine already validates task ownership on every API call via
`get_user_task() → session.owner_account_id == user_id`
- Remove `_validate_task_owner()` cross-check from REST endpoints
(routes.py) — the poll token is cryptographically random and
task-scoped, making the ownership cross-check redundant defense-in-depth
- Remove 4 Redis functions (`store_task_owner`, `get_task_owner`,
`get_poll_token_owner`, `user_id` param from `store_poll_token`) and
eliminate 2 Redis keys per task: `mcp:task_owner:{task_id}` and
`mcp:poll_owner:{task_id}`
Net: **-319 lines**, fewer Redis round-trips per request, no change in
security posture.
## Test plan
- [x] All 371 existing tests pass (format, lint, typecheck hooks all
green)
- [x] Ownership-specific tests removed (tested behavior no longer
exists)
- [x] Poll token validation remains intact as primary REST auth gate
- [ ] Verify on staging: submit task → poll progress → fetch results
works end-to-end
- [ ] Verify multi-user isolation still works via Engine auth
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sourced from commit c5fc538f4b3e8c68d4c3268e4417c9711ff334f9
0 commit comments