Repository navigation
Conversation
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
Reviewed PR #8409 (feat(ai): unify AI protocol detection and support ai-prompt for openai-response) at head ee0416a. The change extracts protocol detection into a new shenyu-plugin-ai-protocol module (AiProtocolDescriptor, AiProtocolDetector, AiProtocols, plus OpenAI chat/responses descriptors), replaces the removed AiProxyProtocol.detect/bodyMatches and AiProxyProtocolFactory.protocolFor/detect APIs with the shared detector, wires ai-common/ai-proxy/ai-pii/ai-prompt to depend on ai-protocol, updates AiRequestViewParser/AiRequestViewOperations to use the shared detector, extends ai-prompt/AiPromptPlugin to handle OpenAI responses, and adds module READMEs. Full VERSIONED_DIFF coverage was achieved (all pages read, has_more=false).
Evidence
- Full VERSIONED_DIFF consumed: resource_diff for head fa8d1d6d-f660-4a7c-b00c-fae8a8467876 vs base f2e49051-17e0-44af-a287-08f3badd4c60, all pages read (total 128255 chars, next_unread_offset reached end, has_more=false).
- CI not passing: coverage metadata complete=true, passed=false; 6 checks queued (policy, agent_gateway_migrations, registry_dependencies, build_local_repo, check-license-header, rat_check).
- No stale API / no circular dep: ai-protocol pom depends only on shenyu-plugin-base; ai-proxy pom adds shenyu-plugin-ai-protocol; searches for .detect(, .bodyMatches(, .protocolFor( show no leftover callers of the removed API outside the new AiProtocolDescriptor.
Recommended next steps
- Wait for/trigger the queued CI checks (build_local_repo, check-license-header, rat_check) so the new module compiles and license headers are validated.
- Re-run a full module build (mvn -pl shenyu-plugin/shenyu-plugin-ai -am verify) to validate cross-module wiring after removing AiProxyProtocol.detect/bodyMatches.
- Confirm AiProtocolDetector descriptor discovery (static registry vs ServiceLoader) covers all enabled protocols in production configuration.
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: 5295587b-9b90-49d1-a83d-4f703045815d · Commit: ee0416a167755109f801ed50b9c45b0e7b7f79df
Review verdict: INCONCLUSIVE
Full diff coverage was achieved, and no concrete HIGH/CRITICAL defect was found: Maven wiring is cycle-free (ai-protocol depends only on shenyu-plugin-base; ai-common/ai-proxy/ai-pii/ai-prompt depend on ai-protocol), the new module is registered in the ai parent pom, and no remaining callers of the removed AiProxyProtocol.detect/bodyMatches or AiProxyProtocolFactory.protocolFor/detect APIs exist. However, the mandatory PASS precondition 'passing CI' is not satisfied: CI metadata is complete but passed=false with 6 checks still queued, including build_local_repo (actual module compilation of the new pom wiring and removed-API refactor) and check-license-header/rat_check. Because those build/license verifications have not executed, build safety cannot be confirmed, so the verdict is INCONCLUSIVE.
Publication: COMMENT (INCONCLUSIVE_REVIEW)
Review details
I reviewed the complete diff for #8409. The refactor is internally consistent: the new ai-protocol module depends only on shenyu-plugin-base (no circular dependency), it is registered in the ai parent pom, and there are no remaining callers of the removed AiProxyProtocol.detect/bodyMatches or AiProxyProtocolFactory.protocolFor/detect APIs. Tests were added/updated for the new detection path. However, I cannot mark this PASS because CI has not passed: 6 checks (including build_local_repo and the license/rat checks) are still queued, so the actual compilation of the new module wiring and the license-header compliance are unverified. Verdict: INCONCLUSIVE until those checks run green.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8409 +/- ##
=============================================
+ Coverage 61.49% 72.93% +11.43%
- Complexity 8818 19395 +10577
=============================================
Files 1261 1818 +557
Lines 39273 71294 +32021
Branches 3725 8531 +4806
=============================================
+ Hits 24151 51998 +27847
- Misses 12952 14940 +1988
- Partials 2170 4356 +2186
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ee0416a to
4d47d77
Compare
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
Unify AI protocol detection via new shenyu-plugin-ai-protocol module and add ai-prompt support for openai-responses requests.
Evidence
- Complete versioned diff read (has_more=false): 129,523 chars across 39 files incl. new shenyu-plugin-ai-protocol module and ai-proxy/ai-pii/ai-prompt/ai-common changes plus tests.
- CI green: 92 checks completed, all success (build, CodeQL, e2e incl. cluster-jdbc/websocket/grpc/http-sync); no failed checks reported.
- Verified cross-module contract: AiProtocolDetector (path->header->body, UNKNOWN on tier ambiguity, cached on exchange via Constants.AI_PROTOCOL) is consumed by ai-proxy (fail on unresolved), ai-pii (profile by detected id) and ai-prompt (responses injection); removed AiProxyProtocolFactory.getProtocol and per-protocol id fields are replaced by the detector registry with no dangling references (build success).
Recommended next steps
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: 4562e7ca-3802-42fd-a200-1dc8e9a44a31 · Commit: 4d47d771882e41d53e0803e6a4c76d86d10c4141
Review verdict: PASS
Full diff coverage achieved, CI passing with no failed checks, and no concrete HIGH/CRITICAL defect identified. The new detection module is cohesive and consistently wired across ai-proxy/ai-pii/ai-prompt; the removed resolution method and per-protocol id fields are superseded by the detector registry, and the remaining AiProxyProtocolFactory usage is consistent (compile/tests pass).
Publication: APPROVE (EXPLICIT_PASS)
4d47d77 to
2f2d0e4
Compare
2f2d0e4 to
ea147cc
Compare
Fixes #8371
Adds shenyu-plugin-ai-protocol, a small module (depends only on plugin-base) with the protocol id constants and a single detector: path → header → body, unknown when a tier is ambiguous, result cached on the exchange. ai-proxy resolves a blank protocol with it — an unresolved request fails instead of being guessed by bean order. ai-pii picks the request-side profile by the detected id, keeping its shape validation. ai-prompt now injects into openai-responses requests instead of silently skipping them; chat behavior is unchanged.
Defaults don't change: protocol still defaults to openai-chat, detection only runs when it's explicitly blank. One visible edge: /v1/responses with a chat-shaped body now fails pii's shape validation instead of being treated as chat (path wins over body). Details in the new module's README and the updated plugin READMEs.
Problem and change
IssueSpec
IssueSpec-Mode: full IssueSpec-Reason: New shared AI protocol detection module consumed by ai-proxy/ai-pii/ai-prompt. IssueSpec-Proposal: #NNN IssueSpec-Design: #NNN IssueSpec-Implement: #NNN IssueSpec-Specs: SPEC-NNNNNNN IssueSpec-Tasks: TASK-NNNNNNN IssueSpec-Validation: ./mvnw -pl shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-protocol -am test and the ai-prompt/ai-pii/ai-proxy equivalents, all passed. Integrated/e2e not run.
Make sure that:
./mvnw clean install -Dmaven.javadoc.skip=true.