fix(memory): attempt plain-text fallback when session summary times out (#1869)#1887
Merged
fix(memory): attempt plain-text fallback when session summary times out (#1869)#1887
Conversation
…l times out When `call_llm_for_session_summary()` times out waiting for the structured JSON output call, fall through to the plain-text `chat()` fallback instead of returning `None` and silently dropping the session summary. Extract `plain_text_summary_fallback()` helper to share the fallback path between the error arm (`Ok(Err(e))`) and the new timeout arm (`Err(_)`). Add `shutdown_summary_timeout_secs` (default: 10) to `MemoryConfig` to replace the hardcoded 5s limit. Wire it through `MemoryState`, `AgentBuilder::with_shutdown_summary_config()`, and `runner.rs`. Closes #1869
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
call_llm_for_session_summary()times out waiting for the structured JSON output call, fall through to the plain-textchat()fallback instead of returningNoneand silently dropping the session summary.plain_text_summary_fallback()helper to share fallback logic between theOk(Err(e))(error) andErr(_)(timeout) arms.shutdown_summary_timeout_secs(default: 10) to[memory]config, replacing the hardcoded 5s limit.Root Cause
The plain-text fallback was only reached on
Ok(Err(e)), not on timeout.Changes
crates/zeph-core/src/agent/mod.rs: timeout arm now callsplain_text_summary_fallback(); helper extracted from duplicatedOk(Err(e))pathcrates/zeph-core/src/config/types/memory.rs:shutdown_summary_timeout_secs: u64(default: 10)crates/zeph-core/src/agent/builder.rs,context/mod.rs,src/runner.rs: wired throughcrates/zeph-core/src/agent/tests.rs: all call sites updated, 3 new assertionsTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— cleancargo nextest run --workspace --features full --lib --bins— 5971 passed, 12 skippedCloses #1869