Align Epiphany write state projection

This commit is contained in:
Meta Vens 2026-04-25 14:51:41 +01:00
commit ed7c9160b0
7 changed files with 99 additions and 25 deletions

View file

@ -4411,6 +4411,8 @@ impl CodexMessageProcessor {
return;
}
};
let epiphany_state =
client_visible_live_thread_epiphany_state(thread.as_ref(), epiphany_state).await;
let response = ThreadEpiphanyPromoteResponse {
accepted: true,
reasons: Vec::new(),
@ -4496,6 +4498,8 @@ impl CodexMessageProcessor {
return;
}
};
let epiphany_state =
client_visible_live_thread_epiphany_state(thread.as_ref(), epiphany_state).await;
let response = ThreadEpiphanyUpdateResponse {
revision: epiphany_state.revision,
changed_fields: changed_fields.clone(),
@ -10433,6 +10437,13 @@ async fn live_thread_epiphany_state(thread: &CodexThread) -> Option<EpiphanyThre
epiphany_state
}
async fn client_visible_live_thread_epiphany_state(
thread: &CodexThread,
fallback: EpiphanyThreadState,
) -> EpiphanyThreadState {
live_thread_epiphany_state(thread).await.unwrap_or(fallback)
}
fn thread_epiphany_patch_has_state_replacements(patch: &ThreadEpiphanyUpdatePatch) -> bool {
patch.objective.is_some()
|| patch.active_subgoal_id.is_some()