Skip to content

Commit da26269

Browse files
Merge origin/main and resolve fcntl import conflicts
Resolves merge conflicts by implementing robust try/except ImportError pattern for fcntl import instead of platform-based detection. This addresses all reviewer feedback: - Uses try/except ImportError for robust cross-platform handling - Fixes unreachable warning code branch - Corrects misleading warning message (removes msvcrt reference) - Adds missing importlib.util import in test - Improves test robustness with try/finally pattern Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
2 parents 41a6878 + aaed51e commit da26269

503 files changed

Lines changed: 41460 additions & 10267 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# PraisonAI Environment Variables
2+
# Copy this file to .env and update with your actual values
3+
4+
# === Required ===
5+
OPENAI_API_KEY=sk-... # OpenAI key for LLM calls. Get yours at https://platform.openai.com
6+
7+
# === Required for Claw web-search tool ===
8+
TAVILY_API_KEY=tvly-... # Get yours at https://app.tavily.com (free tier available)
9+
10+
# === Optional: Claw dashboard security ===
11+
PRAISONAI_ALLOW_LOCAL_TOOLS=0 # Set to 1 to enable local shell tools (security risk)
12+
13+
# === Optional: Alternative LLM Providers ===
14+
ANTHROPIC_API_KEY=sk-ant-... # Anthropic Claude models
15+
GOOGLE_API_KEY=... # Google Gemini models
16+
GROQ_API_KEY=gsk_... # Groq (fast inference)
17+
COHERE_API_KEY=... # Cohere models
18+
AZURE_OPENAI_API_KEY=... # Azure OpenAI
19+
AZURE_OPENAI_ENDPOINT=... # Azure OpenAI endpoint
20+
21+
# === Optional: Memory backends ===
22+
MEM0_API_KEY=... # Mem0 memory service
23+
REDIS_URL=redis://localhost:6379 # Redis for state management
24+
25+
# === Optional: Observability ===
26+
LANGFUSE_SECRET_KEY=sk-lf-... # Langfuse tracing
27+
LANGFUSE_PUBLIC_KEY=pk-lf-... # Langfuse public key
28+
29+
# === Optional: Bot platforms ===
30+
TELEGRAM_BOT_TOKEN=... # Telegram bot token
31+
DISCORD_BOT_TOKEN=... # Discord bot token
32+
SLACK_BOT_TOKEN=xoxb-... # Slack bot token
33+
SLACK_APP_TOKEN=xapp-... # Slack app token
34+
WHATSAPP_ACCESS_TOKEN=... # WhatsApp bot access token
35+
WHATSAPP_PHONE_NUMBER_ID=... # WhatsApp phone number ID
36+
37+
# === Optional: Database ===
38+
DATABASE_URL=sqlite:///~/.praison/database.sqlite # Database connection string
39+
40+
# === Optional: Tool Security ===
41+
# ALLOWED_TOOLS=search,send_message # Whitelist specific tools to prevent name collisions
42+
# Useful in multi-environment setups with overlapping tool names
43+
# Leave unset to use all tools (with collision warnings)
44+
# Do NOT set to empty string: that's treated as configuration error
45+
# In CI, unknown tool names in the whitelist cause strict startup failure
46+
# HERMES_ONLY_TOOLS=search,send_message # (Deprecated) Backward compatibility alias for ALLOWED_TOOLS
47+
48+
# === Optional: Development ===
49+
LOGLEVEL=INFO # Logging level (DEBUG, INFO, WARNING, ERROR)
50+
CHAINLIT_AUTH_SECRET=... # Chainlit authentication secret
51+
DEBUG=false # Enable debug mode

.github/workflows/claude.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,15 @@ jobs:
181181

