mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-04 09:02:11 +00:00
fix: Account for when tool call args are not properly formatted (#277)
* fix: Account for when tool call args are not properly formatted * cr
This commit is contained in:
parent
e8c742dc71
commit
c6e29e0166
1 changed files with 16 additions and 1 deletions
|
|
@ -141,6 +141,21 @@ export function ActionStep(props: ActionStepProps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.actionType === "shell") {
|
if (props.actionType === "shell") {
|
||||||
|
let commandStr = "";
|
||||||
|
if (props.command) {
|
||||||
|
if (Array.isArray(props.command)) {
|
||||||
|
commandStr = props.command.join(" ");
|
||||||
|
} else if (
|
||||||
|
typeof props.command === "string" &&
|
||||||
|
(props.command as string).length > 0
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
commandStr = JSON.parse(props.command);
|
||||||
|
} catch {
|
||||||
|
commandStr = props.command;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
{props.workdir && (
|
{props.workdir && (
|
||||||
|
|
@ -149,7 +164,7 @@ export function ActionStep(props: ActionStepProps) {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<code className="text-foreground/80 text-xs font-normal">
|
<code className="text-foreground/80 text-xs font-normal">
|
||||||
{props.command?.join(" ")}
|
{commandStr}
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue