Skip to content

fix(subagents) share execpolicy by default#13702

Merged
dylan-hurd-oai merged 15 commits intomainfrom
dh--subagent-exec-policy
Mar 18, 2026
Merged

fix(subagents) share execpolicy by default#13702
dylan-hurd-oai merged 15 commits intomainfrom
dh--subagent-exec-policy

Conversation

@dylan-hurd-oai
Copy link
Collaborator

Summary

If a subagent requests approval, and the user persists that approval to the execpolicy, it should (by default) propagate. We'll need to rethink this a bit in light of coming Permissions changes, though I think this is closer to the end state that we'd want, which is that execpolicy changes to one permissions profile should be synced across threads.

Testing

  • Added integration test

}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn spawned_subagent_execpolicy_amendment_propagates_to_parent_session() -> Result<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel there are a lot of redundant tests in this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point - I'll dedupe before merging

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think:

  1. this test in approvals.rs is a bit of a convoluted example but tests the end-to-end flow
  2. child_uses_parent_exec_policy should be in exec_policy.rs, but should have reasonable test coverage, it's a somewhat brittle piece of logic
  3. concurrent_execpolicy_amendments_preserve_both_rules is technically different, but overkill / specific. will remove

@dylan-hurd-oai dylan-hurd-oai force-pushed the dh--subagent-exec-policy branch from 249b35b to 94d41ea Compare March 18, 2026 01:09
@dylan-hurd-oai dylan-hurd-oai enabled auto-merge (squash) March 18, 2026 05:57
@dylan-hurd-oai dylan-hurd-oai force-pushed the dh--subagent-exec-policy branch from 12ef4da to 033ba0a Compare March 18, 2026 06:18
@dylan-hurd-oai dylan-hurd-oai merged commit 84f4e7b into main Mar 18, 2026
33 checks passed
@dylan-hurd-oai dylan-hurd-oai deleted the dh--subagent-exec-policy branch March 18, 2026 06:42
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants