@dmsdc-ai/aigentry-telepty 0.1.39 → 0.1.40
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/daemon.js +8 -1
- package/package.json +1 -1
package/daemon.js
CHANGED
|
@@ -193,7 +193,14 @@ app.post('/api/sessions/spawn', (req, res) => {
|
|
|
193
193
|
app.post('/api/sessions/register', (req, res) => {
|
|
194
194
|
const { session_id, command, cwd = process.cwd() } = req.body;
|
|
195
195
|
if (!session_id) return res.status(400).json({ error: 'session_id is required' });
|
|
196
|
-
|
|
196
|
+
// Idempotent: allow re-registration (update command/cwd, keep clients)
|
|
197
|
+
if (sessions[session_id]) {
|
|
198
|
+
const existing = sessions[session_id];
|
|
199
|
+
if (command) existing.command = command;
|
|
200
|
+
if (cwd) existing.cwd = cwd;
|
|
201
|
+
console.log(`[REGISTER] Re-registered session ${session_id} (updated metadata)`);
|
|
202
|
+
return res.status(200).json({ session_id, type: 'wrapped', command: existing.command, cwd: existing.cwd, reregistered: true });
|
|
203
|
+
}
|
|
197
204
|
|
|
198
205
|
const sessionRecord = {
|
|
199
206
|
id: session_id,
|