Date: 2025-10-18 22:58 Test: Multi-project launcher execution Status: ✅ BLOCKING CONFIRMED - Root Cause Identified
The launcher blocks because of a working directory reset that breaks relative path resolution.
[STATUS] ✅ DevStream framework environment is valid
Shell cwd was reset to /Users/fulvioventura/devstream
What happens:
- Launcher starts in
/Users/fulvioventura/exc-to-pdf(project directory) initialize_project_venv()completes successfully (line 703)- Working directory gets reset to
/Users/fulvioventura/devstream(launcher directory) - Subsequent functions try to work with
PROJECT_ROOT="."(relative path) - Since we're now in the wrong directory,
"."resolves to/Users/fulvioventura/devstreaminstead of/Users/fulvioventura/exc-to-pdf - Functions silently fail or hang because they can't find expected files/directories
cd /Users/fulvioventura/exc-to-pdf && \
/Users/fulvioventura/devstream/start-devstream2.sh start anthropic[INFO] Multi-project mode (explicit): .
[INFO] DevStream installation: /Users/fulvioventura/devstream
[STATUS] Validating DevStream project at: .
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 DevStream Project Detected
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project Name: . ← RELATIVE PATH
Location: . ← RELATIVE PATH
Database: data/devstream.db (388K) ← RELATIVE PATH
Python Venv: .devstream/ ← RELATIVE PATH
Python: Python 3.11.13
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
...
[INFO] Database path: ./data/devstream.db ← RELATIVE PATH
...
[STATUS] 🐍 Initializing project virtual environment...
[STATUS] 🔧 Ensuring DevStream framework virtual environment...
[INFO] 📁 Found existing .devstream directory
[INFO] 🔍 Validating DevStream framework environment...
[INFO] 🔍 Validating virtual environment: DevStream Framework (./.devstream)
[INFO] ✅ Virtual environment validated: Python 3.11.13
[INFO] 🔍 Validating required modules...
[INFO] ✅ All required modules available
[INFO] ✅ DevStream framework environment validated
[STATUS] ✅ DevStream framework environment is valid
Shell cwd was reset to /Users/fulvioventura/devstream ← 🔥 ROOT CAUSE
[ HANGS HERE - NO FURTHER OUTPUT - TIMEOUT AFTER 30 SECONDS ]
Result: Process hangs indefinitely, requires manual kill.
$ env | grep DEVSTREAM_PROJECT_ROOT
DEVSTREAM_PROJECT_ROOT=.Source: Pre-existing environment variable set to relative path "." instead of absolute path.
File: start-devstream2.sh
Lines: 70-73
if [ -n "${DEVSTREAM_PROJECT_ROOT:-}" ]; then
PROJECT_ROOT="$DEVSTREAM_PROJECT_ROOT" # ← No validation!
DEVSTREAM_SCRIPT_DIR="$DEVSTREAM_INSTALLATION_ROOT"
print_info "Multi-project mode (explicit): $PROJECT_ROOT"Problem: Accepts DEVSTREAM_PROJECT_ROOT="." without checking if it's an absolute path.
All output shows relative paths:
- Project Name:
. - Location:
. - Database:
data/devstream.db(relative) - Python Venv:
.devstream/(relative)
File: start-devstream2.sh
Location: After line 703 (end of initialize_project_venv)
The message "Shell cwd was reset to /Users/fulvioventura/devstream" appears after venv initialization completes.
What happens:
- Started in:
/Users/fulvioventura/exc-to-pdf - Reset to:
/Users/fulvioventura/devstream PROJECT_ROOT="."now resolves to/Users/fulvioventura/devstream- Expected files (database, hooks, etc.) not found
- Functions silently fail or hang
Expected next steps (lines 706-722 in initialize_direct_db()):
initialize_project_claude_md # Line 706
initialize_project_memory_bootstrap # Line 709
initialize_enhanced_hook_copying # Line 713
initialize_context7_multi_project_setup # Line 718None of these execute - process hangs before any of them complete.
Location: Lines 1411-1591 Why it failed: Block occurs before this function is ever called. The function never runs.
Location: Lines 2335-2358 Why it failed:
- Attempts to maintain project directory in multi-project mode
- But
PROJECT_ROOT="."(relative) makes directory verification fail - And the working directory gets reset after this function completes
Location: Line 3175 Why it failed:
- Bypasses interactive prompts in
prompt_claude_md_update() - But blocking occurs before CLAUDE.md initialization is reached
- The hang is in an earlier function that never completes
1. Validate and normalize environment variable at entry point
Location: Lines 70-73 Current:
if [ -n "${DEVSTREAM_PROJECT_ROOT:-}" ]; then
PROJECT_ROOT="$DEVSTREAM_PROJECT_ROOT"Should be:
if [ -n "${DEVSTREAM_PROJECT_ROOT:-}" ]; then
# Validate it's an absolute path
if [[ "$DEVSTREAM_PROJECT_ROOT" != /* ]]; then
print_error "❌ DEVSTREAM_PROJECT_ROOT must be absolute path, got: $DEVSTREAM_PROJECT_ROOT"
exit 1
fi
# Normalize with realpath
PROJECT_ROOT="$(realpath "$DEVSTREAM_PROJECT_ROOT" 2>/dev/null)"
if [ ! -d "$PROJECT_ROOT" ]; then
print_error "❌ DEVSTREAM_PROJECT_ROOT directory not found: $DEVSTREAM_PROJECT_ROOT"
exit 1
fi2. Prevent working directory reset after venv initialization
Location: After line 703 (end of initialize_project_venv)
The "Shell cwd was reset" message suggests something in or after initialize_project_venv() is calling cd back to the launcher directory. Need to:
- Identify what's causing the reset
- Remove or condition it for multi-project mode
- Maintain project directory throughout execution
[INFO] Multi-project mode (explicit): /Users/fulvioventura/exc-to-pdf
[INFO] DevStream installation: /Users/fulvioventura/devstream
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 DevStream Project Detected
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project Name: exc-to-pdf
Location: /Users/fulvioventura/exc-to-pdf
Database: /Users/fulvioventura/exc-to-pdf/data/devstream.db (388K)
Python Venv: /Users/fulvioventura/exc-to-pdf/.devstream/
Python: Python 3.11.13
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
...
[INFO] Database path: /Users/fulvioventura/exc-to-pdf/data/devstream.db
...
[STATUS] ✅ DevStream framework environment is valid
[ NO "Shell cwd was reset" MESSAGE ]
[STATUS] 📝 Initializing project CLAUDE.md...
[INFO] ℹ️ CLAUDE.md update skipped by user
🔍 Pre-launch validation:
Launcher directory: /Users/fulvioventura/devstream
Project directory: /Users/fulvioventura/exc-to-pdf
Database path: /Users/fulvioventura/exc-to-pdf/data/devstream.db
[STATUS] ✅ Working directory set: /Users/fulvioventura/exc-to-pdf
🚀 Launching Claude Code with DevStream
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project: exc-to-pdf
Directory: /Users/fulvioventura/exc-to-pdf
Provider: anthropic
Database: /Users/fulvioventura/exc-to-pdf/data/devstream.db
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Starting Claude Code with Anthropic provider...
[ Claude Code launches successfully ]
- ✅ All paths are absolute (not relative)
- ✅ Project name shows
exc-to-pdf(not.) - ✅ No "Shell cwd was reset" message
- ✅ CLAUDE.md initialization runs and completes
- ✅ Pre-launch validation shows correct paths
- ✅ Claude Code launches without blocking
Problem: Launcher hangs in multi-project mode due to working directory reset after relative path contamination.
Root Causes:
- Environment contamination:
DEVSTREAM_PROJECT_ROOT="."set as relative path - No validation: Lines 70-73 accept relative path without validation
- Working directory reset: After line 703, directory changes from project to launcher
- Broken path resolution: Relative
"."resolves to wrong directory, functions fail
Evidence:
- Test output confirms relative paths throughout
- "Shell cwd was reset to /Users/fulvioventura/devstream" message appears
- Process hangs indefinitely after venv initialization
- Requires 2-part fix: path validation + prevent directory reset
Next Steps:
- Identify source of "Shell cwd was reset" (in or after
initialize_project_venv) - Implement path validation at lines 70-73
- Prevent working directory reset in multi-project mode
- Test with absolute path to verify fix works before addressing environment contamination source
Test completed: 2025-10-18 22:58 Timeout: 30 seconds (process killed) Processes cleaned up: Yes Ready for: Codex debugging with concrete evidence