@openagents-org/agent-launcher 0.2.53 → 0.2.55

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.53",
3
+ "version": "0.2.55",
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
@@ -52,17 +52,9 @@ class Installer {
52
52
  const binaryPath = this._whichBinary(agentType);
53
53
  if (!binaryPath) return false;
54
54
 
55
- // Verify it's not a stale shim — check the actual package exists
56
- // npm shims point to node_modules/<pkg>/ — if the package dir is gone, the shim is stale
57
- const entry = this.registry.getEntry(agentType);
58
- const npmPkg = entry && entry.install ? entry.install.npm_package : null;
59
- const binary = entry && entry.install ? entry.install.binary : agentType;
60
- const portableDir = path.join(os.homedir(), '.openagents', 'nodejs');
61
- const globalModules = path.join(portableDir, 'node_modules');
62
-
63
- // If the binary is in our portable dir, verify the package exists
55
+ // Verify it's not a stale shim — if binary is in our portable dir,
56
+ // check the actual package exists (reuse variables from above)
64
57
  if (binaryPath.startsWith(portableDir)) {
65
- const pkgDir = path.join(globalModules, npmPkg || binary);
66
58
  if (!fs.existsSync(path.join(pkgDir, 'package.json'))) {
67
59
  // Stale shim — clean it up from all possible locations
68
60
  for (const dir of [portableDir, path.join(globalModules, '.bin')]) {