From 086b803120802f89d63145d27354fff2ebe575e0 Mon Sep 17 00:00:00 2001 From: Joe Florencio Date: Fri, 12 Jun 2026 16:54:49 -0700 Subject: [PATCH] Document cloud config loader snapshots --- codex-rs/config/src/cloud_config_bundle.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/codex-rs/config/src/cloud_config_bundle.rs b/codex-rs/config/src/cloud_config_bundle.rs index 5b15b9c108..0be0224290 100644 --- a/codex-rs/config/src/cloud_config_bundle.rs +++ b/codex-rs/config/src/cloud_config_bundle.rs @@ -207,7 +207,15 @@ impl CloudConfigBundleLoader { ) } + /// Returns the bundle result currently published by this loader. + /// + /// A pending loader waits for its initial result. Once a result is ready, + /// this returns that snapshot immediately; later refreshes are observed by + /// future calls. If the publisher is dropped before the initial result, + /// this returns an internal lifecycle error. pub async fn get(&self) -> Result, CloudConfigBundleLoadError> { + // Each call uses its own watch cursor so concurrent callers can wait + // for the initial publication independently. let mut state = self.state.clone(); loop { let result = match &*state.borrow_and_update() {