mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 04:24:06 -04:00
[PR #185] [MERGED] Multi-Provider Expansion & Testing Infrastructure #221
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/185
Author: @asdek
Created: 3/9/2026
Status: ✅ Merged
Merged: 3/9/2026
Merged by: @asdek
Base:
master← Head:feature/next_release📝 Commits (10+)
c68f933fix: treat screenshot failure as non-critical in browser tool5720402fix: propagate container lookup error in GetTool for terminal/file toolse36f47ffix: prevent http.DefaultClient mutation in search toolsc716ec6test: remove unused test server and dead imports in search tool testsddd0b0etest: add unit tests for perplexity and google search toolsc538b80test: address review feedback on search tool tests539f6c2feat: add CN LLM providers (DeepSeek, GLM, Kimi, Qwen) with bug fixes8354f7echore(deps): bump rollupf4da45echore(deps): bump go.opentelemetry.io/otel/sdk1c3f149feat: add Novita AI as optional LLM provider📊 Changes
122 files changed (+19200 additions, -3653 deletions)
View changed files
📝
.env.example(+31 -2)📝
.gitignore(+9 -0)📝
.vscode/launch.json(+12 -0)📝
.vscode/settings.json(+1 -0)➕
CLAUDE.md(+150 -0)📝
Dockerfile(+4 -1)📝
README.md(+848 -151)📝
backend/cmd/ctester/main.go(+50 -3)📝
backend/cmd/ftester/main.go(+1 -1)📝
backend/cmd/ftester/worker/executor.go(+15 -32)📝
backend/cmd/installer/wizard/controller/controller.go(+189 -12)📝
backend/cmd/installer/wizard/locale/locale.go(+231 -66)📝
backend/cmd/installer/wizard/models/llm_provider_form.go(+133 -9)📝
backend/cmd/installer/wizard/models/llm_providers.go(+4 -0)📝
backend/cmd/installer/wizard/models/search_engines_form.go(+50 -0)📝
backend/cmd/installer/wizard/models/types.go(+8 -0)📝
backend/cmd/installer/wizard/registry/registry.go(+4 -0)📝
backend/docs/config.md(+295 -23)📝
backend/docs/database.md(+2 -2)📝
backend/docs/flow_execution.md(+4 -0)...and 80 more files
📄 Description
Description
Problem
PentAGI's custom provider architecture only supported a single OpenAI-compatible endpoint at a time, preventing users from simultaneously configuring multiple cloud services. Users had to choose one custom provider at startup and couldn't switch between different LLM services (DeepSeek, GLM, Kimi, Qwen) through the UI. AWS Bedrock authentication was inflexible, forcing users into a single credential model. The codebase had insufficient test coverage for critical tool components, multiple security vulnerabilities in resource management, and several quality issues affecting production stability.
Solution
This preparation release consolidates 27 commits across 14 merged pull requests, delivering:
.gitignorepatternsCloses #166, #167, #168, #170, #171, #172
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
go test ./...) - 100% pass rateTest Results
args_test.go: Bool/Int64 custom JSON unmarshalling (20+ test cases)context_test.go: Agent context chaining and isolationregistry_test.go: Tool type mapping and completeness validationexecutor_test.go: Custom executor tool definitions and executionterminal_test.go: Terminal formatting and name generationgoogle_test.go: Google Search service creation and parsingperplexity_test.go: Perplexity API error handling and formattingSecurity Considerations
Fixes Implemented:
Certificate Authority Key Management (PR #168)
service_ca.key) deleted immediately after signing server certificateResource Leak Prevention (PRs #150, #167, #168)
Bedrock Runtime Safety (PR #166)
toolConfigis undefinedProvider Authentication Security
No New Vulnerabilities Introduced:
.gitignoreexpansion prevents accidental IDE/OS file commitsPerformance Impact
Improvements:
t.Parallel()in new test files enables concurrent test executionhttp.DefaultClient(eliminates race conditions)No Degradation:
Resource Usage:
Documentation Updates
.env.exampleanddocker-compose.ymlnovita.provider.ymlcustom provider example for Novita AI aggregator.gitignorewith IDE/OS patternsDeployment Notes
New Environment Variables (Optional):
Database Migrations:
20260301_add_chinese_llm_providers.sql- Addsdeepseek,glm,kimi,qwentoPROVIDER_TYPEenumBreaking Changes:
Compatibility:
Upgrade Steps:
.envdocker compose up -d- migrations apply automaticallyChecklist
Code Quality
go fmtandgo vet(for Go code)npm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
Additional Notes
Key Changes by Category
🚀 New LLM Providers (PR #154)
Chinese Cloud Service Providers - First-class provider support enabling simultaneous multi-service configuration:
Key Improvement: Previously, users could only configure ONE custom OpenAI-compatible provider at a time, requiring application restart to switch between Chinese cloud services. Now all four providers can be enabled simultaneously with individual API keys, and users can instantly switch between them through the Settings UI.
Implementation Highlights:
ProviderType.Valid()to prevent 422 Unprocessable Entity errorsCustom Provider Example (PR #162) - Added
novita.provider.ymlconfiguration example:novita-report.md) with performance validationmoonshotai/kimi-k2.5Contributor: @niuqun2003 (DeepSeek/GLM/Kimi/Qwen native providers), @Alex-wuhu (Novita custom provider example)
🔐 AWS Bedrock Authentication Enhancement
Multiple Authentication Methods - Flexible credential management for diverse deployment scenarios:
AWS SDK Default Chain (
BEDROCK_DEFAULT_AUTH=true)AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)~/.aws/credentials)Bearer Token (
BEDROCK_BEARER_TOKEN=...)Static Credentials (existing)
BEDROCK_AWS_ACCESS_KEY_ID+BEDROCK_AWS_SECRET_ACCESS_KEYPriority Order: Default Chain → Bearer Token → Static Credentials
Benefits:
Contributor: @asdek
🧪 Testing Infrastructure Expansion
15+ New Unit Test Files - Comprehensive coverage for previously untested components:
Tool Registry & Context (PR #171):
context_test.go: Agent context chaining, parent/current promotion, isolation verificationregistry_test.go: Tool type mapping completeness, enum string representation, mutation safetyCustom JSON Types (PR #170):
args_test.go: Bool/Int64 unmarshalling from bare values, quoted strings, single quotes, whitespace trimming, overflow/underflow boundaries, nil safetyExecutor & Terminal (PR #172):
executor_test.go: Custom executor tool definitions, execution behavior, unknown tool handlingterminal_test.go: Terminal name generation, ANSI formatting, input/output colorizationSearch Tools (PR #153):
google_test.go: Service creation, proxy configuration, result parsing, special character handlingperplexity_test.go: API key validation, error response handling (10 HTTP codes), citation formattingTest Quality Features:
t.Parallel()for concurrent execution (faster CI/CD)context.Background()/t.Context()consistency across test filesContributors: @mason5052 (primary author of all test infrastructure)
🛡️ Security Fixes
Certificate Authority Key Cleanup (PR #168):
service_ca.key,service.csr,service_ca.srlimmediately after signingResource Leak Prevention:
Browser Screenshot Failure (PR #150)
Terminal Tar Operations (PR #168)
io.Copy(prevents OOM attacks)HTTP Client Mutation (PR #151)
http.DefaultClient.Transportmutated when setting proxy in Tavily/Traversaalhttp.Clientinstance for proxied requestsBedrock Runtime Safety (PR #166):
toolConfigbefore dereferencing in langchaingo integrationContributors: @mason5052 (resource leaks, HTTP client), @Priyanka-2725 (Bedrock nil safety)
🐛 Bug Fixes
Proxy Configuration (PR #167):
newSearchService()ignored constructedoptsslice (proxy had no effect)opts...toNewService()call instead of hardcodedoption.WithAPIKey()Terminal Output (PR #164):
Container Lookup Error (PR #152):
GetToolsilently ignoredGetFlowPrimaryContainererrorsVS Code Settings (PR #163):
.gitignorewith IDE patterns (.vscode/settings.json,.idea/,*.swp) and OS files (Thumbs.db)Frontend Debug Cleanup (PR #141):
console.log()statements from production codeContributors: @mason5052 (proxy, container, frontend cleanup), @haosenwang1018 (gitignore)
📦 Dependency Updates
OpenTelemetry SDK (PR #161):
go.opentelemetry.io/otel/sdk: 1.36.0 → 1.40.0Rollup (PR #155):
rollup: 4.53.1 → 4.59.0 (frontend build tool security and performance updates)langchaingo (commit 274ec52):
v0.1.14-update.2Contributors: @dependabot[bot] (automated dependency PRs), @asdek (langchaingo)
Contributors
This preparation release includes contributions from:
Special thanks to the community for improving code quality, test coverage, and deployment flexibility! 🎉
Merged Pull Requests
Migration Path
For existing deployments upgrading from v1.2.0:
Pull latest changes
Review new environment variables (all optional):
Apply changes:
Test (if using new providers):
No downtime required - Migrations are additive only (new enum values).
Future Work
This preparation release establishes infrastructure for upcoming features:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.