Feat/添加流处理器验证和优化CQRS调度程序管道#351
Conversation
- 更新 cqrs-rewrite tracking 到 PR #350 已合并且 branch diff 归零的当前真值 - 补充 batch boot 恢复结论与下一轮 CQRS 工作应从新分支继续的建议
- 更新 cqrs-rewrite tracking 为 recovery 刷新提交后的 branch diff 与 ahead 状态 - 补充 trace 对应的最终停点,避免 ai-plan 与真实分支指标不一致
- 更新 cqrs-rewrite tracking 为不会被后续收尾提交再次改坏的稳定事实 - 补充 trace 的自然停点说明,避免继续保留已完成提交的待办语义
- 修正 request pipeline 末端继续复用缓存 RequestInvoker 的运行时语义 - 补充 generated request invoker 与 stream 缺失 handler 的回归测试覆盖 - 更新 benchmark reader-facing 注释与 cqrs-rewrite 恢复入口记录
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (4)ai-plan/public/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
ai-plan/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
ai-plan/public/**/todos/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
ai-plan/public/**/traces/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
🪛 LanguageToolai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md[uncategorized] ~67-~67: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:一致"地"调用 (wb4) [uncategorized] ~78-~78: 您的意思是“"不"入”? (BU) 🔇 Additional comments (2)
📝 WalkthroughWalkthroughCqrsDispatcher 的请求管道已重构为在管道执行期间传递缓存的 RequestInvoker;新增测试覆盖流 handler 缺失的同步错误和生成请求调用程序在请求管道中仍被优先使用并触发注册的管道行为;更新若干基准注释与迁移追踪文档(RP-144)。 Changes请求管道 RequestInvoker 传播和验证
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| dotnet-format | yes | 1 | no | 5.94s | ||
| ✅ REPOSITORY | gitleaks | yes | no | no | 9.03s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 7.2s |
Detailed Issues
⚠️ CSHARP / dotnet-format - 1 error
Welcome to .NET 9.0!
---------------------
SDK Version: 9.0.114
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, run 'dotnet dev-certs https --trust'
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Unhandled exception: System.Exception: Restore operation failed.
at Microsoft.CodeAnalysis.Tools.CodeFormatter.OpenMSBuildWorkspaceAsync(String solutionOrProjectPath, WorkspaceType workspaceType, Boolean noRestore, Boolean requiresSemantics, String binaryLogPath, Boolean logWorkspaceWarnings, ILogger logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.CodeFormatter.FormatWorkspaceAsync(FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken, String binaryLogPath)
at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.FormatAsync(FormatOptions formatOptions, ILogger`1 logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

Show us your support by starring ⭐ the repository
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #1113
🎉 All tests passed!Slowest Tests
± Comparison with run #1112 at 8ca8a09 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 55 runs. Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md`:
- Around line 44-47: Update the PR anchor text in the migration-tracking doc so
the "当前 PR" and any mention of the "当前 PR 锚点" reference PR `#351` instead of PR
`#350`: locate the block containing the lines "- 当前 PR:`PR `#350`(已合并到
origin/main)`" and the surrounding "当前分支:`feat/cqrs-optimization`" context in
cqrs-rewrite-migration-tracking.md, change the PR number and status to reflect
PR `#351` (opened 2026-05-14), and ensure any related recovery/anchor wording is
consistent with the new PR number.
- Around line 59-82: The document contains contradictory statements about what
the current branch diff covers (the phrase "当前 batch working-tree diff:`7` 个源码 /
测试文件" vs the section "最近权威验证" stating it only covers two `ai-plan` docs); pick
and keep one authoritative statement that matches HEAD and convert the other
into a clearly labeled historical note. Update the lines containing the tokens
"当前 batch working-tree diff:" and the "最近权威验证" block (and related bullets under
"最近已合并提交:") so they consistently report the same current-diff count and scope,
or move the non-authoritative claim under a "历史说明" subsection; ensure the
surviving authoritative wording matches the actual git checks (`git diff
--name-only origin/main...HEAD`) and the commit list shown.
In `@ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md`:
- Around line 46-56: Remove the stray extra backtick around
`$gframework-batch-boot 50` (the token `$gframework-batch-boot 50`) so it
appears as a single inline code span, and eliminate the duplicate `##
2026-05-13` heading by keeping one `## 2026-05-13` heading and moving the
subsequent content under it as subsections (e.g., use `### 阶段:PR `#350` 合并后的
recovery 入口刷新(CQRS-REWRITE-RP-142)`) to avoid repetition and markdown lint
errors in the file that contains these strings.
- Around line 8-77: The active trace for RP-143 is too verbose—reduce the body
of the "active trace" section to a concise recovery point summary: keep only the
current recovery point, key decisions, verification conclusions, and next steps;
move all execution/details (explorer conclusions, per-file accepted scope, full
validation logs) into an archive document (e.g.,
ai-plan/public/cqrs-rewrite/archive/...) and leave a short pointer in the trace;
update the trace heading(s) around "阶段:允许 subagent 后的低风险多 Agent
收口(CQRS-REWRITE-RP-143)" to reflect the slimmer summary.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 34cc7a95-ab13-4a17-8c8c-6e6226b6ec26
📒 Files selected for processing (9)
GFramework.Cqrs.Benchmarks/Messaging/NotificationFanOutBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/RequestBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/RequestLifetimeBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.csGFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.csGFramework.Cqrs/Internal/CqrsDispatcher.csai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.mdai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (C#)
- GitHub Check: Build and Test
- GitHub Check: Code Quality & Security
🧰 Additional context used
📓 Path-based instructions (7)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///)
XML documentation comments MUST use<summary>,<param>,<returns>,<exception>, and<remarks>where applicable, explaining intent, contract, and usage constraints instead of restating syntax
If a member participates in lifecycle, threading, registration, or disposal behavior, document that behavior explicitly in XML documentation
Add inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds and compatibility constraints, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Avoid obvious comments such as// increment i
Methods with non-trivial logic MUST document: The core idea, Key decisions, and Edge case handling, if any
Comments MUST NOT be trivial, redundant, or misleading. Prefer explainingwhyandwhen, not justwhat. Code should remain understandable without requiring external context. Prefer slightly more explanation over too little for framework code
Do not rely on implicit imports. Declare every requiredusingexplicitly
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments
Follow standard C# naming: Types, methods, properties, events, and constants use PascalCase; Interfaces useIprefix; Parameters and locals use camelCase; Private fields use_camelCase
Use 4 spaces for indentation. Do not use tabs
Use Allman braces
Keepusingdirectives at the top...
Files:
GFramework.Cqrs.Benchmarks/Messaging/RequestBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/RequestLifetimeBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/NotificationFanOutBenchmarks.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.csGFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.csGFramework.Cqrs/Internal/CqrsDispatcher.cs
ai-plan/public/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/public/**: Contributors MUST keep committedai-plan/public/**content safe to publish in Git history
Active tracking and trace files are recovery entrypoints, not append-only changelogs. They MUST stay concise enough forbootto locate the current recovery point quickly
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the activetodos/andtraces/entry files in the same change. Keep only the current recovery point, active facts, active risks, immediate next step, and pointers to the relevant archive files in the default boot path
When a topic is fully complete, move the entire topic directory underai-plan/public/archive/<topic>/and remove it fromai-plan/public/README.mdin the same change
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Files:
ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.mdai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md
ai-plan/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/**: Never write secrets, tokens, credentials, private keys, machine usernames, home-directory paths, hostnames, IP addresses, proprietary URLs, or other sensitive environment details into anyai-plan/**file
Never record absolute file-system paths inai-plan/**; use repository-relative paths, branch names, PR numbers, or stable document identifiers instead
Files:
ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.mdai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md
ai-plan/public/**/traces/**
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step
Files:
ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md
ai-plan/public/**/todos/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/public/**/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document underai-plan/public/<topic>/todos/in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
For any multi-step refactor, migration, or cross-module task, contributors MUST create or adopt a dedicated recovery document underai-plan/public/<topic>/todos/before making substantive code changes
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
Files:
ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md
**/Cqrs/**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
Use CQRS (Command Query Responsibility Segregation) pattern with the Cqrs naming entry point instead of the historical Mediator alias
Files:
GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.csGFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.cs
**/*.Tests/**/*.cs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.Tests/**/*.cs: Mirror the source structure in test projects whenever practical
Reuse existing architecture test infrastructure when relevant:ArchitectureTestsBase<T>,SyncTestArchitecture,AsyncTestArchitecture
Files:
GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.csGFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.cs
🧠 Learnings (2)
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Cqrs.Benchmarks/Messaging/RequestBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/RequestLifetimeBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/NotificationFanOutBenchmarks.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.csGFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.csGFramework.Cqrs/Internal/CqrsDispatcher.cs
📚 Learning: 2026-05-11T06:15:15.057Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 348
File: GFramework.Cqrs.Benchmarks/Messaging/NotificationLifetimeBenchmarks.cs:52-68
Timestamp: 2026-05-11T06:15:15.057Z
Learning: In the GeWuYou/GFramework repo, do not treat a missing [GenerateEnumExtensions] attribute as a code review issue for every enum. Skip the check for:
1) local/private benchmark enums (e.g., enums defined for benchmarks such as HandlerLifetime in GFramework.Cqrs.Benchmarks),
2) enums located in projects that do NOT reference the source-generator abstractions package (the generator won’t apply there), and
3) core framework/runtime-style code paths that AGENTS.md explicitly restricts from using generator-attribute usage.
If an enum falls into any of these cases, do not flag the missing [GenerateEnumExtensions] (it has been triaged as a generalized false positive for these scenarios).
Applied to files:
GFramework.Cqrs.Benchmarks/Messaging/RequestBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/RequestLifetimeBenchmarks.csGFramework.Cqrs.Benchmarks/Messaging/NotificationFanOutBenchmarks.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.csGFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.csGFramework.Cqrs/Internal/CqrsDispatcher.cs
🪛 LanguageTool
ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md
[grammar] ~30-~30: Ensure spelling is correct
Context: ...Tests.cs - 补一条 stream 缺失 handler 的失败语义回归,固定当前分支在调用点同步抛InvalidOperationException` - worker ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~31-~31: Ensure spelling is correct
Context: ...ests.cs补 request/generated + pipeline 对称测试后,主线程确认这不是环境噪音,而是命中了真实运行时缺口: - request 路径在接入IPipelineBehavior<,>后,会退回_ha...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.22.1)
ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md
[warning] 53-53: Multiple headings with the same content
(MD024, no-duplicate-heading)
🔇 Additional comments (14)
GFramework.Cqrs.Benchmarks/Messaging/NotificationFanOutBenchmarks.cs (1)
25-26: LGTM!GFramework.Cqrs.Benchmarks/Messaging/RequestBenchmarks.cs (1)
135-135: LGTM!GFramework.Cqrs.Benchmarks/Messaging/RequestLifetimeBenchmarks.cs (1)
204-204: LGTM!Also applies to: 251-251
GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs (1)
171-171: LGTM!GFramework.Cqrs/Internal/CqrsDispatcher.cs (6)
152-153: LGTM!
604-617: LGTM!
671-676: LGTM!
1153-1163: LGTM!
1207-1217: LGTM!
969-996: LGTM!GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.cs (1)
150-171: LGTM!GFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.cs (3)
32-32: LGTM!Also applies to: 45-45
187-209: LGTM!
638-670: LGTM!
|
| Filename | Overview |
|---|---|
| GFramework.Cqrs/Internal/CqrsDispatcher.cs | Core fix: RequestPipelineInvocation now stores object handler + RequestInvoker<TResponse> and calls through the invoker delegate at the pipeline terminal, ensuring generated request invokers are honoured when pipeline behaviors are present. |
| GFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.cs | Adds SendAsync_Should_Use_Generated_Request_Invoker_Inside_Request_Pipeline test with a properly thread-safe GeneratedRequestPipelineTrackingBehavior, and resets the new counter in both SetUp and TearDown. |
| GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherContextValidationTests.cs | Adds CreateStream_Should_Throw_When_Handler_Is_Missing to verify the dispatcher throws synchronously before yielding any stream elements when no handler is registered. |
| GFramework.Cqrs.Benchmarks/Messaging/NotificationFanOutBenchmarks.cs | Documentation-only: class summary updated to mention TaskWhenAllNotificationPublisher alongside the default sequential publisher. |
| GFramework.Cqrs.Benchmarks/Messaging/RequestBenchmarks.cs | Documentation-only: corrects 'ai-libs/Mediator' to 'NuGet Mediator' in the Mediator benchmark method summary. |
| GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs | Documentation-only: same 'ai-libs/Mediator' → 'NuGet Mediator' correction in the streaming benchmark summary. |
Sequence Diagram
sequenceDiagram
participant Caller
participant Dispatcher as CqrsDispatcher
participant Executor as CachedRequestPipelineExecutor
participant Invocation as RequestPipelineInvocation
participant Behavior as IPipelineBehavior
participant Invoker as RequestInvoker delegate
Caller->>Dispatcher: SendAsync(request)
Dispatcher->>Dispatcher: Resolve handler + behaviors + dispatchBinding
Dispatcher->>Executor: "Invoke(handler, behaviors, dispatchBinding.RequestInvoker, request, ct)"
Note over Executor: NEW: passes RequestInvoker through
Executor->>Invocation: "new(handler, requestInvoker, behaviors)"
Invocation->>Behavior: "Handle(request, next, ct)"
Behavior->>Invocation: "next(request, ct)"
Invocation->>Invoker: "_requestInvoker(_handler, request, ct)"
Note over Invoker: "Was: _handler.Handle() via vtable. Now: uses cached generated invoker delegate"
Invoker-->>Invocation: TResponse
Invocation-->>Behavior: TResponse
Behavior-->>Executor: TResponse
Executor-->>Dispatcher: "ValueTask of TResponse"
Dispatcher-->>Caller: TResponse
Reviews (2): Last reviewed commit: "docs(cqrs-rewrite): 收口PR351恢复入口" | Re-trigger Greptile
- 更新 active tracking 到 PR #351 的当前审查真值与最小恢复入口 - 修复 active tracking 中过期 PR 锚点与冲突事实 - 重构 active trace 为精简恢复摘要并保留 archive 指针 - 补充本轮 PR review、license header、diff check 与 Release build 验证结果
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #1114
🎉 All tests passed!Slowest Tests
± Comparison with run #1113 at b8fe7e2 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 56 runs. Github Test Reporter by CTRF 💚 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary by CodeRabbit
发布说明
Bug Fixes
Tests
Documentation