Remove Epiphany helpers from Codex core

This commit is contained in:
Meta Vens 2026-07-12 01:51:44 +01:00
commit 00a09e251f
9 changed files with 34 additions and 20 deletions

View file

@ -27,6 +27,7 @@ use super::epiphany_thread_host::EpiphanyCodexThreadHost;
use super::epiphany_thread_host::client_visible_live_thread_epiphany_state;
use super::epiphany_thread_host::epiphany_token_usage_snapshot;
use super::epiphany_thread_host::load_authoritative_epiphany_state;
use super::epiphany_thread_host::runtime_spine_store_path;
use crate::outgoing_message::ThreadScopedOutgoingMessageSender;
use crate::thread_state::ThreadState;
@ -54,7 +55,7 @@ pub(crate) async fn maybe_run_epiphany_coordinator_automation_for_turn_boundary(
.await;
let token_usage_info = thread.token_usage_info().await;
let token_usage_snapshot = epiphany_token_usage_snapshot(token_usage_info.as_ref());
let runtime_store_path = thread.epiphany_runtime_spine_store_path().await;
let runtime_store_path = runtime_spine_store_path(&thread).await;
let verdict = select_epiphany_coordinator_automation(EpiphanyCoordinatorAutomationInput {
thread_id: &thread_id_text,

View file

@ -3,6 +3,7 @@ use codex_core::CodexThread;
use codex_protocol::ThreadId;
use codex_protocol::protocol::EpiphanyRetrievalState;
use super::epiphany_thread_host::load_authoritative_epiphany_state;
use super::epiphany_thread_host::runtime_spine_store_path;
use epiphany_codex_bridge::cultnet::EpiphanySurfaceSource;
use epiphany_codex_bridge::invalidation::epiphany_freshness_watcher_snapshot;
use epiphany_codex_bridge::launch::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
@ -126,7 +127,7 @@ impl CodexMessageProcessor {
};
let runtime_store_path = if core_epiphany_view_needs_runtime_store(&lenses) {
if let Some(loaded_thread) = loaded_thread.as_ref() {
Some(loaded_thread.epiphany_runtime_spine_store_path().await)
Some(runtime_spine_store_path(loaded_thread).await)
} else {
None
}
@ -206,7 +207,7 @@ impl CodexMessageProcessor {
}
let runtime_store_path = if let Some(loaded_thread) = loaded_thread.as_ref() {
Some(loaded_thread.epiphany_runtime_spine_store_path().await)
Some(runtime_spine_store_path(loaded_thread).await)
} else {
None
};
@ -398,7 +399,7 @@ impl CodexMessageProcessor {
EpiphanySurfaceSource::Stored
};
let runtime_store_path = if let Some(loaded_thread) = loaded_thread.as_ref() {
Some(loaded_thread.epiphany_runtime_spine_store_path().await)
Some(runtime_spine_store_path(loaded_thread).await)
} else {
None
};

View file

@ -28,7 +28,7 @@ impl EpiphanyMutationHost for EpiphanyCodexThreadHost<'_> {
}
async fn epiphany_state(&self) -> Option<EpiphanyThreadState> {
let store = self.thread.epiphany_runtime_spine_store_path().await;
let store = runtime_spine_store_path(self.thread).await;
match load_authoritative_accepted_state(&store) {
Ok(Some(state)) => Some(state),
Ok(None) => load_legacy_rollout_state(self.thread).await,
@ -40,11 +40,11 @@ impl EpiphanyMutationHost for EpiphanyCodexThreadHost<'_> {
}
async fn epiphany_reference_turn_id(&self) -> Option<String> {
self.thread.epiphany_reference_turn_id().await
self.thread.reference_turn_id().await
}
async fn epiphany_runtime_spine_store_path(&self) -> std::path::PathBuf {
self.thread.epiphany_runtime_spine_store_path().await
runtime_spine_store_path(self.thread).await
}
async fn client_visible_epiphany_state(
@ -95,7 +95,7 @@ pub(super) async fn live_thread_epiphany_state(
pub(super) async fn load_authoritative_epiphany_state(
thread: &CodexThread,
) -> Option<EpiphanyThreadState> {
let store = thread.epiphany_runtime_spine_store_path().await;
let store = runtime_spine_store_path(thread).await;
match load_authoritative_accepted_state(&store) {
Ok(Some(state)) => Some(state),
Ok(None) => load_legacy_rollout_state(thread).await,
@ -106,6 +106,16 @@ pub(super) async fn load_authoritative_epiphany_state(
}
}
pub(super) async fn runtime_spine_store_path(thread: &CodexThread) -> std::path::PathBuf {
thread
.config_snapshot()
.await
.cwd
.join("state")
.join("runtime-spine.msgpack")
.to_path_buf()
}
async fn load_legacy_rollout_state(thread: &CodexThread) -> Option<EpiphanyThreadState> {
let rollout_path = thread.rollout_path()?;
match load_epiphany_state_from_rollout_path(&rollout_path).await {