fix(acp): de-duplicate post-cancel orphan-update warnings#457
Merged
Conversation
After a cancel, in-flight session/update events still arrive at the reducer with no active request, producing one yellow warning per event. Track an orphan_update_warning_emitted flag on SessionRuntime so the "Received request-owned content update while no request is active" warning fires once per burst; the normalizer still produces tool/message events so well-formed updates render in history. The flag resets when a new prompt or load begins, so a future request can warn again. 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
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
🤖 Generated with Nori
session/updateevents still hit the reducer with no active request and currently produce one "Received request-owned content update while no request is active" yellow warning cell per event — flooding the history.orphan_update_warning_emittedflag onSessionRuntime. The warning fires only on the first orphan update in a burst; subsequent orphans in the same idle window skip the warning. The normalizer still runs on every update, so well-formedsession/updateevents continue to render as tool / message history cells.start_prompt,reduce_load_submit), so a fresh burst on a future request will warn again.Test Plan
cargo test -p nori-acp(494 tests pass)nori-rs/acp/src/backend/session_reducer/tests.rs:orphan_warning_is_emitted_only_once_per_burst— three orphanToolCallUpdates produce exactly one warning and threeToolSnapshots.orphan_warning_resets_when_a_new_prompt_starts— burst → new prompt → new burst produces two warnings total.test_out_of_phase_tool_call_update_still_emits_normalized_tool_snapshotstill passes (single update still gets the warning + snapshot).just fmtandjust fix -p nori-acp -p nori-protocolclean.Share Nori with your team: https://www.npmjs.com/package/nori-skillsets