@lightcone-ai/daemon 0.6.2 → 0.6.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -146,6 +146,17 @@ export class AgentManager {
146
146
  proc.on('exit', (code) => {
147
147
  console.log(`[AgentManager] Agent ${agentId} channel=${channelId ?? 'none'} exited (code=${code})`);
148
148
  this.agents.delete(key);
149
+
150
+ // If exited immediately with an error and had a session, retry without session (session file may not exist on this machine)
151
+ if (code !== 0 && config.sessionId && !this._retried?.has(key)) {
152
+ if (!this._retried) this._retried = new Set();
153
+ this._retried.add(key);
154
+ console.log(`[AgentManager] Retrying ${agentId} channel=${channelId} without session (session may not exist locally)`);
155
+ const retryConfig = { ...config, sessionId: null };
156
+ this._startAgent({ agentId, channelId, config: retryConfig }, connection);
157
+ return;
158
+ }
159
+
149
160
  connection.send({ type: 'agent:status', agentId, channelId, status: 'inactive' });
150
161
  connection.send({ type: 'agent:activity', agentId, channelId, activity: 'offline', detail: '', entries: [] });
151
162
  });