thepopebot 1.2.76-beta.32 → 1.2.76-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/code/actions.js +4 -2
- package/lib/containers/logs.js +12 -0
- package/package.json +1 -1
package/lib/code/actions.js
CHANGED
|
@@ -752,8 +752,9 @@ export async function launchWorkspaceCommand(id, command) {
|
|
|
752
752
|
return { success: false, message: 'Start coding first.' };
|
|
753
753
|
}
|
|
754
754
|
|
|
755
|
+
const { randomUUID } = await import('crypto');
|
|
755
756
|
const shortId = id.replace(/-/g, '').slice(0, 8);
|
|
756
|
-
const containerName = `command-${command}-${shortId}`;
|
|
757
|
+
const containerName = `command-${command}-${shortId}-${randomUUID().slice(0, 8)}`;
|
|
757
758
|
|
|
758
759
|
const branch = workspace.branch || 'main';
|
|
759
760
|
const featureBranch = workspace.featureBranch || '';
|
|
@@ -799,8 +800,9 @@ export async function runWorkspaceCommand(id, command) {
|
|
|
799
800
|
return { success: false, message: 'Start coding first.' };
|
|
800
801
|
}
|
|
801
802
|
|
|
803
|
+
const { randomUUID } = await import('crypto');
|
|
802
804
|
const shortId = id.replace(/-/g, '').slice(0, 8);
|
|
803
|
-
const containerName = `command-${command}-${shortId}`;
|
|
805
|
+
const containerName = `command-${command}-${shortId}-${randomUUID().slice(0, 8)}`;
|
|
804
806
|
|
|
805
807
|
// Build prompt based on command type
|
|
806
808
|
const branch = workspace.branch || 'main';
|
package/lib/containers/logs.js
CHANGED
|
@@ -116,6 +116,9 @@ export async function GET(request) {
|
|
|
116
116
|
logStream.on('error', () => {
|
|
117
117
|
send('error', { message: 'Log stream error' });
|
|
118
118
|
clearInterval(keepalive);
|
|
119
|
+
if (cleanup) {
|
|
120
|
+
removeContainer(name).catch(() => {});
|
|
121
|
+
}
|
|
119
122
|
try { streamController.close(); } catch {}
|
|
120
123
|
});
|
|
121
124
|
|
|
@@ -134,6 +137,9 @@ export async function GET(request) {
|
|
|
134
137
|
} catch (err) {
|
|
135
138
|
clearInterval(keepalive);
|
|
136
139
|
send('error', { message: err.message || 'Failed to tail logs' });
|
|
140
|
+
if (cleanup) {
|
|
141
|
+
removeContainer(name).catch(() => {});
|
|
142
|
+
}
|
|
137
143
|
try { streamController.close(); } catch {}
|
|
138
144
|
}
|
|
139
145
|
|
|
@@ -153,8 +159,14 @@ export async function GET(request) {
|
|
|
153
159
|
// Exit code from inspect data
|
|
154
160
|
const exitCode = info.State?.ExitCode ?? -1;
|
|
155
161
|
send('exit', { exitCode });
|
|
162
|
+
if (cleanup) {
|
|
163
|
+
try { await removeContainer(name); } catch {}
|
|
164
|
+
}
|
|
156
165
|
} catch (err) {
|
|
157
166
|
send('error', { message: err.message || 'Failed to get logs' });
|
|
167
|
+
if (cleanup) {
|
|
168
|
+
try { await removeContainer(name); } catch {}
|
|
169
|
+
}
|
|
158
170
|
}
|
|
159
171
|
|
|
160
172
|
try { streamController.close(); } catch {}
|