fix(core): bound trace_extraction shutdown await and preserve DbError type#4504
Merged
Conversation
0f68b40 to
2da7b26
Compare
… type Add a 2-minute timeout around `trace_extraction_handle.await` in agent shutdown so a slow or hung LLM call inside the trace extraction task cannot stall agent exit indefinitely. Timeout and task panic are now logged with separate `tracing::warn!` messages. Change `AgentError::Db(String)` to `Db(#[from] zeph_db::DbError)` so the full `DbError` structure is preserved across the error boundary instead of being collapsed to a string. Callers in `shadow_sentinel.rs` updated to use `.into()` for the two-step `sqlx::Error → DbError → AgentError` conversion. Closes #4500, closes #4496
2da7b26 to
1d9792f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
trace_extraction_handle.awaitintokio::time::timeout(2 min)at shutdown so a slow or hung LLM call inside the trace extraction task cannot stall agent exit. Timeout and task panic are logged with separatetracing::warn!messages (fix(core): trace_extraction_handle.await at shutdown has no outer timeout — can stall agent exit #4500).AgentError::Db(String)toDb(#[from] zeph_db::DbError)— preserves the fullDbErrorstructure instead of collapsing it to a string; callers inshadow_sentinel.rsupdated to use.into()(AgentError::Db(String) erases DbError — prevents structured error handling downstream #4496).Changed files
crates/zeph-core/src/agent/mod.rs— timeout block in shutdowncrates/zeph-core/src/agent/error.rs—AgentError::Dbvariantcrates/zeph-core/src/agent/shadow_sentinel.rs— 3 call sitesTest plan
cargo nextest run -p zeph-core— 1496/1496 passedcargo build --workspace— clean, no warningscargo clippy --workspace -- -D warnings— cleanRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler— cleanCloses #4500, closes #4496