fix(web): guard system files in file write route and allow aborting waiting-for-subagents runs
This commit is contained in:
parent
67812f0de6
commit
f3fffec97f
@ -21,6 +21,8 @@ export async function POST(req: Request) {
|
||||
}
|
||||
|
||||
const run = getActiveRun(runKey);
|
||||
const aborted = run?.status === "running" ? abortRun(runKey) : false;
|
||||
const canAbort =
|
||||
run?.status === "running" || run?.status === "waiting-for-subagents";
|
||||
const aborted = canAbort ? abortRun(runKey) : false;
|
||||
return Response.json({ aborted });
|
||||
}
|
||||
|
||||
@ -49,6 +49,13 @@ export async function POST(req: Request) {
|
||||
);
|
||||
}
|
||||
|
||||
if (isSystemFile(relPath)) {
|
||||
return Response.json(
|
||||
{ error: "Cannot modify system file" },
|
||||
{ status: 403 },
|
||||
);
|
||||
}
|
||||
|
||||
// Use safeResolveNewPath (not safeResolvePath) because the file may not exist yet
|
||||
const absPath = safeResolveNewPath(relPath);
|
||||
if (!absPath) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user