Qiao-yq opened a new pull request, #1611: URL: https://github.com/apache/dubbo-admin/pull/1611
**Please provide a description of this PR:** Draft. This PR is blocked by and must be merged after [#1610](https://github.com/apache/dubbo-admin/pull/1610) (Context Compiler / Core MVP PR 1) and its prerequisites. Merge order: #1596 → #1608 → #1609 → #1610 → this PR. Complete the Phase 1 prerequisites and G1 acceptance before merging this production integration. After the prerequisite PRs merge, update this branch against `ai` and rerun validation before merging. Implement **Core MVP PR 2: structured conversation summaries and long-conversation recovery** for #1539. When older Turns leave the bounded context window, preserve early goals, evidence, unresolved work, and corrections in a structured rolling summary. Advance it before the first main model call with bounded auxiliary work, then let the Compiler select it within the final request budget. - add a separate SummaryStore with Memory/GORM implementations, stable terminal-history snapshots and keyset cursors covering completed, failed, and released attempts - atomically commit summary content, complete-Turn coverage, partial checkpoints, version CAS, quota reservations, and derived-artifact registration; fence commits by active Turn/lease and Session lifecycle - pack a short Turn's user input, tool batches, and answer into one summary call while retaining independent citations; use resumable Record/Offset fragments only when the Turn exceeds the byte budget - inspect a record before emitting evidence and reuse server-owned inspection metadata bound to its immutable identity/tool version and detector version; preserve cross-fragment secret detection without rescanning the full record on every fragment or commit - generate six validated summary categories through a separate tool-free Compiler/SDK path, with bounded normal/recovery calls and a total timeout; reject unknown citations, sensitive output, and unsupported factual authority - inject summaries as untrusted evidence; suppress covered history and recovery details only when the summary is finally selected, and reselect bounded history/recovery when it does not fit or fails final version revalidation; always retain the mandatory no-automatic-replay notice - record summary calls as distinct auxiliary Usage events, add an independent default-off configuration switch, and register privileged derived-summary cleanup - reserve and propagate server-owned Memory dependency metadata for PR 3; index Memory terminal registration at completion/release instead of repeatedly backfilling history on snapshot reads Compatibility: summary generation and injection are disabled by default and skipped in Compiler `minimal` mode. GORM migration adds the terminal journal, summaries, role/dependency metadata, and per-record inspection metadata. Completed legacy Turns are backfilled in completed-at/id order; released legacy tool records receive stable trailing positions because their original terminal order and deleted messages cannot be reconstructed. Canonical history remains retained under existing storage quotas. Memory state is process-local; GORM preserves summaries, fragment checkpoints, and inspection results across restart. Cross-session Memory CRUD/recall, Memory invalidation resolution, multiple-Turn packing, UI controls, and a background summary queue remain outside this PR. This does not complete #1539 or declare full G2/G3 acceptance. The three local planning documents are not included. While the dependencies are open, GitHub's comparison against `ai` includes their changes. Review this PR's four functional commits on top of #1610 [here](https://github.com/Qiao-yq/dubbo-admin/compare/2a51ff9...feat/ai-1539-conversation-summary). Validation from `ai/`: - `go test -count=1 ./...` — passed - `go test -race ./store/... ./component/context ./component/memory/... ./component/agent/react ./component/hooks` — affected packages passed; the corrected cross-boundary fixture and final ReAct regression were subsequently rechecked with `go test -race ./store ./component/agent/react` - `git diff --check origin/feat/ai-1539-context-compiler-core...HEAD` — passed Shared backend contracts cover packed short Turns completing in one call, independent provenance, fragment recovery, CAS, ownership, deletion races, cleanup, invalid commits, and failure recovery. Compiler tests cover covered recovery deduplication, mandatory notices, and token/byte fallback. HTTP provider fixtures inspect actual summary injection, absence of duplicate original history, tool-free auxiliary requests, output limits, Usage, and zero calls on mandatory overflow. GORM tests cover restart, inspection-rule invalidation, quota accounting, and injected artifact-write rollback. A 1 MiB plain-text fixture required 391 payload reads including restart and every fragment's commit revalidation, rather than repeated full-record scans. Provider tests use a local HTTP fixture and GORM tests use SQLite. Real-model summary quality and production MySQL/PostgreSQL migration/concurrency acceptance remain unverified. Part of #1539. Blocked by #1610 and its prerequisite PRs; do not merge before them. **To help us figure out who should review this PR, please put an X in all the areas that this PR affects.** - [x] Docs - [x] Installation - [ ] User Experience - [ ] Dubboctl - [ ] Console - [x] Core Component **Please check any characteristics that apply to this pull request.** - [x] Includes tests - [x] Changes security-sensitive behavior - [x] Adds database tables and migration - [x] Adds default-off Agent configuration -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
