mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[PR #222] [MERGED] Test Coverage & Performance Improvements #245
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/222
Author: @asdek
Created: 3/22/2026
Status: ✅ Merged
Merged: 3/22/2026
Merged by: @asdek
Base:
master← Head:feature/next_release📝 Commits (10+)
db82ddefix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks854cd6dtest: add unit tests for pkg/version package06c8ce4test: add unit tests for pkg/terminal package0c61f6btest: add unit tests for pkg/server/response packagec4d4a30test: add unit tests for pkg/providers/embeddings package335541aFix cancellation tests to verify context.Canceled exactlyb130cd0test: add graph context helper coverageb9c575afix(system): add configurable timeout to HTTP client1014946chore(deps): bump the npm_and_yarn group across 1 directory with 2 updates3e68cb2test: add server context helper coverage📊 Changes
40 files changed (+3555 additions, -1856 deletions)
View changed files
📝
.env.example(+4 -0)📝
README.md(+1 -0)📝
backend/cmd/installer/wizard/controller/controller.go(+6 -0)📝
backend/cmd/installer/wizard/locale/locale.go(+15 -0)📝
backend/cmd/installer/wizard/models/server_settings_form.go(+28 -0)📝
backend/docs/config.md(+23 -2)📝
backend/go.mod(+28 -27)📝
backend/go.sum(+69 -52)📝
backend/pkg/config/config.go(+4 -0)📝
backend/pkg/config/config_test.go(+328 -1)➕
backend/pkg/graph/context_test.go(+388 -0)📝
backend/pkg/providers/anthropic/anthropic.go(+3 -1)📝
backend/pkg/providers/bedrock/bedrock.go(+3 -1)📝
backend/pkg/providers/bedrock/bedrock_test.go(+93 -0)📝
backend/pkg/providers/custom/custom.go(+1 -1)📝
backend/pkg/providers/deepseek/deepseek.go(+3 -1)➕
backend/pkg/providers/embeddings/embedder_test.go(+412 -0)📝
backend/pkg/providers/gemini/gemini.go(+3 -1)📝
backend/pkg/providers/glm/glm.go(+3 -1)📝
backend/pkg/providers/kimi/config.yml(+24 -2)...and 20 more files
📄 Description
Description of the Change
Problem
PentAGI codebase had several quality and performance issues requiring attention:
Test Coverage Gaps:
HTTP Client Timeout Missing:
Tool Call ID Detection Inefficiency:
AWS Bedrock Compatibility:
Solution
Comprehensive Test Coverage:
HTTP Client Timeout Configuration:
HTTP_CLIENT_TIMEOUTenvironment variable (default: 600 seconds)Tool Call ID Template Optimization:
testTemplate()fast-path validationBedrock toolConfig Fix:
Dependency Updates:
Closes #160
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
cd backend && go test ./...Test Results
go fmt,go vet,golangci-lintcleannpm run lintpassedSecurity Considerations
No Security Impact:
Performance Impact
Improvements:
Token Savings:
Documentation Updates
Deployment Notes
New Environment Variable (Optional):
Configuration Notes:
.envfile or installer wizardCompatibility:
Deployment Steps:
.envif custom timeout neededdocker compose build(dependency updates)docker compose up -dChecklist
Code Quality
go fmtandgo vet(for Go code)npm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
Additional Notes
Key Changes by Category
Test Coverage Improvements
Added 200+ Unit Tests (PRs #198, #199, #200, #201, #202, #213, #214):
pkg/version- Binary version, develop mode detection, binary namepkg/config- Configuration loading, defaults, env overrides, Installation ID handlingpkg/terminal- Markdown detection, interactive prompts, context cancellation, JSON/markdown outputpkg/server/response- HttpError type, 78 predefined errors, dev/production mode response handlingpkg/providers/embeddings- All 7 providers (OpenAI, Ollama, Mistral, Jina, Huggingface, GoogleAI, VoyageAI)pkg/graph/context- User ID/type/permissions helpers, validation functions, admin regexpkg/server/context- Gin context helpers (GetInt64, GetUint64, GetString, GetStringArray, GetStringFromSession)Test Quality Standards Applied:
Contributors: @mason5052
Performance Optimizations
Tool Call ID Template Fast-Path (Commit
55e0ac5):backend/pkg/providers/provider/agents.gotestTemplate()function validates known templates with single LLM callHTTP Client Timeout (PR #205, Commit
47ae6fe):backend/pkg/system/utils.go,backend/pkg/config/config.goHTTP_CLIENT_TIMEOUTenv var (default 600s, 0=unlimited)Bug Fixes
Bedrock toolConfig Requirement (PR #196):
backend/pkg/providers/bedrock/bedrock.gorestoreMissedToolsFromChain(),collectToolUsageFromChain(),inferSchemaFromArguments()Dependencies
Go Modules (PR #215, Commit
47ae6fe):go.opentelemetry.io/otel/sdkv1.36.0 → v1.39.0 (rolled back from v1.40.0 for compatibility)golang.org/x/cryptov0.44.0 → v0.46.0google.golang.org/grpcv1.73.0 → v1.79.3Frontend Dependencies (PR #207):
dompurify3.3.1 → 3.3.3 (security patches)immutable3.7.6 → 5.1.5 (major version update)Contributors
This release includes contributions from:
Special thanks to community contributors for improving PentAGI's code quality!
Merged Pull Requests
Issues Addressed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.