Skip to content

Latest commit

 

History

History
283 lines (215 loc) · 10.1 KB

TEST-RESULTS-2025-10-18.md

File metadata and controls

283 lines (215 loc) · 10.1 KB

Test Results: Launcher Blocking Issue

Date: 2025-10-18 22:58 Test: Multi-project launcher execution Status: ✅ BLOCKING CONFIRMED - Root Cause Identified


🎯 Critical Finding

The launcher blocks because of a working directory reset that breaks relative path resolution.

Smoking Gun Evidence

[STATUS] ✅ DevStream framework environment is valid
Shell cwd was reset to /Users/fulvioventura/devstream

What happens:

  1. Launcher starts in /Users/fulvioventura/exc-to-pdf (project directory)
  2. initialize_project_venv() completes successfully (line 703)
  3. Working directory gets reset to /Users/fulvioventura/devstream (launcher directory)
  4. Subsequent functions try to work with PROJECT_ROOT="." (relative path)
  5. Since we're now in the wrong directory, "." resolves to /Users/fulvioventura/devstream instead of /Users/fulvioventura/exc-to-pdf
  6. Functions silently fail or hang because they can't find expected files/directories

📊 Test Execution Output

Command

cd /Users/fulvioventura/exc-to-pdf && \
  /Users/fulvioventura/devstream/start-devstream2.sh start anthropic

Critical Output Sequence

[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.


🔍 Root Cause Chain

1. Environment Contamination (CONFIRMED)

$ env | grep DEVSTREAM_PROJECT_ROOT
DEVSTREAM_PROJECT_ROOT=.

Source: Pre-existing environment variable set to relative path "." instead of absolute path.

2. Blind Trust in Priority Detection (CONFIRMED)

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.

3. Relative Path Propagation (CONFIRMED)

All output shows relative paths:

  • Project Name: .
  • Location: .
  • Database: data/devstream.db (relative)
  • Python Venv: .devstream/ (relative)

4. Working Directory Reset (NEW - SMOKING GUN)

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

5. Silent Failure in Subsequent Functions (CONFIRMED)

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 718

None of these execute - process hangs before any of them complete.


💡 Why Previous Fixes Failed

Fix 1: start_claude_with_devstream() validation

Location: Lines 1411-1591 Why it failed: Block occurs before this function is ever called. The function never runs.

Fix 2: initialize_project_venv() directory management

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

Fix 3: Auto-confirm CLAUDE.md prompts

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

🔧 Root Cause Solution (Theory)

The Fix Must Address Two Issues:

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
    fi

2. 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

🧪 Verification Test (After Fix)

Expected Output After Fix:

[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 ]

Key Success Indicators:

  • ✅ 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

📝 Summary for Codex

Problem: Launcher hangs in multi-project mode due to working directory reset after relative path contamination.

Root Causes:

  1. Environment contamination: DEVSTREAM_PROJECT_ROOT="." set as relative path
  2. No validation: Lines 70-73 accept relative path without validation
  3. Working directory reset: After line 703, directory changes from project to launcher
  4. 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:

  1. Identify source of "Shell cwd was reset" (in or after initialize_project_venv)
  2. Implement path validation at lines 70-73
  3. Prevent working directory reset in multi-project mode
  4. 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