Skip to content

Fix frontend chat recovery version reconciliation - #3067

Merged
AbigailDeng merged 5 commits into
devfrom
fix/2026-07-30_chat-history-recovery-version-domain
Aug 4, 2026
Merged

Fix frontend chat recovery version reconciliation#3067
AbigailDeng merged 5 commits into
devfrom
fix/2026-07-30_chat-history-recovery-version-domain

Conversation

@AbigailDeng

@AbigailDeng AbigailDeng commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

The Chat page treated create-recovery and create-context stateVersion values as authoritative Conversation watermarks. If either value came from another backend version domain and was ahead of the Conversation detail read model, reconciliation stayed pending and showed History save was not confirmed even after the exact assistant turn was visible.

Frontend solution

  • Bind recovered create identity without adopting the recovery response version.
  • For create streams, use aevatar.chat.context only for conversationId and turnId; do not adopt its version as a Conversation watermark.
  • Continue trusting context watermarks for existing-conversation continuations.
  • Adopt a positive Conversation watermark only after Conversation detail exposes the exact assistant turnId.
  • Cover distinct recovery/context and Conversation versions in Chat page tests.

CI determinism follow-up

After the updated branch exposed date-sensitive recovery tests, inject TimeProvider into the development/test InMemorySecretVault and give the recovery fixtures the same deterministic clock as the agent. The default vault still uses TimeProvider.System; this does not change the production Chat backend contract or make the separate backend contract fix in #3070 necessary.

Scope

The user-facing fix is frontend-only and is independently effective against the existing backend contract. The PR also contains the isolated clock-injection follow-up in InMemorySecretVault and its affected tests so the required repository coverage job is deterministic.

Validation

  • Focused Chat reconciliation tests (4/4)
  • pnpm --dir apps/aevatar-console-web tsc
  • pnpm --dir apps/aevatar-console-web exec biome lint src/pages/chat/index.tsx src/pages/chat/index.test.tsx
  • dotnet test test/Aevatar.Foundation.Abstractions.Tests/Aevatar.Foundation.Abstractions.Tests.csproj --nologo --filter 'FullyQualifiedName~CredentialSecretVaultContractTests' (4/4)
  • dotnet test test/Aevatar.AI.Tests/Aevatar.AI.Tests.csproj --nologo --filter 'FullyQualifiedName~RoleGAgentRecoveryCheckpointTests' (25/25)
  • bash tools/ci/test_stability_guards.sh
  • bash tools/ci/frontend_static_boundary_guard.sh
  • git diff --check origin/dev...HEAD

@AbigailDeng
AbigailDeng force-pushed the fix/2026-07-30_chat-history-recovery-version-domain branch from 308dd2e to 38a698c Compare July 30, 2026 09:03
@AbigailDeng AbigailDeng changed the title Fix chat history recovery version domains Fix frontend chat recovery version reconciliation Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.56%. Comparing base (4ecb75c) to head (93f635a).
⚠️ Report is 1 commits behind head on dev.

@@            Coverage Diff             @@
##              dev    #3067      +/-   ##
==========================================
+ Coverage   84.55%   84.56%   +0.01%     
==========================================
  Files        1503     1503              
  Lines      140007   140015       +8     
  Branches    17180    17180              
==========================================
+ Hits       118376   118401      +25     
+ Misses      13765    13749      -16     
+ Partials     7866     7865       -1     
Flag Coverage Δ
ci 84.56% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...actions/Credentials/Testing/InMemorySecretVault.cs 91.66% <100.00%> (+0.59%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AbigailDeng
AbigailDeng enabled auto-merge (squash) August 4, 2026 03:47
@AbigailDeng
AbigailDeng merged commit 3f548ff into dev Aug 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant