osborn 0.8.5 → 0.8.6

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -4
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -322,13 +322,33 @@ async function main() {
322
322
  // Always the Osborn agent install directory (where this process started).
323
323
  // This ensures .osborn/sessions/ doesn't scatter across random directories.
324
324
  const sessionBaseDir = process.cwd(); // Always the Osborn install dir
325
- const defaultWorkingDir = process.env.OSBORN_CWD || config.workingDirectory || process.cwd();
325
+ // Self-healing fallback: blindly trusting OSBORN_CWD without checking that the directory
326
+ // exists has bitten us in cloud sandboxes where the env var was set to a path that didn't
327
+ // exist (e.g. `/root/workspace` on a daytona/* user). The Claude SDK then fails its spawn
328
+ // call with ENOENT and reports the misleading "Claude Code executable not found" error.
329
+ // Walk the candidate list in priority order and pick the first one that ACTUALLY exists.
330
+ // process.cwd() is the ultimate safety net — it always exists by definition.
331
+ const cwdCandidates = [
332
+ { source: 'OSBORN_CWD env var', value: process.env.OSBORN_CWD },
333
+ { source: 'config.workingDirectory', value: config.workingDirectory },
334
+ { source: 'process.cwd()', value: process.cwd() },
335
+ ];
336
+ let defaultWorkingDir = process.cwd();
337
+ let cwdSource = 'process.cwd() (last-resort fallback)';
338
+ for (const c of cwdCandidates) {
339
+ if (c.value && existsSync(c.value)) {
340
+ defaultWorkingDir = c.value;
341
+ cwdSource = c.source;
342
+ break;
343
+ }
344
+ if (c.value) {
345
+ console.log(` ⚠️ ${c.source} = ${c.value} (does not exist, skipping)`);
346
+ }
347
+ }
326
348
  let workingDir = defaultWorkingDir;
327
349
  console.log(`📂 Working directory (cwd): ${workingDir}`);
328
350
  console.log(`📂 Session base directory: ${sessionBaseDir}`);
329
- if (process.env.OSBORN_CWD) {
330
- console.log(` (cwd from OSBORN_CWD env var)`);
331
- }
351
+ console.log(` (cwd from ${cwdSource})`);
332
352
  console.log(`🔬 Mode: RESEARCH`);
333
353
  // Determine voice mode
334
354
  const voiceMode = getVoiceMode(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,7 +10,8 @@
10
10
  "dev": "tsx src/index.ts",
11
11
  "start": "tsx src/index.ts",
12
12
  "build": "tsc",
13
- "room": "tsx src/index.ts --room"
13
+ "room": "tsx src/index.ts --room",
14
+ "prepublishOnly": "npm run build"
14
15
  },
15
16
  "keywords": [
16
17
  "voice",