Repository navigation
fix(agent-runtime): keep unreplayable search history usable - #836
Merged
Merged
Conversation
A stored search record whose blocks cannot be replayed rejected every later turn of that conversation with a terminal local context-validation error. The persistence layer itself writes such blocks: when a gateway drops ids it keeps a display-only block and the transcript renders it with an anonymous round, so pre-upgrade histories were readable and then became unusable. The message now degrades to "no replay" for that turn instead of failing it, which is what a message stored without replay already meant. A container that is not a block list stays a local validation error, and the diagnostic records the block count and phases without copying search content or credentials. Specs, the offline hosted-search E2E scenarios and the unreleased notes follow the new boundary.
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.
Problem
#825 made provider-hosted search replay validate strictly. A stored record whose
blocks cannot be normalised now fails the turn with a terminal local
context-validationerror — but the persistence layer itself writes such blocks:hostedSearchReplayBlockskeeps a block withoutblockIdwhen a gateway dropsids, and the transcript renders it with an anonymous round
(
packages/shared/src/native-web-search.ts). The record stays readable, yet everylater turn of that conversation fails, and restarting or reopening the session
does not recover it.
Fix
to "no replay" — the same state as a message stored before replay existed —
instead of failing the turn. Keeping the paired half would leave an orphan block
the adapter cannot accept.
context-validationerror, so a corrupt record is not silently accepted.
and credentials are never copied.
Tests
packages/agent-runtime/src/hosted-search-replay.test.ts: the two new cases failon the merged fix(agent-runtime): repair hosted-search continuation contracts #825 code (
LocalRequestError) and pass here. One of them builds itsfixture through the real
hostedSearchFromMessagepersistence path.scripts/e2e/hosted-search-scenarios.mjs:invalid-search-containerkeeps itsrejection assertions (0 provider requests);
invalid-search-phasenow asserts theturn continues with 1 provider request and that the unreplayable block never
reaches the provider.
Verification
pnpm test:e2e:hosted-search: 7/7 scenarios pass, including the rewritten pair.pnpm build:js, Desktop typecheck,pnpm lint, architecture check,pnpm docs:check(505 pages), agent-runtime 58 files / 917 tests.03-runtime/08-error-codes.md,03-runtime/11-provider-model-system.md), plusdocs/project/unreleased.mdandthe fix(agent-runtime): repair hosted-search continuation contracts #825 verification record.
Follow-up to #825.