lizhimins commented on PR #6487:
URL:
https://github.com/apache/rocketmq-dashboard/pull/6487#issuecomment-6190304621
Closing in favour of #6438, which is now merged into `rocketmq-studio` as
`ef069890b`. The crash is real and your read of it matches ours exactly:
`AgentEventProjector.labelFor`
(`server/src/main/java/org/apache/rocketmq/studio/ops/ai/conversation/event/AgentEventProjector.java:310-315`)
returns null when the provider reported a result without a remembered start,
`TimelineEvent.java:53`'s `@JsonInclude(NON_NULL)` then drops the field, and
`web/src/pages/ai/render/blocks.ts:123` called `tool.startsWith(...)`
unconditionally, taking the whole transcript down. We are closing this as a
duplicate of **#6438**, which patches the same line for the same issue (#6432)
and goes two steps further that this branch needs: it guards with `typeof tool
!== 'string'` rather than a falsy check (so a truthy non-string still cannot
reach `startsWith`), and it fixes the two consumers your version leaves broken
— `web/src/pages/ai/components/blocks/ToolBlock.tsx:115` would render an
**empty card titl
e** once `toolDisplayName` returns `''` (#6438 falls back to a new localised
`ai.tool.unknownName`), and `resolveCatalogTool` at `:96-105` keeps searching
the catalog with `display === ''` (#6438 early-returns on a blank/non-string
name). Two notes on the test. First, two of your three assertions already pass
on the base: `web/src/pages/ai/render/equivalence.test.ts:763-772` has a
`describe('toolDisplayName')` block whose
`stripsTransportAndNamespacePrefixesTest` already asserts
`toolDisplayName('rmq.topic.list') === 'topic.list'` (`:766`) and
`toolDisplayName('') === ''` (`:771`) — the empty string never threw, because
both `startsWith` calls return false and the function falls through to
`withoutMcp`. Only the `undefined` case is new here, so the description's
"blank and `undefined` degrade, real names keep their prefixes stripped"
overstates what this branch adds. Second, the new block at
`equivalence.test.ts:217` is a second `describe('toolDisplayName')` alongside
the existing
one, which Vitest will run side by side under the same name. If you want to
keep contributing in this area, the useful follow-up against #6438's shape is a
component-level case for the live path (`web/src/pages/ai/render/reduceLive.ts`
produces the same nameless block) rather than another helper-level one.
--
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]