import subprocess
import json
import sys
import os
def test_simple_codex_call():
print("๐ง ๆต่ฏCODEX็ฎๅ่ฐ็จ...")
print("=" * 50)
simple_request = "Generate a simple JavaScript function that adds two numbers"
cmd = [
sys.executable, "real_mcp_client_test.py"
]
env = os.environ.copy()
env['TEST_REQUEST'] = simple_request
env['TEST_MODE'] = 'simple'
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=30,
env=env
)
print(f"โ
Exit code: {result.returncode}")
if result.stdout:
print(f"๐ Output length: {len(result.stdout)} chars")
orchestration_indicators = [
"workflow(",
"async function",
"mcp.call",
"JavaScript",
"function"
]
found_indicators = [ind for ind in orchestration_indicators if ind in result.stdout]
if found_indicators:
print(f"๐ฏ Found LLM orchestration indicators: {found_indicators}")
print("โ
LLM Orchestration: SUCCESS")
return True
else:
print("โ ๏ธ No LLM orchestration indicators found")
print("โ
LLM Orchestration: NOT TRIGGERED (using vector mode)")
return False
else:
print("โ No output received")
return False
except subprocess.TimeoutExpired:
print("โฑ๏ธ Test timed out (30s)")
return False
except Exception as e:
print(f"โ Test failed with error: {e}")
return False
if __name__ == "__main__":
success = test_simple_codex_call()
if success:
print("\n๐ CODEX integration test PASSED")
sys.exit(0)
else:
print("\n๐งช CODEX integration test completed (no orchestration)")
sys.exit(0)