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
fix(safety): merge review warning in _after; fix intercepted audit
CongkeChen review #3:
1. _filter.py: NEEDS_HUMAN_REVIEW warning was lost because BaseFilter.run overwrites result.rsp with the tool's return value in handle(). Stash the report in a ContextVar during _before and merge safety_warning/safety_risk_level/safety_rule_ids in _after so the caller sees them.
2. _wrapper.py: intercepted=report.blocked used policy.block_on_review, so when safety_wrapper(raise_on_deny=False) or SafetyReviewedSkillRunner(block_review=True) overrode the policy, the audit falsely recorded intercepted. Now compute intercepted from the actual control flow.
3. _wrapper.py: drop unused block_on_review param of _scan_code_input.
Regression tests: test_run_filters_needs_review_merges_warning_into_result, test_skill_runner_block_review_overrides_policy_records_intercepted, test_safety_wrapper_raise_on_deny_false_records_intercepted_false
0 commit comments