Repository navigation
Conversation
[Medium impact] The change reaches the Hub-backed chart-answer streaming workflow. The production change appears sound, but the new test must satisfy the repository’s testing requirement before merging.
|
| ScriptedHubTransport transport = new ScriptedHubTransport(); | ||
| Map<String, Object> answer = answerPayload("Aspirin 81mg."); | ||
| Map<String, Object> done = new LinkedHashMap<>(answer); | ||
| done.put("answerValidation", Collections.singletonMap("status", "checked")); | ||
| transport.events = Arrays.asList( | ||
| wire("reasoning_delta", Collections.singletonMap("delta", "Checking medication list. ")), | ||
| wire("answer_delta", Collections.singletonMap("delta", "Aspirin ")), | ||
| wire("answer_delta", Collections.singletonMap("delta", "81mg.")), | ||
| wire("answer_done", answer), | ||
| wire("answer_delta", Collections.singletonMap("delta", "late delta ignored")), | ||
| wire("done", done)); |
There was a problem hiding this comment.
The new test replays hand-built events through ScriptedHubTransport. CLAUDE.md requires tests to exercise the full production path with real data and forbids simulations or mocks. By skipping HttpHubStreamTransport, this test cannot catch a mismatch between actual SSE frames and the assumed delta payload. Add coverage through the production transport and required real-data path before merging.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/src/test/java/org/openmrs/module/chartsearchai/api/provider/HubClinicalAnswerProviderTest.java
Line: 383-393
Comment:
**Test skips the real transport**
The new test replays hand-built events through `ScriptedHubTransport`. `CLAUDE.md` requires tests to exercise the full production path with real data and forbids simulations or mocks. By skipping `HttpHubStreamTransport`, this test cannot catch a mismatch between actual SSE frames and the assumed `delta` payload. Add coverage through the production transport and required real-data path before merging.
**Context Used:** CLAUDE.md ([source](https://github.com/openmrs/openmrs-module-chartsearchai/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
8431be9 to
3d9940e
Compare
|
Superseded by #630, which combines server-side default Hub preset resolution with ephemeral /chat/stream support. |
Relays
reasoning_deltaandanswer_deltaSSE frames frommed-agent-hubontoTurnEvent.delta(...)prior toanswer_doneand advertisesProviderCapability.TOKEN_STREAMINGonHubClinicalAnswerProvider.