Skip to content

Commit db600d8

Browse files
cristipufuclaude
andcommitted
feat: disable conversational mode when input schema lacks messages property
Fetches the entrypoint schema on selection and disables the Conversational mode card if the input schema has no top-level "messages" property. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1c2d7f0 commit db600d8

3 files changed

Lines changed: 59 additions & 40 deletions

File tree

src/uipath/dev/server/frontend/src/components/runs/NewRunPanel.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
import { useEffect, useState } from "react";
22
import { useRunStore } from "../../store/useRunStore";
33
import { useHashRoute } from "../../hooks/useHashRoute";
4+
import { getEntrypointSchema } from "../../api/client";
45

56
export default function NewRunPanel() {
67
const { navigate } = useHashRoute();
78
const entrypoints = useRunStore((s) => s.entrypoints);
89
const [selectedEp, setSelectedEp] = useState("");
10+
const [chatSupported, setChatSupported] = useState(true);
911

1012
useEffect(() => {
1113
if (!selectedEp && entrypoints.length > 0) {
1214
setSelectedEp(entrypoints[0]);
1315
}
1416
}, [entrypoints, selectedEp]);
1517

18+
useEffect(() => {
19+
if (!selectedEp) return;
20+
setChatSupported(true);
21+
getEntrypointSchema(selectedEp)
22+
.then((schema) => {
23+
const props = (schema.input as any)?.properties;
24+
setChatSupported(!!props?.messages);
25+
})
26+
.catch(() => {
27+
setChatSupported(true); // don't block on schema fetch errors
28+
});
29+
}, [selectedEp]);
30+
1631
const handleModeSelect = (mode: "run" | "chat") => {
1732
if (!selectedEp) return;
1833
navigate(`#/setup/${encodeURIComponent(selectedEp)}/${mode}`);
@@ -80,11 +95,15 @@ export default function NewRunPanel() {
8095
/>
8196
<ModeCard
8297
title="Conversational"
83-
description="Interactive chat session. Send messages and receive responses in real time."
98+
description={
99+
!chatSupported
100+
? "Requires a \"messages\" property in the input schema."
101+
: "Interactive chat session. Send messages and receive responses in real time."
102+
}
84103
icon={<ChatIcon />}
85104
color="var(--accent)"
86105
onClick={() => handleModeSelect("chat")}
87-
disabled={!selectedEp}
106+
disabled={!selectedEp || !chatSupported}
88107
/>
89108
</div>
90109
</div>

src/uipath/dev/server/static/assets/index-0ltKByQD.js renamed to src/uipath/dev/server/static/assets/index-Bf_jJ1I9.js

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uipath/dev/server/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>UiPath Developer Console</title>
77
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
8-
<script type="module" crossorigin src="/assets/index-0ltKByQD.js"></script>
8+
<script type="module" crossorigin src="/assets/index-Bf_jJ1I9.js"></script>
99
<link rel="stylesheet" crossorigin href="/assets/index-uNV7Cy8X.css">
1010
</head>
1111
<body>

0 commit comments

Comments
 (0)