feat: Merge PR features with test-IDs from Optimizecodecloudagents - #26
feat: Merge PR features with test-IDs from Optimizecodecloudagents#26dsactivi-2 wants to merge 6 commits into
Conversation
- Add core-brain.ts client for connecting to brain-core API (49.13.158.176:5001) - Implement Pre-Recall: Search core brain before AI response for context - Implement Writeback: Store Q&A pairs in core brain (append-only) - User mapping: Pass real userId to brain-core (auto-created if not exists) Features: - coreBrainSearch(): Search central knowledge base - coreBrainStore(): Store memories (append-only, no overwrites) - coreBrainRecent(): Get recent memories - buildCoreBrainContext(): Build context string for prompt injection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Auto-fixed by GitHub Actions
- POST /api/auth/reset-password (admin only) - Validates password length (min 8 chars) - Logs password_reset event to audit log - Added new audit event types: password_reset, user_created, user_deleted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Auto-fixed by GitHub Actions
- src/lib/api.ts: Complete API client with all 178 backend endpoints - Auth, Users, Agents, Tasks, Chat, Audit, Ops, Brain, Memory - Settings, Enforcement, GitHub, Linear, Webhooks, Modules, Billing - Full TypeScript types for all API responses - src/components/UsersPage.tsx: User management (CRUD) - List, create, edit, delete users - Password reset functionality - Role management (admin/user/demo) - User stats dashboard - src/components/AuditPage.tsx: Audit & Ops dashboard - Event log with filtering - Blocked tasks management (approve/reject) - Operations statistics - STOP-Score monitoring - src/components/IntegrationsPage.tsx: External integrations - GitHub repos and issues - Linear teams and issues - Webhook management (CRUD, test) - Updated App.tsx with new navigation tabs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Components (with test-IDs): - NEW: ThemeProvider.tsx - dark/light/system theme switching - NEW: ThemeToggle.tsx - theme toggle dropdown button - MERGED: AgentCard.tsx - added spokenLanguage, agentType, contentAutonomy - MERGED: CreateAgentDialog.tsx - added influencer type, spoken language selector Documentation: - NEW: docs/AGENT_CONTROL.md - Agent Control API documentation Features merged from PRs: - PR #2: ThemeProvider, ThemeToggle - PR #4: Influencer agent type, Serbian language support, content autonomy - PR #7: AGENT_CONTROL.md API documentation All components include data-testid attributes following naming convention: cloudagents.{component}.{element}.{action} 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| const [usersRes, statsRes] = await Promise.all([ | ||
| usersApi.list(), | ||
| usersApi.stats(), | ||
| ]); | ||
| setUsers(usersRes.users || []); | ||
| setStats(statsRes); |
There was a problem hiding this comment.
Bug: The UsersPage component expects a raw stats object from usersApi.stats(), but the API returns a wrapped object { success, stats }. This mismatch will cause stats cards to display undefined.
Severity: HIGH | Confidence: High
🔍 Detailed Analysis
The usersApi.stats() endpoint returns a wrapped response object: { success: boolean, stats: { ... } }. However, the UsersPage component at lines 94-99 incorrectly assumes the API returns the raw stats object directly. The statsRes variable is assigned the wrapped object, and setStats(statsRes) stores this incorrect structure in the component's state. When the component later attempts to render properties like stats.total or stats.active, it accesses properties on the wrapped object, resulting in undefined values and breaking the user statistics display cards.
💡 Suggested Fix
In UsersPage.tsx, update the handling of the statsRes to correctly unwrap the nested stats object before calling setStats. For example: setStats(statsRes.stats). This will align the component's state with the data structure used for rendering.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/components/UsersPage.tsx#L94-L99
Potential issue: The `usersApi.stats()` endpoint returns a wrapped response object: `{
success: boolean, stats: { ... } }`. However, the `UsersPage` component at lines 94-99
incorrectly assumes the API returns the raw `stats` object directly. The `statsRes`
variable is assigned the wrapped object, and `setStats(statsRes)` stores this incorrect
structure in the component's state. When the component later attempts to render
properties like `stats.total` or `stats.active`, it accesses properties on the wrapped
object, resulting in `undefined` values and breaking the user statistics display cards.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 508565
|
Replaced by clean PR - original branch had merge conflicts with old commits |
|
n |
…-compatibility Add TypeScript support for Jest 30.2.0 configuration
Summary
Merged features from Optimizecodecloudagents PRs #2, #4, #7 with proper test-IDs.
New Components
Updated Components
AgentCard.tsx - Added:
spokenLanguagesupport (de/en/bs/sr)agentType(standard/influencer)contentAutonomybadgeCreateAgentDialog.tsx - Added:
New Documentation
Test-IDs
All components follow naming convention:
cloudagents.{component}.{element}.{action}Examples:
cloudagents.theme.toggle.buttoncloudagents.agent.create.name.inputcloudagents.agent.{id}.badge.influencerSource PRs (Optimizecodecloudagents)
Changes
Test Plan
🤖 Generated with Claude Code