fix: expose Workbench dispatch failures

This commit is contained in:
root
2026-07-20 14:50:06 +02:00
parent 867a4c6f58
commit f9c54ae7ea
11 changed files with 386 additions and 8 deletions
@@ -15,6 +15,37 @@ function componentStubs() {
};
}
describe("WorkbenchMessageCard startup visibility", () => {
it("shows one startup label before the first Kafka event", () => {
const wrapper = mount(WorkbenchMessageCard, {
props: {
detailEnabled: false,
message: {
id: "msg_starting_agent",
messageId: "msg_starting_agent",
role: "agent",
title: "Code Agent",
text: "",
status: "running",
traceId: "trc_starting",
sessionId: "ses_starting",
createdAt: "2026-07-20T10:00:00.000Z",
}
},
global: {
stubs: {
...componentStubs(),
LoadingState: { props: ["label"], template: "<div class='loading-state'>{{ label }}</div>" },
}
}
});
expect(wrapper.text()).toContain("启动中...");
expect(wrapper.text()).not.toContain("思考中...");
expect(wrapper.findAll(".loading-state")).toHaveLength(1);
wrapper.unmount();
});
});
describe("WorkbenchMessageCard semantic retry visibility", () => {
it("shows Git mirror clone progress as runtime preparation", () => {
const wrapper = mount(WorkbenchMessageCard, {
@@ -155,7 +155,7 @@ function traceStorageKey(message: ChatMessage): string {
<code v-if="semanticRuntimeStatus.code && semanticRuntimeStatus.emphasis === 'alert'">{{ semanticRuntimeStatus.code }}</code>
</section>
<TraceTimeline v-if="message.role === 'agent' && message.runnerTrace" :trace="message.runnerTrace" :auto-expanded="autoExpanded" :storage-key="traceStorageKey(message)" final-response-placement="outer" :outer-final-response-text="visibleText" />
<LoadingState v-if="isAwaitingAgentBody(message)" class="message-loading" label="思考中..." compact />
<LoadingState v-if="isAwaitingAgentBody(message)" class="message-loading" label="启动中..." compact />
<MessageMarkdown v-if="visibleText" class="message-text" :source="visibleText" />
<ApiErrorDiagnostic v-if="diagnostic.visible" class="message-diagnostic projection-diagnostic" :error="diagnostic.text" :api-error="diagnostic.apiError" :diagnostic="diagnostic.diagnostic" :show-message="diagnostic.showMessage" compact />
</article>