osai-agent 4.2.27 → 4.2.28

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": "osai-agent",
3
- "version": "4.2.27",
3
+ "version": "4.2.28",
4
4
  "type": "module",
5
5
  "description": "OS AI Agent - YOUR AI AGENT",
6
6
  "main": "src/index.js",
@@ -39,7 +39,7 @@ export default {
39
39
  if (msg.type === 'REGISTERED') { clearTimeout(connectTimeout); this.ws = ws; resolve(msg); }
40
40
  else if (msg.type === 'COMMANDS') { this.pendingCommands = msg.commands; this.currentTaskId = msg.taskId; }
41
41
  else if (msg.type === 'CANCEL_ACK') { logger.info('Cancellation acknowledged by server'); }
42
- else if (msg.type === 'ERROR') { logger.warn('WebSocket error message', { message: msg.message }); }
42
+ else if (msg.type === 'ERROR') { clearTimeout(connectTimeout); ws.close(); reject(new Error(msg.message)); }
43
43
  else if (msg.type === 'CANCEL_SUBAGENT') {
44
44
  if (this._subagentActive && this._subagentLoop) {
45
45
  this._subagentLoop.cancel();
@@ -274,6 +274,10 @@ export class AgentLoop {
274
274
  await this._connectWebSocket();
275
275
  } catch (err) {
276
276
  this.onConnectionChange(false);
277
+ if (err.message.toLowerCase().includes('disabled')) {
278
+ console.log(chalk.red(`\n ${err.message}\n`));
279
+ process.exit(1);
280
+ }
277
281
  logger.debug(`WebSocket connection failed: ${err.message}`);
278
282
  logger.warn('Server unavailable, running in offline mode');
279
283
  this.ws = null;