fix(P0): Daytona sandbox use process/execute endpoint + add sourceType to writer doc_edit/translate
- Fix Daytona code execution endpoint from process/code-run (404) to process/execute
- Fix request body format to {command} with language-aware shell wrapping
- Add missing sourceType/confidence props to writer doc_edit and doc_translate ui.push
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
0e92444112
commit
4ad169e891
@@ -243,23 +243,29 @@ export async function sandboxRun(
|
||||
|
||||
const t0 = Date.now();
|
||||
try {
|
||||
// Execute code via Daytona Toolbox proxy
|
||||
// Execute code via Daytona Toolbox proxy (process/execute endpoint)
|
||||
const cmd =
|
||||
language === "python"
|
||||
? `python3 -c '${code.replace(/'/g, "'\\''")}'`
|
||||
: language === "javascript"
|
||||
? `node -e '${code.replace(/'/g, "'\\''")}'`
|
||||
: code;
|
||||
const execResp = await fetch(
|
||||
`https://proxy.app.daytona.io/toolbox/${sbId}/process/code-run`,
|
||||
`https://proxy.app.daytona.io/toolbox/${sbId}/process/execute`,
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify({ code, env: {}, timeout: 25000 }),
|
||||
body: JSON.stringify({ command: cmd }),
|
||||
signal: AbortSignal.timeout(30000),
|
||||
},
|
||||
);
|
||||
const execData: { exitCode?: number; result?: string; output?: string } =
|
||||
const execData: { exitCode?: number; result?: string } =
|
||||
execResp.ok
|
||||
? await execResp.json()
|
||||
: { exitCode: 1, result: "Exec failed" };
|
||||
return {
|
||||
exit_code: execData.exitCode ?? 0,
|
||||
stdout: String(execData.result ?? execData.output ?? "").slice(0, 2000),
|
||||
stdout: String(execData.result ?? "").slice(0, 2000),
|
||||
duration_ms: Date.now() - t0,
|
||||
};
|
||||
} finally {
|
||||
|
||||
@@ -152,6 +152,8 @@ export async function writerToolExecutorNode(
|
||||
content: editedContent,
|
||||
type: docType,
|
||||
language: existing?.language ?? "",
|
||||
sourceType: "generated_doc",
|
||||
confidence: "high",
|
||||
},
|
||||
},
|
||||
{ message: lastAiMessage },
|
||||
@@ -207,6 +209,8 @@ export async function writerToolExecutorNode(
|
||||
content: translatedContent,
|
||||
type: docType,
|
||||
language: existing?.language ?? "",
|
||||
sourceType: "generated_doc",
|
||||
confidence: "high",
|
||||
},
|
||||
},
|
||||
{ message: lastAiMessage },
|
||||
|
||||
Reference in New Issue
Block a user