2.6 KiB
2.6 KiB
Created
Created by tickets.sh create.
Plan
Preflight implementation plan
Classification: implementation-ready.
No product/API decision is needed before coding. ScopeSubDelegated remains a valid typed PodEvent for registry side effects and upward propagation, but must not enter the agent-visible notification/history/auto-kick lane.
Current code map:
crates/protocol/src/lib.rs:PodEventvariants and protocol roundtrip tests.crates/pod/src/controller.rs: idleMethod::PodEventhandler applies side effects, pushes notification, and auto-kicks; running-path handler applies side effects and pushes intoNotifyBuffer.crates/pod/src/ipc/event.rs: transport helpers andapply_event_side_effects;ScopeSubDelegatedregisters grandchild and re-emits upward.crates/pod/src/ipc/notify_buffer.rs: agent-visible notification/history lane.crates/pod/src/ipc/interceptor.rs: drainsNotifyBufferinto session history/context.- Existing tests: controller tests for visible
TurnEnded, pod events tests forScopeSubDelegatedregistry/re-emission, protocol roundtrips.
Implementation phases:
- Add
PodEvent::should_notify_agent()classification inprotocol: true forTurnEnded,Errored,ShutDown; false forScopeSubDelegated. - Gate idle-path notification/auto-kick in
controller.rs: always apply side effects; only push notify and scheduleRunForNotificationwhenshould_notify_agent()is true. - Gate running-path notification buffering the same way.
- Update comments/docs in protocol/controller/notify/event modules to distinguish control-plane side effects from agent-visible notifications.
- Add focused tests.
Critical risks:
- Never skip
apply_event_side_effectsforScopeSubDelegated. - Gate both idle and running receive paths.
- Do not change wire serialization or remove the event.
- Do not demote
ShutDown; it remains agent-visible. - Do not use rendering availability as the visibility decision.
Validation plan:
- Protocol test for
should_notify_agentclassification. - Controller test: idle
ScopeSubDelegatedupdates side effects as needed but creates noSystemItem::PodEvent, no auto-started LLM request, and parent remains idle. - Keep/verify existing positive
TurnEndedauto-kick test. - Existing
pod_events_testshould still pass for registry/re-emission. - Run
cargo test -p protocol pod_event,cargo test -p pod --test pod_events, focused controller pod-event tests, andcargo fmt --check.