Repository navigation
fix(policies): make the evaluate fast path see root session policies - #7319
omni-resolve-agent[bot] wants to merge 1 commit into
Conversation
any_policies_apply checked the agent spec, the sub-agent's own spec, server/store defaults, and the session's OWN policies, but never the ROOT conversation's session policies, which build_policy_engine inherits into every descendant's pipeline. A sub-agent carrying no policies of its own therefore short-circuited POST /policies/evaluate to POLICY_ACTION_ALLOW and ran shell/file tools ungated past the root session's ask-on-shell approval gate. Check the root's session policies through the conversation row's root_conversation_id before fast-pathing; the read hits the same per-session LRU cache, so the guard stays O(1) on warm calls. Covers the guard with a builder-layer unit test and an end-to-end browser test proving a policy-free sub-agent's Bash call parks the inherited approval card before the tool runs.
|
UI Preview for this PR has been removed. |
|
|
Closing this PR because the work it addresses is already resolved: #7316 closed as completed; OMNI-7734 is Done. The fix appears to have landed elsewhere. If that's not right and this PR still has unique value, comment |
Related issue
Closes #7316
Resolves OMNI-7734
Summary
A child session with no policies of its own could bypass approval rules inherited from the root session.
The policy fast path now checks the root session's policies before allowing an early return, so descendants reach the normal inheritance-aware evaluator.
Test Plan
Regression coverage in this PR targets the reported behavior. The original description did not record a test-run result; the linked resolve update contains the historical verification context.
Changed regression coverage:
tests/e2e_ui/approvals/test_subagent_policy_inheritance.pytests/runtime/policies/test_builder_session_policies.pySuggested check from the PR checkout, with the repository test dependencies installed (not rerun for this edit):
Source reports and verification runs
Original resolve workflow
Latest resolve-agent update
Demo
Recordings from the resolve-agent update; Linear sign-in required. Captions describe the recorded environment, not a new test run.
before-subagent-ungated.mp4
after-subagent-gated.mp4
Type of change
Test coverage
Coverage notes
Test results above are attributed to the original resolve runs. No product tests were rerun for this description-only update.