-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: integration follow-up - Pattern C CLI, L3 pages, aiui 0.3.121, cross-repo CI #1718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f196e9b
4cc0323
28ea77d
20fbca7
6d788fc
b0869ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,158 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Cross-Repo Integration Tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'src/praisonai/praisonai/integration/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'src/praisonai/tests/integration/test_aiui_*' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'src/praisonai/pyproject.toml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'src/praisonai/praisonai/integration/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'src/praisonai/tests/integration/test_aiui_*' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'src/praisonai/pyproject.toml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path filters currently skip CI when this workflow/docs change. As written, updates to Suggested trigger additions push:
branches: [ main ]
paths:
+ - '.github/workflows/integration-cross-repo.yml'
+ - 'RELEASE_INTEGRATION.md'
- 'src/praisonai/praisonai/integration/**'
- 'src/praisonai/tests/integration/test_aiui_*'
- 'src/praisonai/pyproject.toml'
pull_request:
branches: [ main ]
paths:
+ - '.github/workflows/integration-cross-repo.yml'
+ - 'RELEASE_INTEGRATION.md'
- 'src/praisonai/praisonai/integration/**'
- 'src/praisonai/tests/integration/test_aiui_*'
- 'src/praisonai/pyproject.toml'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cross-repo-integration: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout PraisonAI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/integration-cross-repo.yml"
echo "== file =="; wc -l "$FILE"
echo "== relevant uses: lines =="; rg -n "uses:\s*actions/(checkout|setup-python)@" "$FILE" || true
echo "== setup-python uses =="; rg -n "uses:\s*actions/setup-python@" "$FILE" || true
echo "== checkout uses =="; rg -n "uses:\s*actions/checkout@" "$FILE" || true
echo "== full workflow (for context, limited) =="; sed -n '1,220p' "$FILE"Repository: MervinPraison/PraisonAI Length of output: 5996 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE=".github/workflows/integration-cross-repo.yml"
echo "== permissions blocks =="; rg -n '^\s*permissions:' "$FILE" || true
echo "== persist-credentials settings =="; rg -n 'persist-credentials' "$FILE" || true
echo "== uses actions/checkout/setup-python with context (near matches) =="; rg -n -C 2 'uses:\s*actions/(checkout|setup-python)@' "$FILE"Repository: MervinPraison/PraisonAI Length of output: 1202 🌐 Web query:
💡 Result: As of May 2026, actions/setup-python has progressed to version v6 (specifically v6.2.0 as of January 2026) [1][2]. While you asked about guidance for v5, it is important to note that v5 is no longer the latest major version [1][2]. General guidance for using actions/setup-python includes: 1. Use the Latest Stable Major Version: It is recommended to use the latest major version (currently v6) to benefit from the latest features, dependency updates (e.g., node24 compatibility), and security improvements [1][2]. 2. Pinning and Security: For production environments and to protect against supply chain attacks, best practices suggest pinning actions to a specific full commit SHA rather than relying solely on tags like Citations:
🌐 Web query:
💡 Result: The input persist-credentials for the GitHub Action actions/checkout has a default value of true. [1] Evidence (official docs): the action.yml input definition for persist-credentials shows Citations:
Pin GitHub Actions to commit SHAs and upgrade In 🧰 Tools🪛 zizmor (1.25.2)[error] 25-25: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: PraisonAI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+24
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disable checkout credential persistence. Each checkout step should set Also applies to: 29-35, 37-43, 129-132, 134-139 🧰 Tools🪛 zizmor (1.25.2)[warning] 24-27: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 25-25: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repository: MervinPraison/PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: '3.11' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install PraisonAI packages in development mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAI/src/praisonai-agents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd ../praisonai | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -e ".[ui,dev]" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install PraisonAIUI in development mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd ../../../PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Verify versions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -c "import praisonaiagents; print(f'praisonaiagents: {praisonaiagents.__version__}')" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -c "import praisonai; print(f'praisonai: {praisonai.__version__}')" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -c "import praisonaiui; print(f'praisonaiui: {praisonaiui.__version__}')" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run PraisonAI integration tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAI/src/praisonai | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pytest tests/integration/test_aiui_* -v --timeout=300 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run PraisonAIUI integration tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -f tests/integration/test_agentic_roundtrip.py ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pytest tests/integration/test_agentic_roundtrip.py -v --timeout=300 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -f tests/test_feature_sdk_backends.py ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pytest tests/test_feature_sdk_backends.py -v --timeout=300 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Test Pattern C CLI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAI/src/praisonai | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Test that ui-gateway command exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m praisonai serve --help | grep ui-gateway | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Test public API exports | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAI/src/praisonai | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -c "from praisonai import run_integrated_gateway; print('✓ run_integrated_gateway imported')" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -c "from praisonai import configure_host; print('✓ configure_host imported')" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Integration smoke test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PRAISONAI_TEST_MODE: "1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PYTHONPATH: ${{ github.workspace }}/PraisonAI/src/praisonai:${{ github.workspace }}/PraisonAI/src/praisonai-agents:${{ github.workspace }}/PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAI/src/praisonai | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -c " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.path.insert(0, '.') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonai.integration.host_app import configure_host | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonai import run_integrated_gateway | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print('✓ Integration imports successful') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Test configure_host with new parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| configure_host( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| style='dashboard', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| context_paths=['AGENTS.md'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title='Test App' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print('✓ configure_host with new parameters works') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| except Exception as e: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print(f'× configure_host failed: {e}') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.exit(1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Optional job with API key for agentic tests (if secret is available) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agentic-integration: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ vars.RUN_AGENTIC_TESTS == 'true' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: cross-repo-integration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout PraisonAI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: PraisonAI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repository: MervinPraison/PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ref: main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: '3.11' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAI/src/praisonai-agents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd ../praisonai | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -e ".[ui,dev]" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd ../../../PraisonAIUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run agentic integration test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd PraisonAI/src/praisonai | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$OPENAI_API_KEY" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pytest tests/integration/test_aiui_host_agentic.py -v --timeout=600 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "OPENAI_API_KEY not available, skipping agentic tests" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,6 +113,7 @@ def serve_callback(ctx: typer.Context): | |
| [bold]Server Types:[/bold] | ||
| [green]agents[/green] HTTP REST API for agents (port 8000) | ||
| [green]gateway[/green] WebSocket multi-agent coordination (port 8765) | ||
| [green]ui-gateway[/green] Integrated UI-Gateway (Pattern C) (port 8765) | ||
| [green]mcp[/green] MCP server for Claude/Cursor (port 8080) | ||
| [green]acp[/green] Agent Client Protocol for IDEs (STDIO) | ||
| [green]lsp[/green] Language Server Protocol (STDIO) | ||
|
|
@@ -369,6 +370,42 @@ def serve_ui( | |
| raise typer.Exit(4) | ||
|
|
||
|
|
||
| @app.command("ui-gateway") | ||
| def serve_ui_gateway( | ||
| host: str = typer.Option("127.0.0.1", "--host", "-h", help="Host to bind to"), | ||
| port: int = typer.Option(8765, "--port", "-p", help="Port to bind to"), | ||
| title: str = typer.Option("PraisonAI", "--title", "-t", help="Application title"), | ||
| style: str = typer.Option("dashboard", "--style", "-s", help="UI style: dashboard, chat"), | ||
| agents_file: Optional[str] = typer.Option(None, "--agents", "-a", help="Agents YAML file"), | ||
| ): | ||
| """Start integrated UI-Gateway (Pattern C) - aiui with backend bridges. | ||
|
|
||
| Combines PraisonAI host integration with AIUIGateway for unified dashboard + chat. | ||
|
|
||
| Examples: | ||
| praisonai serve ui-gateway | ||
| praisonai serve ui-gateway --style chat --port 8765 | ||
| praisonai serve ui-gateway --agents agents.yaml --title "My App" | ||
| """ | ||
| output = get_output_controller() | ||
|
|
||
| try: | ||
| from ...integration.gateway_host import run_integrated_gateway | ||
| run_integrated_gateway( | ||
| host=host, | ||
| port=port, | ||
| title=title, | ||
| style=style | ||
| ) | ||
|
Comment on lines
+394
to
+399
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
coderabbitai[bot] marked this conversation as resolved.
greptile-apps[bot] marked this conversation as resolved.
|
||
| except ImportError as e: | ||
| output.print_error(f"UI-Gateway module not available: {e}") | ||
| output.print("Install with: pip install praisonai[ui]") | ||
| raise typer.Exit(4) | ||
| except Exception as e: | ||
| output.print_error(f"Failed to start UI-Gateway: {e}") | ||
| raise typer.Exit(1) | ||
|
|
||
|
|
||
| @app.command("rag") | ||
| def serve_rag( | ||
| host: str = typer.Option("127.0.0.1", "--host", "-h", help="Host to bind to"), | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,6 +33,9 @@ def configure_host( | |||||||||||||||||||||||||||
| agent_kwargs: Optional[Dict[str, Any]] = None, | ||||||||||||||||||||||||||||
| gateway: Any = None, | ||||||||||||||||||||||||||||
| modules: Optional[Sequence[str]] = None, | ||||||||||||||||||||||||||||
| style: str = "dashboard", | ||||||||||||||||||||||||||||
| context_paths: Optional[Sequence[str]] = None, | ||||||||||||||||||||||||||||
| **kwargs: Any, | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At Line 82, reassignment drops the function-level Minimal fix to preserve both call paths- **kwargs: Any,
+ **kwargs: Any,
) -> None:
@@
- kwargs = dict(agent_kwargs or {})
+ provider_kwargs = dict(kwargs)
+ if agent_kwargs:
+ provider_kwargs.update(agent_kwargs)
if agents:
- set_provider(PraisonAIProvider(agents=list(agents), **kwargs))
+ set_provider(PraisonAIProvider(agents=list(agents), **provider_kwargs))
else:
# Load context files if specified
- instructions = kwargs.pop("instructions", "You are a helpful assistant.")
+ instructions = provider_kwargs.pop("instructions", "You are a helpful assistant.")
@@
PraisonAIProvider(
- name=kwargs.pop("name", "PraisonAI"),
+ name=provider_kwargs.pop("name", "PraisonAI"),
instructions=instructions,
- llm=kwargs.pop(
+ llm=provider_kwargs.pop(
"llm", os.getenv("PRAISONAI_MODEL", "gpt-4o-mini")
),
- **kwargs,
+ **provider_kwargs,
)
)Also applies to: 82-105 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| ) -> None: | ||||||||||||||||||||||||||||
|
Comment on lines
33
to
39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding
Suggested change
|
||||||||||||||||||||||||||||
| """Apply PraisonAIUI host settings and wire L1 backends (unless legacy mode).""" | ||||||||||||||||||||||||||||
| global _CONFIGURED | ||||||||||||||||||||||||||||
|
|
@@ -41,7 +44,7 @@ def configure_host( | |||||||||||||||||||||||||||
| from praisonai.ui._aiui_datastore import PraisonAISessionDataStore | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| aiui.set_datastore(PraisonAISessionDataStore()) | ||||||||||||||||||||||||||||
| aiui.set_style("dashboard") | ||||||||||||||||||||||||||||
| aiui.set_style(style) | ||||||||||||||||||||||||||||
| aiui.set_branding(title=title, logo=logo) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if pages is not None: | ||||||||||||||||||||||||||||
|
|
@@ -80,13 +83,21 @@ def configure_host( | |||||||||||||||||||||||||||
| if agents: | ||||||||||||||||||||||||||||
| set_provider(PraisonAIProvider(agents=list(agents), **kwargs)) | ||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||
| # Load context files if specified | ||||||||||||||||||||||||||||
| instructions = kwargs.pop("instructions", "You are a helpful assistant.") | ||||||||||||||||||||||||||||
| if context_paths: | ||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||
| from praisonai.integration.context_files import load_context_files | ||||||||||||||||||||||||||||
| context = load_context_files(list(context_paths)) | ||||||||||||||||||||||||||||
| if context: | ||||||||||||||||||||||||||||
| instructions = f"{instructions}\n\nContext:\n{context}" | ||||||||||||||||||||||||||||
| except ImportError: | ||||||||||||||||||||||||||||
| pass # Context files helper is optional | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| set_provider( | ||||||||||||||||||||||||||||
| PraisonAIProvider( | ||||||||||||||||||||||||||||
| name=kwargs.pop("name", "PraisonAI"), | ||||||||||||||||||||||||||||
| instructions=kwargs.pop( | ||||||||||||||||||||||||||||
| "instructions", | ||||||||||||||||||||||||||||
| "You are a helpful assistant.", | ||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||
| instructions=instructions, | ||||||||||||||||||||||||||||
| llm=kwargs.pop( | ||||||||||||||||||||||||||||
| "llm", os.getenv("PRAISONAI_MODEL", "gpt-4o-mini") | ||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||
|
|
@@ -95,6 +106,12 @@ def configure_host( | |||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
| setup_bridges() | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Register L3 dashboard pages | ||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||
| from praisonai.integration.pages import workflow_runs, bot_health | ||||||||||||||||||||||||||||
| except ImportError: | ||||||||||||||||||||||||||||
| pass # L3 pages are optional | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| _CONFIGURED = True | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
@@ -109,15 +126,19 @@ def setup_bridges() -> None: | |||||||||||||||||||||||||||
| from praisonai.integration.bridges.usage_bridge import register_usage_sink | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| sink = register_usage_sink() | ||||||||||||||||||||||||||||
| except Exception as exc: | ||||||||||||||||||||||||||||
| except ImportError as exc: | ||||||||||||||||||||||||||||
| log.debug("usage bridge unavailable: %s", exc) | ||||||||||||||||||||||||||||
| except Exception as exc: | ||||||||||||||||||||||||||||
| log.warning("usage bridge unavailable: %s", exc) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||
| from praisonai.integration.bridges.schedules_runner import ensure_schedule_runner | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ensure_schedule_runner() | ||||||||||||||||||||||||||||
| except Exception as exc: | ||||||||||||||||||||||||||||
| except ImportError as exc: | ||||||||||||||||||||||||||||
| log.debug("schedule runner unavailable: %s", exc) | ||||||||||||||||||||||||||||
| except Exception as exc: | ||||||||||||||||||||||||||||
| log.warning("schedule runner unavailable: %s", exc) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||
| import praisonaiui.backends as backends | ||||||||||||||||||||||||||||
|
|
@@ -144,8 +165,10 @@ def _workflow_backend(wf_id, *, workflow, input_data): | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| backends.set_backend("approvals_pending", list_pending_approvals) | ||||||||||||||||||||||||||||
| backends.set_backend("approvals_policies", get_approval_policies) | ||||||||||||||||||||||||||||
| except Exception as exc: | ||||||||||||||||||||||||||||
| except ImportError as exc: | ||||||||||||||||||||||||||||
| log.debug("aiui backend injection failed: %s", exc) | ||||||||||||||||||||||||||||
| except Exception as exc: | ||||||||||||||||||||||||||||
| log.warning("aiui backend injection failed: %s", exc) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| def create_host_app(): | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| """Optional L3 dashboard pages for PraisonAI integration.""" | ||
|
|
||
| # Import pages to register them with aiui | ||
| try: | ||
| from . import workflow_runs, bot_health | ||
| except ImportError: | ||
| # Pages are optional and may not be available if aiui is not installed | ||
| pass | ||
|
Comment on lines
+1
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add least-privilege workflow/job permissions.
There is no
permissions:block, so this runs with default token permissions. Please explicitly set minimal permissions (contents: read) at workflow level and only elevate per-job if needed.Also applies to: 18-19, 122-123
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 1-165: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents