Skip to content

Conversation

@theahura
Copy link
Contributor

Summary

🤖 Generated with Nori

  • Fixed bug where /approvals command was not working in ACP mode - selecting "full access" still prompted for permissions
  • Added tokio::sync::watch channel to broadcast approval policy changes from AcpBackend::submit() to the long-running approval handler task
  • Now handles Op::OverrideTurnContext to update the policy dynamically, making /approvals work equivalently to --yolo when full access is selected

Test Plan

  • Added test_approval_policy_dynamic_update unit test that verifies:
    • Initial OnRequest policy correctly forwards approval requests to TUI
    • Policy update to Never via watch channel takes effect immediately
    • Subsequent requests are auto-approved without prompting

Share Nori with your team: https://www.npmjs.com/package/nori-ai

The /approvals command was not working in ACP mode because:
- run_approval_handler captured approval_policy by value at spawn time
- Op::OverrideTurnContext was ignored in the ACP submit() method

This fix uses a tokio::sync::watch channel to broadcast policy changes
from AcpBackend::submit() to the long-running approval handler task,
enabling mid-session policy changes (e.g., switching to full access mode).

Changes:
- Add approval_policy_tx watch::Sender field to AcpBackend
- Create watch channel in spawn() and pass receiver to handler
- Handle Op::OverrideTurnContext to update policy via watch channel
- Update run_approval_handler to read current policy on each request
🤖 Generated with [Nori](https://nori.ai)

Co-Authored-By: Nori <contact@tilework.tech>
@theahura theahura merged commit 9a570c9 into dev Jan 19, 2026
3 checks passed
@theahura theahura deleted the fix-acp-approval-policy branch January 19, 2026 00:08
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.

2 participants