openteam 1.0.5 → 1.0.6
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/package.json +1 -1
- package/src/wrapper/index.js +6 -1
package/package.json
CHANGED
package/src/wrapper/index.js
CHANGED
|
@@ -266,7 +266,9 @@ function writeSystemPromptFile(agent, teamPrompt) {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
const combined = [agentContent, '', '---', '', '# Team Context', '', teamPrompt].join('\n');
|
|
269
|
-
|
|
269
|
+
// 进程独占的临时目录,避免多用户/多实例文件冲突
|
|
270
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'openteam-'));
|
|
271
|
+
const tmpPath = path.join(tmpDir, `${agent}.md`);
|
|
270
272
|
fs.writeFileSync(tmpPath, combined, 'utf-8');
|
|
271
273
|
return tmpPath;
|
|
272
274
|
}
|
|
@@ -274,6 +276,9 @@ function writeSystemPromptFile(agent, teamPrompt) {
|
|
|
274
276
|
function cleanupTempFile(filePath) {
|
|
275
277
|
try {
|
|
276
278
|
if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
|
|
279
|
+
// 清理临时目录(mkdtemp 创建的)
|
|
280
|
+
const dir = path.dirname(filePath);
|
|
281
|
+
if (dir !== os.tmpdir()) fs.rmdirSync(dir);
|
|
277
282
|
} catch {
|
|
278
283
|
// 忽略清理失败
|
|
279
284
|
}
|