Skip to content

Commit 9c46577

Browse files
cephalonautoz-agent
andcommitted
Address review feedback: dead code, comments, tracker field docs
#2: Remove empty if-block for is_existing_child_placeholder in controller.rs #3: Remove dead selected_conversation_id/root_identity bindings in shared_session.rs #4: Simplify ensure_remote_child_conversation comment to focus on idempotence #10/#11: Update tracker field comments to use Primary/Observer terminology and explain when None Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 5d3ab00 commit 9c46577

4 files changed

Lines changed: 11 additions & 28 deletions

File tree

app/src/ai/blocklist/agent_view/controller.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,6 @@ impl AgentViewController {
857857
let is_new = exchange_count == 0
858858
&& !(FeatureFlag::OrchestrationUnifiedStack.is_enabled()
859859
&& is_existing_child_placeholder);
860-
if is_existing_child_placeholder {
861-
}
862860
ctx.emit(AgentViewControllerEvent::EnteredAgentView {
863861
conversation_id,
864862
is_new,

app/src/ai/blocklist/controller/shared_session.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,6 @@ impl BlocklistAIController {
165165
h.start_new_conversation(terminal_surface_id, false, true, false, ctx)
166166
})
167167
});
168-
let selected_conversation_id = self.context_model.as_ref(ctx).selected_conversation_id(ctx);
169-
let root_identity =
170-
history
171-
.as_ref(ctx)
172-
.conversation(&conversation_id)
173-
.map(|conversation| {
174-
(
175-
conversation.get_root_task_id().clone(),
176-
conversation
177-
.get_root_task()
178-
.is_some_and(|task| task.source().is_some()),
179-
)
180-
});
181168
if self.should_skip_replayed_response_for_existing_conversation(
182169
existing_conversation_id,
183170
&init_event.request_id,

app/src/ai/blocklist/history_model.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,10 @@ impl BlocklistAIHistoryModel {
568568
conversation_id
569569
}
570570

571-
/// Returns the single durable conversation mapping for a remotely hosted
572-
/// child, creating it from fetched task metadata when necessary.
573-
///
574-
/// Both Primary and Observer discovery call this method, so racing
575-
/// `ChildStarted`, lifecycle, and viewer metadata callbacks converge on
576-
/// the same run-id index entry.
571+
/// Returns the existing run-id mapping for a remote child, creating one
572+
/// from the supplied task metadata if none exists yet. Idempotent: racing
573+
/// `ChildStarted`, lifecycle, and viewer metadata callbacks all converge
574+
/// on the same entry.
577575
#[allow(clippy::too_many_arguments)]
578576
pub fn ensure_remote_child_conversation(
579577
&mut self,

app/src/ai/blocklist/orchestration_event_streamer.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,10 @@ struct ConversationStreamState {
222222
/// Consecutive `get_ambient_agent_task` failure count for the
223223
/// post-restore retry loop; resets on success.
224224
restore_fetch_failures: usize,
225-
/// Owner-mode child tracker for this orchestrator family. Created lazily
226-
/// by the flag-on family drain (`OrchestrationUnifiedStack`); `None` on
227-
/// the flag-off baseline, where the legacy `drain_sse_events` path runs.
225+
/// Primary-mode child tracker for this orchestrator family. `None` until
226+
/// the first flag-on family drain fires and the tracker is constructed;
227+
/// on the flag-off baseline the legacy `drain_sse_events` path runs
228+
/// without a tracker.
228229
tracker: Option<OrchestrationChildTracker>,
229230
}
230231

@@ -265,10 +266,9 @@ struct OrchestratorStreamState {
265266
/// cursor, so a replay does not generate spurious `ChildSpawned` events
266267
/// for already-known children.
267268
seeded: bool,
268-
/// Viewer-mode child tracker for this orchestrator family. Created lazily
269-
/// by the flag-on family drain (`OrchestrationUnifiedStack`); `None` on
270-
/// the flag-off baseline, where the legacy `drain_ancestor_events` path
271-
/// runs.
269+
/// Observer-mode child tracker for this orchestrator family. `None` until
270+
/// the first flag-on viewer drain fires; on the flag-off baseline the
271+
/// legacy `drain_ancestor_events` path runs without a tracker.
272272
tracker: Option<OrchestrationChildTracker>,
273273
}
274274

0 commit comments

Comments
 (0)