@openagents-org/agent-launcher 0.2.54 → 0.2.56

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": "@openagents-org/agent-launcher",
3
- "version": "0.2.54",
3
+ "version": "0.2.56",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -163,6 +163,13 @@ class OpenClawAdapter extends BaseAdapter {
163
163
 
164
164
  _runCliAgent(userMessage, channel) {
165
165
  return new Promise((resolve, reject) => {
166
+ // Re-check binary if not found at construction time (installed after daemon started)
167
+ if (!this._openclawBinary) {
168
+ this._openclawBinary = this._findOpenclawBinary();
169
+ if (this._openclawBinary) {
170
+ this._log(`OpenClaw binary found (late): ${this._openclawBinary}`);
171
+ }
172
+ }
166
173
  const binary = this._openclawBinary;
167
174
  if (!binary) {
168
175
  reject(new Error('OpenClaw binary not found'));
package/src/installer.js CHANGED
@@ -36,9 +36,6 @@ class Installer {
36
36
  * Checks binary on PATH first, then marker files.
37
37
  */
38
38
  isInstalled(agentType) {
39
- // Fast check: marker file
40
- if (this._hasMarker(agentType)) return true;
41
-
42
39
  // Definitive check: does the package exist in our node_modules?
43
40
  const portableDir = path.join(os.homedir(), '.openagents', 'nodejs');
44
41
  const globalModules = path.join(portableDir, 'node_modules');
@@ -48,9 +45,16 @@ class Installer {
48
45
  const pkgDir = path.join(globalModules, npmPkg || binary);
49
46
  if (fs.existsSync(path.join(pkgDir, 'package.json'))) return true;
50
47
 
48
+ // Marker file alone is not enough — package may have been pruned
49
+ // (npm --prefix removes packages not in its dependency tree)
50
+
51
51
  // Fallback: check if binary exists on PATH (system install)
52
52
  const binaryPath = this._whichBinary(agentType);
53
- if (!binaryPath) return false;
53
+ if (!binaryPath) {
54
+ // Clean stale marker if package is gone
55
+ if (this._hasMarker(agentType)) this._removeMarker(agentType);
56
+ return false;
57
+ }
54
58
 
55
59
  // Verify it's not a stale shim — if binary is in our portable dir,
56
60
  // check the actual package exists (reuse variables from above)