Further removed changes from agent.js to resolve merge conflict

This commit is contained in:
Ayush Maniar 2025-03-07 19:11:10 -08:00
parent a27b336922
commit 1924e2e1cb

View file

@ -19,7 +19,6 @@ export class Agent {
async start(profile_fp, load_mem=false, init_message=null, count_id=0, task_path=null, task_id=null) {
this.last_sender = null;
this.count_id = count_id;
try {
if (!profile_fp) {
throw new Error('No profile filepath provided');
}
@ -77,7 +76,6 @@ export class Agent {
const spawnTimeout = setTimeout(() => {
process.exit(0);
}, 30000);
this.bot.once('spawn', async () => {
try {
clearTimeout(spawnTimeout);
@ -92,26 +90,18 @@ export class Agent {
this._setupEventHandlers(save_data, init_message);
this.startEvents();
if (!load_mem) {
this.task.initBotTask();
}
await new Promise((resolve) => setTimeout(resolve, 10000));
this.checkAllPlayersPresent();
} catch (error) {
console.error('Error in spawn event:', error);
throw error; //rethrow here instead
}
});
} catch (error) {
// Ensure we're not losing error details
console.error('Agent start failed with error:', {
message: error.message || 'No error message',
stack: error.stack || 'No stack trace',
error: error
});
process.exit(0);
}
});
}
async _setupEventHandlers(save_data, init_message) {