mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 10:23:14 +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") {
|
||||
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 (
|
||||
<div className="flex-1">
|
||||
{props.workdir && (
|
||||
|
|
@ -149,7 +164,7 @@ export function ActionStep(props: ActionStepProps) {
|
|||
</div>
|
||||
)}
|
||||
<code className="text-foreground/80 text-xs font-normal">
|
||||
{props.command?.join(" ")}
|
||||
{commandStr}
|
||||
</code>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue