yyqdbngt opened a new pull request, #5342:
URL: https://github.com/apache/rocketmq-dashboard/pull/5342
### Which Issue(s) This PR Fixes
- Fixes #5270
### Brief Description
Documentation only - the deliverable is the corrected text in
`docs/ai-agent-architecture.md`, so there is no test to add and no red/green
run. The
evidence is the implementation the two claims are checked against, quoted
below.
1. The 32 KiB tool-output ceiling was listed under "两侧内容**故意不同**" ("the two
sides
are deliberately different"), which reads as if only the persisted copy
is cut and the
live SSE stream carries the full output. That is the opposite of what the
projector
does. `AgentEventProjector.projectToolDone` builds one sanitised value
and hands it to
both sides:
```java
SanitisedOutput output = sanitise(done.output());
return Projection.of(
new LiveEvent.ToolDone(done.tcId(), tool, output.output(),
output.outputBytes(),
output.truncated(), durationMs, done.success(),
done.error()),
drainThen(new TimelineEvent.ToolResult(done.tcId(), tool,
output.output(),
output.outputBytes(), output.truncated(), done.success(),
durationMs,
done.error())));
```
and the constant behind it is declared on both sides:
```java
/** Ceiling for a tool output on both sides. Beyond this the output is
cut and marked truncated. */
public static final int MAX_TOOL_OUTPUT_BYTES = 32 * 1024;
```
`AgentEventProjectorTest.toolOutputOneByteOverTheCapIsTruncatedOnBothSidesTest`
pins
this (`assertThat(persisted.output()).isEqualTo(live.output())`), and
passes on the
unmodified tree:
```
$ cd server && mvn -B -ntp test -Dtest=AgentEventProjectorTest
[INFO] Tests run: 40, Failures: 0, Errors: 0, Skipped: 0 -- in
AgentEventProjectorTest
[INFO] BUILD SUCCESS
```
The sentence now says the tool output is *not* part of that difference:
the same
`SanitisedOutput` feeds live `tool_done` and persisted `tool_result`,
both are cut at
32 KiB and both carry `outputBytes`/`truncated`, so a caller reading the
SSE stream must
expect already-truncated output.
2. The note said `style/rmq_checkstyle.xml` rejects non-ASCII characters in
Java sources.
The rule is a `RegexpSingleline` whose `format` only covers CJK
ideographs, CJK
compatibility ideographs, fullwidth forms and the neighbouring CJK blocks:
```xml
<module name="RegexpSingleline">
<property name="format"
value=".*[\u3400-\u4DB5\u4E00-\u9FA5\u9FA6-\u9FBB\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9\uFF00-\uFFEF\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF]+.*"/>
<property name="message" value="Not allow chinese character !"/>
</module>
```
I ran that exact regex through the JDK to see which sample lines it fires
on
(`java CheckstyleChars.java`, a scratch file, not part of this PR):
```
format = .*[\u3400-\u4DB5\u4E00-\u9FA5...\u31C0-\u31EF]+.*
REJECTED | CJK chinese (本次会话未绑定实例)
REJECTED | fullwidth comma/period (,。)
allowed | latin-1 supplement (cafe, Grusse) (café Grüße)
allowed | cyrillic/greek (бα)
allowed | plain ascii
```
So the rule rejects Chinese characters and fullwidth punctuation, not
"non-ASCII"; the
sentence now says exactly that. (The reference to
`style/rmq_checkstyle.xml` itself is
left alone: that is the plugin's `<configLocation>` path relative to
`server/`.)
### How Did You Test This Change?
Documentation-only change: no test was added and no application code was
touched, so there
is no red -> green pair to show. What I did run, on the unmodified tree, is
the
implementation's own test for the first claim (`AgentEventProjectorTest`, 40
tests, BUILD
SUCCESS above) and the JDK regex check for the second claim (output above);
both are
pasted verbatim.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits
- [ ] Tests added or updated for non-trivial changes - not applicable, docs
only; the two claims are evidenced above instead
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- not applicable, no UI text
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks) - no source file changed
- [ ] New source files carry the ASF license header - no new file
- [x] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
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]