@openagents-org/agent-launcher 0.2.6 → 0.2.8
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/adapters/base.js +10 -2
- package/src/installer.js +11 -8
package/package.json
CHANGED
package/src/adapters/base.js
CHANGED
|
@@ -80,7 +80,10 @@ class BaseAdapter {
|
|
|
80
80
|
|
|
81
81
|
try {
|
|
82
82
|
// Send initial heartbeat
|
|
83
|
-
await this._heartbeat();
|
|
83
|
+
try { await this._heartbeat(); } catch (e) {
|
|
84
|
+
this._log(`Heartbeat failed (non-fatal): ${e.message}`);
|
|
85
|
+
}
|
|
86
|
+
this._log('Starting poll loop...');
|
|
84
87
|
await this._pollLoop();
|
|
85
88
|
} finally {
|
|
86
89
|
this._running = false;
|
|
@@ -169,8 +172,10 @@ class BaseAdapter {
|
|
|
169
172
|
|
|
170
173
|
async _pollLoop() {
|
|
171
174
|
let idleCount = 0;
|
|
175
|
+
let pollCount = 0;
|
|
172
176
|
|
|
173
177
|
while (this._running) {
|
|
178
|
+
pollCount++;
|
|
174
179
|
let messages, rawCursor;
|
|
175
180
|
try {
|
|
176
181
|
const result = await this.client.pollPending(
|
|
@@ -179,8 +184,11 @@ class BaseAdapter {
|
|
|
179
184
|
);
|
|
180
185
|
messages = result.messages;
|
|
181
186
|
rawCursor = result.cursor;
|
|
187
|
+
if (pollCount <= 3 || pollCount % 20 === 0) {
|
|
188
|
+
this._log(`Poll #${pollCount}: ${messages.length} messages, cursor=${rawCursor || 'none'}`);
|
|
189
|
+
}
|
|
182
190
|
} catch (e) {
|
|
183
|
-
this._log(`Poll failed: ${e.message}`);
|
|
191
|
+
this._log(`Poll #${pollCount} failed: ${e.message}`);
|
|
184
192
|
await this._sleep(5000);
|
|
185
193
|
continue;
|
|
186
194
|
}
|
package/src/installer.js
CHANGED
|
@@ -35,7 +35,16 @@ class Installer {
|
|
|
35
35
|
* Checks binary on PATH first, then marker files.
|
|
36
36
|
*/
|
|
37
37
|
isInstalled(agentType) {
|
|
38
|
-
//
|
|
38
|
+
// Fast check: marker file or binary on PATH (no execSync to avoid blocking)
|
|
39
|
+
if (this._hasMarker(agentType)) return true;
|
|
40
|
+
if (this._whichBinary(agentType)) return true;
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Deep verification — runs the agent's verify command (slow, use sparingly).
|
|
46
|
+
*/
|
|
47
|
+
verifyInstalled(agentType) {
|
|
39
48
|
const entry = this.registry.getEntry(agentType);
|
|
40
49
|
const IS_WINDOWS = process.platform === 'win32';
|
|
41
50
|
const verifyCmd = entry && entry.install
|
|
@@ -47,13 +56,7 @@ class Installer {
|
|
|
47
56
|
return true;
|
|
48
57
|
} catch { return false; }
|
|
49
58
|
}
|
|
50
|
-
|
|
51
|
-
if (this._hasMarker(agentType)) {
|
|
52
|
-
// Marker exists but binary not found — stale marker, clean it up
|
|
53
|
-
this._markUninstalled(agentType);
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
return false;
|
|
59
|
+
return this.isInstalled(agentType);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
/**
|