@@ -115,33 +115,33 @@ start_agent() {
115115 # Change to tutorial directory
116116 cd " $tutorial_path " || return 1
117117
118- # Debug current directory and virtualenv status
119- echo -e " ${YELLOW} DEBUG: Current directory: $PWD ${NC} "
120- echo -e " ${YELLOW} DEBUG: Tutorial path: $tutorial_path ${NC} "
121-
122- # Check if .venv exists
123- echo -e " ${YELLOW} DEBUG: Tutorial .venv contents:${NC} "
124- if [ -d " .venv" ]; then
125- ls -la .venv/ || echo " Cannot list .venv contents"
126- else
127- echo " No .venv directory found"
128- fi
129-
130- # Check what packages are available in rye context
131- echo -e " ${YELLOW} DEBUG: Available packages in tutorial rye context:${NC} "
132- rye run pip list 2> /dev/null || echo " Cannot list packages"
118+ # Start the agent in background and capture PID
119+ local manifest_path=" $PWD /manifest.yaml" # Always use full path
133120
134- # Specifically check for agentex-sdk
135- echo -e " ${YELLOW} DEBUG: Checking for agentex-sdk:${NC} "
136- rye run pip show agentex-sdk 2> /dev/null || echo " agentex-sdk not found in virtualenv"
121+ echo -e " ${YELLOW} DEBUG: Manifest path: $manifest_path ${NC} "
122+ echo -e " ${YELLOW} DEBUG: Log file: $logfile ${NC} "
137123
138- # Show rye project status
139- echo -e " ${YELLOW} DEBUG: Rye show output:${NC} "
140- rye show 2> /dev/null || echo " No rye project detected"
124+ if [ " $BUILD_CLI " = true ]; then
125+ echo -e " ${YELLOW} DEBUG: Using locally built wheel${NC} "
126+
127+ # From tutorial subdirectory, we need to go up 4 levels to reach repo root
128+ # tutorials/00_sync/000_hello_acp -> tutorials -> examples -> agentex-python
129+ local wheel_file=$( ls ../../../../dist/agentex_sdk-* .whl 2> /dev/null | head -n1)
130+ if [[ -z " $wheel_file " ]]; then
131+ echo -e " ${RED} ❌ No built wheel found in ../../../../dist/agentex_sdk-*.whl${NC} "
132+ echo -e " ${YELLOW} 💡 Please build the local SDK first by running: uv build${NC} "
133+ echo -e " ${YELLOW} 💡 From the repo root directory: /Users/roxanne.farhad/Desktop/scale/agentex-python${NC} "
134+ cd " $original_dir "
135+ return 1
136+ fi
141137
142- # Start the agent in background and capture PID
143- local agentex_cmd=$( get_agentex_command)
144- $agentex_cmd agents run --manifest manifest.yaml > " $logfile " 2>&1 &
138+ echo -e " ${YELLOW} DEBUG: Using wheel: $wheel_file ${NC} "
139+ # Use the built wheel
140+ uv run --with " $wheel_file " agentex agents run --manifest " $manifest_path " > " $logfile " 2>&1 &
141+ else
142+ echo -e " ${YELLOW} DEBUG: Using system CLI${NC} "
143+ uv run agentex agents run --manifest manifest.yaml > " $logfile " 2>&1 &
144+ fi
145145 local pid=$!
146146
147147 # Return to original directory
@@ -311,9 +311,9 @@ execute_tutorial_test() {
311311 fi
312312}
313313
314- # Function to build CLI from source
315- build_cli () {
316- echo -e " ${YELLOW} 🔨 Building CLI from source ...${NC} "
314+ # Function to check if built wheel is available
315+ check_built_wheel () {
316+ echo -e " ${YELLOW} 🔍 Checking for locally built wheel ...${NC} "
317317
318318 # Navigate to the repo root (two levels up from examples/tutorials)
319319 local repo_root=" ../../"
@@ -324,44 +324,31 @@ build_cli() {
324324 return 1
325325 }
326326
327- # Check if rye is available
328- if ! command -v rye & > /dev/null; then
329- echo -e " ${RED} ❌ rye is required to build the CLI${NC} "
330- echo " Please install rye: curl -sSf https://rye.astral.sh/get | bash"
327+ # Check if wheel exists
328+ local wheel_file=$( ls dist/agentex_sdk-* .whl 2> /dev/null | head -n1)
329+ if [[ -z " $wheel_file " ]]; then
330+ echo -e " ${RED} ❌ No built wheel found in dist/agentex_sdk-*.whl${NC} "
331+ echo -e " ${YELLOW} 💡 Please build the local SDK first by running: uv build${NC} "
332+ echo -e " ${YELLOW} 💡 From the repo root directory: $( pwd) ${NC} "
331333 cd " $original_dir "
332334 return 1
333335 fi
334336
335- # Build the CLI
336- echo -e " ${YELLOW} Running rye sync --all-features...${NC} "
337- if ! rye sync --all-features; then
338- echo -e " ${RED} ❌ Failed to sync dependencies${NC} "
339- cd " $original_dir "
340- return 1
341- fi
337+ echo -e " ${GREEN} ✅ Found built wheel: $wheel_file ${NC} "
342338
343- echo -e " ${YELLOW} Running rye build...${NC} "
344- if ! rye build; then
345- echo -e " ${RED} ❌ Failed to build package${NC} "
339+ # Test the wheel by running agentex --help
340+ echo -e " ${YELLOW} Verifying built wheel...${NC} "
341+ if ! uv run --with " $wheel_file " agentex --help > /dev/null 2>&1 ; then
342+ echo -e " ${RED} ❌ Failed to run agentex with built wheel${NC} "
346343 cd " $original_dir "
347344 return 1
348345 fi
349346
350- echo -e " ${GREEN} ✅ CLI built successfully${NC} "
347+ echo -e " ${GREEN} ✅ Built wheel verified successfully${NC} "
351348 cd " $original_dir "
352349 return 0
353350}
354351
355- # Function to get the appropriate agentex command
356- get_agentex_command () {
357- if [ " $BUILD_CLI " = true ]; then
358- # Use the local build via rye run (rye is in PATH)
359- echo " rye run agentex"
360- else
361- # Use the system-installed version
362- echo " uv run agentex"
363- fi
364- }
365352
366353# Main execution function
367354main () {
@@ -401,10 +388,10 @@ main() {
401388
402389 echo " "
403390
404- # Build CLI if requested
391+ # Check built wheel if requested
405392 if [ " $BUILD_CLI " = true ]; then
406- if ! build_cli ; then
407- echo -e " ${RED} ❌ Failed to build CLI from source ${NC} "
393+ if ! check_built_wheel ; then
394+ echo -e " ${RED} ❌ Failed to find or verify built wheel ${NC} "
408395 exit 1
409396 fi
410397 echo " "
0 commit comments