182182
- name: Fetch PR branch and Setup Remote
183183
if: github.event.issue.pull_request
184+
env:
185+
PR_BRANCH: ${{ steps.check_fork.outputs.pr_branch }}
186+
IS_FORK: ${{ steps.check_fork.outputs.is_fork }}
184187
run: |
185188
# Fetch PR head from base repo and put it into local branch
186-
git fetch origin pull/${{ github.event.issue.number }}/head:${{ steps.check_fork.outputs.pr_branch }}
189+
git fetch origin pull/${{ github.event.issue.number }}/head:"${PR_BRANCH}"
187190
188191
# If it's a fork, make origin point to local to trick claude-code-action's `git fetch origin <branch>`
189-
if [ "${{ steps.check_fork.outputs.is_fork }}" == "true" ]; then
192+
if [ "${IS_FORK}" = "true" ]; then
190193
git remote set-url origin file://$(pwd)
191194
fi
192195
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: Cross-Repo Integration Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'src/praisonai/praisonai/integration/**'
8+
- 'src/praisonai/tests/integration/test_aiui_*'
9+
- 'src/praisonai/pyproject.toml'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- 'src/praisonai/praisonai/integration/**'
14+
- 'src/praisonai/tests/integration/test_aiui_*'
15+
- 'src/praisonai/pyproject.toml'
16+
workflow_dispatch:
17+
18+
jobs:
19+
cross-repo-integration:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 30
22+
23+
steps:
24+
- name: Checkout PraisonAI
25+
uses: actions/checkout@v4
26+
with:
27+
path: PraisonAI
28+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
29+
30+
- name: Checkout PraisonAIUI
31+
uses: actions/checkout@v4
32+
with:
33+
repository: MervinPraison/PraisonAIUI
34+
path: PraisonAIUI
35+
ref: main
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v4
39+
with:
40+
python-version: '3.11'
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
# Install PraisonAI packages in development mode
46+
cd PraisonAI/src/praisonai-agents
47+
pip install -e .
48+
cd ../praisonai
49+
pip install -e ".[ui,dev]"
50+
# Install PraisonAIUI in development mode
51+
cd ../../../PraisonAIUI
52+
pip install -e .
53+
54+
- name: Verify versions
55+
run: |
56+
python -c "import praisonaiagents; print(f'praisonaiagents: {praisonaiagents.__version__}')"
57+
python -c "import praisonai; print(f'praisonai: {praisonai.__version__}')"
58+
python -c "import praisonaiui; print(f'praisonaiui: {praisonaiui.__version__}')"
59+
60+
- name: Run PraisonAI integration tests
61+
run: |
62+
cd PraisonAI/src/praisonai
63+
python -m pytest tests/integration/test_aiui_* -v --timeout=300
64+
65+
- name: Run PraisonAIUI integration tests
66+
run: |
67+
cd PraisonAIUI
68+
if [ -f tests/integration/test_agentic_roundtrip.py ]; then
69+
python -m pytest tests/integration/test_agentic_roundtrip.py -v --timeout=300
70+
fi
71+
if [ -f tests/test_feature_sdk_backends.py ]; then
72+
python -m pytest tests/test_feature_sdk_backends.py -v --timeout=300
73+
fi
74+
75+
- name: Test Pattern C CLI
76+
run: |
77+
cd PraisonAI/src/praisonai
78+
# Test that ui-gateway command exists
79+
python -m praisonai serve --help | grep ui-gateway
80+
81+
- name: Test public API exports
82+
run: |
83+
cd PraisonAI/src/praisonai
84+
python -c "from praisonai import run_integrated_gateway; print('✓ run_integrated_gateway imported')"
85+
python -c "from praisonai import configure_host; print('✓ configure_host imported')"
86+
87+
- name: Integration smoke test
88+
env:
89+
PRAISONAI_TEST_MODE: "1"
90+
PYTHONPATH: ${{ github.workspace }}/PraisonAI/src/praisonai:${{ github.workspace }}/PraisonAI/src/praisonai-agents:${{ github.workspace }}/PraisonAIUI
91+
run: |
92+
cd PraisonAI/src/praisonai
93+
python -c "
94+
import sys
95+
sys.path.insert(0, '.')
96+
from praisonai.integration.host_app import configure_host
97+
from praisonai import run_integrated_gateway
98+
print('✓ Integration imports successful')
99+
100+
# Test configure_host with new parameters
101+
try:
102+
configure_host(
103+
style='dashboard',
104+
context_paths=['AGENTS.md'],
105+
title='Test App'
106+
)
107+
print('✓ configure_host with new parameters works')
108+
except Exception as e:
109+
print(f'× configure_host failed: {e}')
110+
sys.exit(1)
111+
"
112+
113+
# Optional job with API key for agentic tests (if secret is available)
114+
agentic-integration:
115+
runs-on: ubuntu-latest
116+
timeout-minutes: 30
117+
if: ${{ vars.RUN_AGENTIC_TESTS == 'true' }}
118+
needs: cross-repo-integration
119+
120+
steps:
121+
- name: Checkout PraisonAI
122+
uses: actions/checkout@v4
123+
with:
124+
path: PraisonAI
125+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
126+
127+
- name: Checkout PraisonAIUI
128+
uses: actions/checkout@v4
129+
with:
130+
repository: MervinPraison/PraisonAIUI
131+
path: PraisonAIUI
132+
ref: main
133+
134+
- name: Set up Python
135+
uses: actions/setup-python@v4
136+
with:
137+
python-version: '3.11'
138+
139+
- name: Install dependencies
140+
run: |
141+
python -m pip install --upgrade pip
142+
cd PraisonAI/src/praisonai-agents
143+
pip install -e .
144+
cd ../praisonai
145+
pip install -e ".[ui,dev]"
146+
cd ../../../PraisonAIUI
147+
pip install -e .
148+
149+
- name: Run agentic integration test
150+
env:
151+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
152+
run: |
153+
cd PraisonAI/src/praisonai
154+
if [ -n "$OPENAI_API_KEY" ]; then
155+
python -m pytest tests/integration/test_aiui_host_agentic.py -v --timeout=600
156+
else
157+
echo "OPENAI_API_KEY not available, skipping agentic tests"
158+
fi

