Skip to content

Commit fa73295

Browse files
authored
add better logging for replay skipping (#11069)
## Description <!-- Please remember to add your design buddy onto the PR for review, if it contains any UI changes! --> We've run into a few issues around this code (or at least surfaced by it), and it would be helpful to have better logging when these issues come up. ## Testing <!-- How did you test this change? What automated tests did you add? If you didn't add any new tests, what's your justification for not adding any? Manual testing is required for changes that can be manually tested, and almost all changes can be manually tested. If your change can be manually tested, please include screenshots or a screen recording that show it working end to end. You can run the app locally using `./script/run` - see WARP.md for more details on how to get set up. --> - [x] I have manually tested my changes locally with `./script/run` ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
1 parent 6b1e57e commit fa73295

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

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

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,26 +247,42 @@ impl BlocklistAIController {
247247
ctx: &mut ModelContext<Self>,
248248
) -> bool {
249249
let Some(conversation_id) = existing_conversation_id else {
250+
log::info!(
251+
"should_skip_replayed_response: no existing conversation id, not skipping \
252+
(request_id={init_request_id})"
253+
);
250254
return false;
251255
};
252-
if !self
256+
let is_receiving_replay = self
253257
.terminal_model
254258
.lock()
255-
.is_receiving_agent_conversation_replay()
256-
|| !self
257-
.shared_session_state
258-
.should_suppress_replayed_response_for_existing_conversation
259-
{
259+
.is_receiving_agent_conversation_replay();
260+
let suppress_enabled = self
261+
.shared_session_state
262+
.should_suppress_replayed_response_for_existing_conversation;
263+
if !is_receiving_replay || !suppress_enabled {
264+
log::info!(
265+
"should_skip_replayed_response: not skipping \
266+
(request_id={init_request_id}, conversation_id={conversation_id:?}, \
267+
is_receiving_replay={is_receiving_replay}, suppress_enabled={suppress_enabled})"
268+
);
260269
return false;
261270
}
262271

263272
// Only skip the replayed response when our local task already has the given request_id.
264273
// New exchanges (e.g. the user's first post-handoff prompt) carry unseen request_ids and must flow through normally.
265274
let history = BlocklistAIHistoryModel::as_ref(ctx);
266-
history.conversation(&conversation_id).is_some_and(|conv| {
275+
let found = history.conversation(&conversation_id).is_some_and(|conv| {
267276
conv.all_tasks()
268277
.any(|task| task.messages().any(|msg| msg.request_id == init_request_id))
269-
})
278+
});
279+
if !found {
280+
log::info!(
281+
"should_skip_replayed_response: not skipping, request_id not found in local \
282+
conversation (request_id={init_request_id}, conversation_id={conversation_id:?})"
283+
);
284+
}
285+
found
270286
}
271287

272288
fn on_shared_client_actions(

0 commit comments

Comments
 (0)