You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zjncs (via GitHub)" <gi...@apache.org> on 2026/10/08 14:16:57 UTC

[PR] test(ai): pin the prompt enhancer failure and streaming contract [rocketmq-dashboard]

zjncs opened a new pull request, #5734:
URL: https://github.com/apache/rocketmq-dashboard/pull/5734

   ### What
   
   `PromptEnhancer` — the rewrite of a user's message into a structured prompt before the agent run — had no test. This adds `PromptEnhancerTest` with 12 tests pinning the contract its own documentation calls load-bearing.
   
   ### What is pinned
   
   - a blank prompt is returned untouched **without any model call**;
   - an HTTP engine rewrites through the LLM client with the raw prompt embedded in the meta-prompt template; a CLI engine rewrites through that engine's provider (a CLI-only deployment needs no HTTP provider configured), and the engine match is case- and whitespace-insensitive with null/blank defaulting to HTTP;
   - deltas stream to the caller **as they arrive**, and empty chunks are skipped from both the stream and the accumulation;
   - **failure is not fatal**: a throwing provider, an empty rewrite, a rewrite that cleans to nothing, and a failing delta observer all leave the run with the original message — losing a rewrite costs prompt quality, failing the turn would cost the answer;
   - `clean` strips the **markdown fence** a model sometimes wraps the rewrite in (in a chat answer it is decoration; in the prompt handed to the agent it reads as an instruction), while the live stream carries the raw chunks.
   
   ### Verification
   
   - New tests on unmodified code: **12/12 green**, checkstyle clean (`mvn test -Dtest=PromptEnhancerTest`).
   - Discriminating mutations on `PromptEnhancer`, build result verified red each time:
     1. the failure fallback removed — red (the failing-provider, empty-rewrite and failing-observer tests);
     2. the fence stripping dropped from `clean` — red (three tests);
     3. the engine routing inverted — red (five tests).
   - Restored: 12/12 green. Test-only change; no product code touched.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(ai): pin the prompt enhancer failure and streaming contract [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@rocketmq.apache.org>.
github-actions[bot] closed pull request #5734: test(ai): pin the prompt enhancer failure and streaming contract
URL: https://github.com/apache/rocketmq-dashboard/pull/5734


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(ai): pin the prompt enhancer failure and streaming contract [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@rocketmq.apache.org>.
github-actions[bot] commented on PR #5734:
URL: https://github.com/apache/rocketmq-dashboard/pull/5734#issuecomment-6782934180

   This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org