pilichoumao opened a new issue, #6874:
URL: https://github.com/apache/rocketmq-dashboard/issues/6874

   ### Studio Version
   
   `rocketmq-studio` at a92c23144408cdf5729707050e9ecd9b75f1bad0, source-level 
reproduction on Ubuntu Linux / JDK 21. No live model, datasource or Broker is 
required.
   
   ### Describe the Bug
   
   `PromptEnhancer.clean()` checks only whether the first and last lines look 
like backtick fences. Two separate code examples with prose between them 
therefore lose the first opening fence and the last closing fence. `enhance()` 
returns this corrupted string as the prompt for the subsequent agent.
   
   For example, pass this complete model response to `clean()`:
   
   ````text
   ```json
   {"key":1}
   ```
   Compare with this command:
   ```bash
   printf ok
   ```
   ````
   
   The result loses the `json` opener and the final `bash` closer, although the 
first block already closed before the intervening prose. A four-backtick opener 
followed only by a three-backtick closer is also incorrectly stripped.
   
   ### Expected Behavior
   
   Only remove a complete outer wrapper: the first valid closing fence must be 
the final line and must have at least the opening marker's length. Preserve 
separate examples, unclosed wrappers and their intervening instructions. Retain 
#6680's complete-info-string stripping for genuine wrappers.
   
   ### Verification and Related Work
   
   On the exact baseline production class, ECS regressions produced four 
failures, including a mocked text stream through `enhance()`. A 
boundary-checking research prototype passed all 14 cases (the nine existing 
#6680 cases plus five research cases). This is targeted source verification, 
not an online model or full backend result.
   
   Related: merged #6680; open #5734 adds general enhancer tests but does not 
cover these boundaries; #6817 addresses a different missing-result-frame 
failure in the Claude provider. I checked their actual patches and current open 
PRs. Proposed scope is the cleaner and its existing test file, without a new 
Markdown dependency or changes to provider completion semantics.
   
   AI assistance was used for investigation and verification.
   


-- 
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]

Reply via email to