Merged
Conversation
- Add ownership check on delete endpoint's RunManager path (prevents cross-tenant run state leak) - Fix stream/status DB fallback to use _owner_filter(auth) for admin bypass consistency - Consolidate _run_list_item into shared run_to_list_item helper in schemas/runs.py (was duplicated in graphs.py and runs.py) - Merge duplicate validate exception blocks - Fix non-deterministic test_delete_active_run_rejected to use DB-inserted run instead of racing against fast execution Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move _owner_filter to shared owner_filter() in auth/deps.py, remove duplicates from graphs.py and runs.py - Add test_delete_live_run_in_manager_rejected verifying ownership check on RunManager path (different owner gets 404, not 409) - Add code-review-before-PR rule to CLAUDE.md non-negotiables Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Fixes all findings from the 3-agent parallel code review (security, logic, quality) run against Phase 4.
delete_run. Previously, any authenticated user could confirm another user's run was active (409 vs 404).owner_filter(auth)instead ofauth.owner_id, matching cancel/delete/list behavior._owner_filter(quality WARNING) — Consolidated into sharedowner_filter()inauth/deps.py. Both route modules now import from one place._run_list_item(quality WARNING) — Consolidated intorun_to_list_item()inschemas/runs.py.test_delete_active_run_rejectednow uses DB-inserted run instead of racing against fast execution.except GraphBuildErrorblocks collapsed into onetry.test_delete_live_run_in_manager_rejectedverifying different owner gets 404 (not 409) on RunManager path.Code review results
All 3 reviewers ran on this fix branch before PR:
_owner_filterduplication, missing RunManager delete testSecond round addressed quality findings —
owner_filterconsolidated, RunManager delete test added.Test plan
test_delete_live_run_in_manager_rejected)ruff check)tsc --noEmit)🤖 Generated with Claude Code