.github/workflows/praisonai-issue-triage.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ jobs:
2929
uses: actions/checkout@v4
3030
with:
3131
persist-credentials: false
32-
with:
33-
persist-credentials: false
34-
with:
3532
fetch-depth: 0
3633

3734
- name: Generate GitHub App Token
@@ -63,10 +60,12 @@ jobs:
6360
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
6461
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
6562
PRAISONAI_AUTO_APPROVE: "true"
63+
ISSUE_NUMBER_INPUT: ${{ inputs.issue_number }}
64+
ISSUE_NUMBER_EVENT: ${{ github.event.issue.number }}
6665
run: |
6766
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
68-
export ISSUE_NUMBER="${{ inputs.issue_number }}"
67+
export ISSUE_NUMBER="$ISSUE_NUMBER_INPUT"
6968
else
70-
export ISSUE_NUMBER="${{ github.event.issue.number }}"
69+
export ISSUE_NUMBER="$ISSUE_NUMBER_EVENT"
7170
fi
7271
praisonai github triage --issue $ISSUE_NUMBER --agent-file .github/praisonai-issue-triage.yaml

.github/workflows/praisonai-pr-review.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,23 @@ jobs:
3030
steps:
3131
- name: Determine checkout ref
3232
id: dest
33+
env:
34+
ISSUE_NUMBER: ${{ github.event.issue.number }}
35+
PR_NUMBER_INPUT: ${{ inputs.pr_number }}
36+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
3337
run: |
3438
if [ "${{ github.event_name }}" = "issue_comment" ]; then
35-
echo "ref=refs/pull/${{ github.event.issue.number }}/head" >> "$GITHUB_OUTPUT"
39+
echo "ref=refs/pull/$ISSUE_NUMBER/head" >> "$GITHUB_OUTPUT"
3640
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
37-
echo "ref=refs/pull/${{ inputs.pr_number }}/head" >> "$GITHUB_OUTPUT"
41+
echo "ref=refs/pull/$PR_NUMBER_INPUT/head" >> "$GITHUB_OUTPUT"
3842
else
39-
echo "ref=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
43+
echo "ref=$PR_HEAD_SHA" >> "$GITHUB_OUTPUT"
4044
fi
4145
4246
- name: Checkout Repository
4347
uses: actions/checkout@v4
4448
with:
4549
persist-credentials: false
46-
with:
47-
persist-credentials: false
48-
with:
4950
ref: ${{ steps.dest.outputs.ref }}
5051
fetch-depth: 0
5152

.github/workflows/test-windows.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626

2727
steps:
2828
- uses: actions/checkout@v4
29-
with:
30-
persist-credentials: false
29+
with:
30+
persist-credentials: false
3131
- name: Set up Python 3.11
3232
uses: actions/setup-python@v5
3333
with:
@@ -176,6 +176,18 @@ jobs:
176176
run: praisonai queue list
177177
continue-on-error: true
178178

179+
# ==================== PACKAGING TESTS ====================
180+
- name: Test packaging/daemon entry points
181+
run: |
182+
echo "Testing both entry point methods..."
183+
python -m praisonai --version
184+
praisonai --version
185+
186+
- name: Test doctor packaging command
187+
run: |
188+
echo "Testing doctor packaging diagnostics..."
189+
praisonai doctor packaging --json
190+
179191
# ==================== REAL API TESTS ====================
180192
- name: Real API test - Agent run
181193
if: env.OPENAI_API_KEY != ''

MIGRATION_NOTES.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)