Fix #5: Add sub-agent event streaming and fine-grained permissive control#6
Merged
ZhiXiao-Lin merged 1 commit intoA3S-Lab:mainfrom Mar 9, 2026
Conversation
…trol This commit addresses both issues raised in #5: ## Issue 1: Sub-agent event streaming - Added `event_tx` field to `SubAgentHandle` to enable event subscriptions - Added `events()` method to `SubAgentHandle` for filtered event streams - Forward `TextDelta` and `TurnStart` events as `SubAgentInternalEvent` in wrapper - Updated `spawn_subagent()` to pass event transmitter to handle Now users can call `handle.events()` to get a stream of all events for that specific sub-agent, including LLM thinking text, tool calls, and state changes. ## Issue 2: Fine-grained permissive control - Added `permissive_deny` field to `SubAgentConfig` and `AgentSlot` - Added `with_permissive_deny()` builder methods - Modified wrapper to build permissive policy that respects deny rules - When `permissive=true`, deny rules from both config and agent definition are enforced Now users can use `permissive=true` for broad permissions while still blocking specific tools via `permissive_deny` (e.g., ["mcp__longvt__*"]). ## SDK Updates - Updated Python SDK to expose `permissive_deny` parameter - Updated Node.js SDK to expose `permissive_deny` parameter Both SDKs now support the new fine-grained permissive control.
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.
Fix #5: Add sub-agent event streaming and fine-grained permissive control
This PR addresses both issues raised in #5 regarding the Orchestrator API.
Issue 1: Sub-agent event streaming ✅
Problem
SubAgentActivityonly exposed basic activity types (idle,requesting_llm,calling_tool) with minimal data. There was no way to access:Solution
event_txfield toSubAgentHandleto enable event subscriptionsevents()method toSubAgentHandlethat returns a filtered event streamTextDeltaandTurnStartevents asSubAgentInternalEventin wrapperspawn_subagent()to pass event transmitter to handleUsage Example
Issue 2: Fine-grained permissive control ✅
Problem
SubAgentConfig(permissive=True)completely bypassed the agent.mdfile'spermissions.denylists. There was no middle ground - it was all-or-nothing.Solution
permissive_denyfield to bothSubAgentConfigandAgentSlotwith_permissive_deny()builder methodspermissive_denyconfig fieldUsage Example
SDK Updates
Both Python and Node.js SDKs have been updated to expose the new
permissive_denyparameter:Python:
Node.js:
Files Changed
core/src/orchestrator/config.rs- Addedpermissive_denyfield and builderscore/src/orchestrator/handle.rs- Addedevent_txandevents()methodcore/src/orchestrator/agent.rs- Passevent_txto handlecore/src/orchestrator/wrapper.rs- Forward events, fix permissive modesdk/python/src/lib.rs- Exposepermissive_denyparametersdk/node/src/lib.rs- Exposepermissive_denyparameterTesting
The changes maintain backward compatibility:
permissive_denycontinues to work (defaults to empty list)events()continues to workBreaking Changes
None. All changes are additive and backward compatible.