Skip to content

Commit 6ff938b

Browse files
agent_trace_db: Wire best-effort pull-on-setup when sync mode is active
AgentTraceDbLifecycle::setup now captures the AgentTraceDb::new() result and performs an initial pull() when sync mode is active (both SCE_SYNC_URL and SCE_SYNC_TOKEN set). The pull is best-effort — remote failure is logged via tracing::warn! and setup continues without error. Co-authored-by: SCE <sce@crocoder.dev>
1 parent 3cc34f0 commit 6ff938b

7 files changed

Lines changed: 54 additions & 18 deletions

File tree

cli/src/services/agent_trace_db/lifecycle.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ impl ServiceLifecycle for AgentTraceDbLifecycle {
5151
}
5252

5353
fn setup(&self, _ctx: &AppContext) -> Result<SetupOutcome> {
54-
AgentTraceDb::new()
54+
let db = AgentTraceDb::new()
5555
.context("Agent trace DB lifecycle setup failed while initializing agent trace DB")?;
56+
57+
if db.is_sync_mode() {
58+
if let Err(e) = db.pull() {
59+
tracing::warn!("Agent trace DB initial sync pull failed (setup continues): {e}");
60+
}
61+
}
62+
5663
Ok(SetupOutcome::default())
5764
}
5865
}

context/architecture.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/context-map.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/glossary.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/overview.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)