Pass workspace ownership when creating terminals

This commit is contained in:
Mohamed Boudra
2026-06-16 17:35:16 +07:00
parent 10664487fb
commit 3cf3a63423
8 changed files with 159 additions and 59 deletions
+12 -1
View File
@@ -20,7 +20,18 @@ export async function runCreateCommand(
const cwd = options.cwd ?? process.cwd();
try {
const payload = await client.createTerminal(cwd, options.name);
const opened = await client.openProject(cwd);
if (!opened.workspace) {
const error: CommandError = {
code: "WORKSPACE_OPEN_FAILED",
message: opened.error ?? "Failed to open workspace",
};
throw error;
}
const payload = await client.createTerminal(cwd, options.name, undefined, {
workspaceId: opened.workspace.id,
});
if (!payload.terminal) {
const error: CommandError = {
code: "TERMINAL_CREATE_FAILED",