OG T
0e6c381b67
fix(web): 修復 ApprovalCard disabled → readOnly
...
TypeScript 錯誤: disabled prop 不存在,改用 readOnly
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 19:42:37 +08:00
OG T
5172c4c925
feat(web): Error Dashboard + GenUI + OmniTerminal 組件
...
新增功能:
- errors/: Sentry 錯誤儀表板 (overview-card, trend-chart, issues-list)
- genui/ApprovalCard: GenUI 風格簽核卡片
- terminal/OmniTerminal: AI 終端機組件
- useErrors.ts: 錯誤數據 hooks
- terminal.store.ts: 終端機狀態管理
更新:
- conversational-view.tsx: 改進對話式 UI
- providers.tsx: 新增 provider
- sidebar.tsx: 新增 Errors 導航
- api-client.ts: 錯誤 API 整合
- i18n messages: 新增錯誤相關翻譯
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 19:09:36 +08:00
OG T
7847e00b1b
fix(web): 簽核後保留內容顯示 5 秒 (2026-03-26)
...
問題: 簽核後卡片立即消失,用戶無法確認已批准內容
修復:
- approval.store.ts: 簽核/拒絕後延遲 5 秒才移除
- live-approval-panel.tsx: 已解決項目顯示狀態橫幅
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 18:40:19 +08:00
OG T
b79e5f1a1a
fix: Telegram HTML 解析錯誤 + 簽核後內容保留
...
修復:
1. telegram_gateway.py - HTML 轉義 (html.escape) 防止 "Can't parse entities"
2. openclaw-state-machine.tsx - 簽核後顯示結果 2 秒再導航
問題根因:
- URL 和用戶輸入內容可能包含 <, >, & 破壞 HTML
- 簽核後立即刷新列表,已簽核項目消失
Memory: feedback_approval_preserve_content.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 15:32:23 +08:00
OG T
505ceab895
fix(web): 審核完成後正確導航到下一張卡片
...
問題: handleApprove 是異步的,但 setSelectedIndex 不等它完成就執行
修復:
1. fetchPendingApprovals 返回新的審核數量
2. handleApprove 返回 newCount
3. onApprove 使用 await 等待完成後,根據 newCount 決定導航
4. newCount > 0 且 index 有效: 保持 Modal 開啟顯示下一筆
5. newCount = 0: 關閉 Modal
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 14:02:41 +08:00
OG T
875238321e
fix(web): 審核 Modal 真正全屏 - Portal 渲染到 body
...
修復:
1. 使用 createPortal 渲染到 document.body
2. z-index 提升到 9999 確保最上層
3. ApprovalCard 新增 fullHeight prop 移除高度限制
4. 移除巢狀 div 避免滾動衝突
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 13:43:11 +08:00
OG T
540602fd63
fix(web): Phase 17 審核卡片 UI/UX 修復 - SlidePanel → ApprovalModal
...
問題:
- SlidePanel 側邊滑入與右側 OpenClaw 固定面板衝突
- 480px 寬度不足,內容被擠壓截斷
- 標題「審核詳情」只顯示「情」
解決方案:
- 新建 ApprovalModal 全屏 Modal 組件
- 居中對話框 (max-width: 672px)
- 深色遮罩 (60%) 強制用戶聚焦
- 符合 Nothing.tech「一次專注一件事」設計哲學
設計參考: GitHub PR Review, AWS IAM Console
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 13:26:05 +08:00
OG T
643946e60c
refactor(api): ADR-015 MCP 模組化架構重構
...
## 重構內容
符合 leWOOOgo 積木化原則:
- 新增 interfaces.py: MCPToolProvider ABC 定義
- 新增 registry.py: Provider 註冊中心 (DI 模式)
- 新增 providers/: K8s, SignOz, Database 具體實作
- 重構 mcp_bridge.py: 透過 ProviderRegistry 委派執行
## 修復 Code Review 問題
- 🔴 移除 _execute_stdio logging 敏感 parameters
- 🔴 修復 conversational-view.tsx i18n 硬編碼
## 新增檔案
- apps/api/src/plugins/mcp/interfaces.py
- apps/api/src/plugins/mcp/registry.py
- apps/api/src/plugins/mcp/providers/__init__.py
- apps/api/src/plugins/mcp/providers/k8s_provider.py
- apps/api/src/plugins/mcp/providers/signoz_provider.py
- apps/api/src/plugins/mcp/providers/database_provider.py
- docs/adr/ADR-015-mcp-modular-architecture.md
- .dependency-cruiser.cjs (Phase 14.2 準備)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 14:31:32 +08:00
OG T
805d353892
feat(web): Phase 11.3 響應式設計 - Mobile/Tablet 支援
...
ConversationalView 響應式改造:
- Mobile: 全屏詳情面板 + 返回按鈕
- Tablet: 64px 側邊欄 (w-64)
- Desktop: 80px 側邊欄 (w-80)
- i18n: backToList 翻譯
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 13:46:15 +08:00
OG T
e87ac11f4f
feat(web): Phase 11 UX improvements for approval card
...
- Change dashed border buttons to solid filled style for better clickability
- Add signature progress bar with visual indicator
- Add signed users list showing who has already signed
- Convert Blast Radius section to collapsible panel (auto-open for CRITICAL)
- Convert Dry-Run Checks to collapsible panel with pass/fail summary badge
- Add slide-in animations for expanded content
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 11:45:04 +08:00
OG T
b13b063282
feat(web): Phase 11 對話式 AI UI/UX (#47-59)
...
Phase 11.1 對話式容器:
- ConversationalView 雙欄佈局 (左側列表 + 右側詳情)
- ApprovalThreadItem 風險等級 + 相對時間顯示
- SSE 即時更新整合
Phase 11.2 批次處理:
- BatchModeSelector 組件 (全部接受/逐一審核/CRITICAL Only)
- POST /api/v1/approvals/bulk-approve API 端點
- CRITICAL + DESTRUCTIVE 安全過濾 (禁止批次核准)
Phase 11.4 鍵盤快捷鍵:
- useKeyboardShortcuts hook (Y/N/方向鍵/Esc)
- Y 鍵長按 2 秒核准 + 頂部進度指示器
- 快捷鍵說明 Modal (Y/N 高亮顯示)
i18n: 100% next-intl 覆蓋
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 10:31:35 +08:00
OG T
170102a4ee
feat( #15 ): Approval Polling → SSE 即時更新
...
Phase 15: 將 Approval 輪詢機制改為 Server-Sent Events
後端變更:
- 新增 /api/v1/approvals/stream SSE 端點
- 建立/簽核/拒絕時發布 SSE 事件
- 使用現有 EventPublisher 基礎設施
前端變更:
- 新增 useApprovalSSE hook (自動連線/斷線管理)
- approval.store 新增 connectSSE/disconnectSSE actions
- 更新三個組件使用 SSE 取代 setInterval polling:
- LiveApprovalPanel
- AICommandPanel
- HITLSection
效益:
- 即時推送 (延遲 ~0ms vs polling 5s)
- 減少 API 請求 (僅變更時推送)
- 自動重連 + Fallback to polling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 09:54:02 +08:00
OG T
8b7a1186ab
feat(web): Professional UX for approval workflow
...
Industry-standard AIOps UX patterns:
- Compact approval list in right panel
- SlidePanel for details (PagerDuty/ServiceNow style)
- Keyboard navigation (←/→ for prev/next, ESC to close)
- Quick access to approve/reject
- Maintains context while reviewing details
Fixes large empty space issue and endless scrolling.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 00:22:35 +08:00
OG T
e3714f19b7
fix(web): ApprovalCard Sticky Footer (簽核按鈕永遠可見)
...
UX 問題: 卡片過長,滾動到底部簽核時看不到頂部內容
修復:
- max-h-[70vh] 限制卡片最大高度
- 內容區域可滾動 (overflow-y-auto)
- Footer sticky 固定在底部
- 簽核按鈕永遠可見
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-24 23:47:22 +08:00
OG T
38378276f3
fix(web): ApprovalCard UX 優化 - 標題與命令分離
...
問題: action 欄位包含完整 kubectl 命令導致標題過長
[AI: mock_fallback] 前綴干擾閱讀
修復:
- 主標題只顯示 | 前的動作描述
- kubectl 命令獨立顯示在 code block
- 移除描述中的 [AI: xxx] 和 AI 仲裁前綴
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-24 23:44:51 +08:00
OG T
b20987e7b6
feat(sentry): Implement Sentry Tunnel to avoid local network permission dialog
...
- Add /api/sentry-tunnel API Route (Next.js)
- Update sentry.client.config.ts with tunnel option
- Re-enable NEXT_PUBLIC_SENTRY_DSN in CI/CD workflows
Resolves : #45 Sentry Tunnel
See: feedback_sentry_local_network.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-24 16:16:34 +08:00
OG T
9bff46a1b0
feat: integrate Sentry + fix CI/CD issues
...
Sentry Integration (補強 SignOz):
- Add @sentry/nextjs for frontend error tracking + session replay
- Add sentry-sdk[fastapi] for backend error tracking
- Create sentry.client/server/edge.config.ts
- Integrate with next.config.js + instrumentation.ts
- Add Sentry exception capture in FastAPI error handler
- Create deployment scripts for Self-Hosted @ 192.168.0.110
CI/CD Fixes:
- Fix F821 Undefined name 'Field' in incidents.py
- Add NEXT_PUBLIC_API_URL env var to CI build step
- Add build-arg to Docker build verification
E2E Test Improvements:
- Fix strict mode violations in dashboard-acceptance tests
- Add timeout increase for Phase 4 demo tests
- Make tests more resilient to UI variations
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-24 15:19:52 +08:00
OG T
4f1c8ae473
fix(ci): Resolve Python and TypeScript lint errors
...
- Fix 35 Python ruff errors (B904, F841, E722, E741, B007, B008)
- Add eslint config for lewooogo-core package
- Update pyproject.toml to new ruff lint config format
- Relax frontend eslint rules to warnings for unused vars
- Allow console.* for debugging (TODO: unified logger)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-24 09:20:56 +08:00
OG T
29ceb786ca
feat(web): 全局戰情室顯示真實 AI 決策鏈
...
問題:
- ThinkingTerminal 使用 DEMO_DECISION_CHAIN 假數據
- 用戶無法看到 OpenClaw AI 的真實推理過程
修復:
- 新增 convertToDecisionChain() 轉換 API 格式
- 從 incident.decision.proposal_data 提取真實 AI 資料
- 顯示: 決策引擎來源、推理過程、建議動作、信心分數
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 23:17:52 +08:00
OG T
7db42ffdac
fix(web): Y按鈕簽核回應解析錯誤 - result.status → result.approval.status
...
根因: API 回傳 {approval: {status: 'approved'}} 但前端誤檢查 result.status
修復:
- dual-state-incident-card.tsx: 正確解析 result.approval.status
- api-client.ts: 更新回傳型別與後端對齊
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 21:20:41 +08:00
OG T
4c41a6728f
fix(web): Fix API contract mismatch for sign/reject endpoints
...
- signApproval: send signer_id, signer_name, comment (not signer, reason)
- rejectApproval: send rejector_id, rejector_name, reason
Fixes 422 Unprocessable Entity on Y/n button click
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 21:04:44 +08:00
OG T
7478dc0254
feat(phase6-9): Complete modular architecture and Agent Teams
...
Phase 6.4 - Modular Architecture:
- Add lewooogo-brain adapters for LLM providers
- Add lewooogo-data dual memory (Redis + PostgreSQL)
- Implement consensus engine for multi-agent decisions
- Add incident memory service for historical context
Phase 9 - Agent Teams (Claude Agent SDK):
- Add base agent class with Claude Sonnet 4 integration
- Implement action planner, blast radius, and security agents
- Add agent API endpoints and proposal workflow
- Integrate ADR-009 OpenClaw Agent Teams architecture
DevOps & CI/CD:
- Add GitHub Actions CI/CD workflows (ci.yaml, cd.yaml)
- Add pre-commit hooks and secrets baseline
- Add docker-compose for local development
- Update Kubernetes network policies
Frontend Improvements:
- Add auto-healing error boundary component
- Update i18n messages for agent features
- Enhance dual-state incident card with execution feedback
Documentation:
- Add 7 ADRs covering MCP, design system, architecture decisions
- Update ARCHITECTURE_MEMORY.md with modular design
- Add GLOBAL_RULES.md and SOUL.md for project identity
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 18:40:36 +08:00
OG T
3de8a7701d
feat(web): Phase 6.5c UX improvements for Y/n execution feedback
...
- Show actual error message on screen (not just hover tooltip)
- Add retry button after error/timeout
- Add 30-second timeout warning with "超時" state
- Remove auto-dismiss of error (let user see and retry)
- Truncate long error messages with full text in tooltip
Fixes P0 UX issue: Users can now see what went wrong
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 14:28:35 +08:00
OG T
b0302329f4
fix(web): Pass decision prop to DualStateIncidentCard
...
Root cause: mapToDualState() was missing decision field,
causing Y/n buttons to be permanently disabled.
Now correctly passes incident.decision to the card component.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 13:54:42 +08:00
OG T
0aaf6a276b
feat(api,web): Phase 6.5 DecisionManager with dual-engine fallback
...
Backend:
- Add DecisionManager with state machine (INIT→ANALYZING→READY→EXECUTING)
- Implement Expert System rules engine (100% local, never fails)
- Dual-engine: LLM (primary) + Expert System (fallback)
- Auto-generate decision_token for each incident
- 30-second timeout guarantee
Frontend:
- Use decision.state to unlock [Y/n] buttons
- Display AI action suggestion in card
- Show source indicator [AI] or [EXP]
- Generate proposal on-demand if needed
Fixes: UI locked with hourglass when LLM times out
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 13:19:55 +08:00
OG T
c01742ef82
fix(web): Phase 6.5c+ enhance [Y/n] tactile feedback & diagnostics
...
- Add active:scale-95 active:bg-neutral-800 for physical click feedback
- Add disabled:opacity-30 for clearer disabled state
- Add tooltip "大腦分析中..." when proposalId is missing
- Add comprehensive console.log diagnostics for authorization flow
- Add reason parameter "Authorized via WarRoom" for audit trail
- Implement optimistic UI with immediate loading state transition
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 13:07:10 +08:00
OG T
7db5108a1f
feat(web): Phase 7.0 minimalist 5-pillar navigation
...
- Refactor sidebar to Nothing.tech visual compliance
- Add defensive route stubs for /authorizations, /knowledge-base, /settings
- Dynamic badge for pending approvals count
- Ultra-minimal borders (0.5px), no shadows
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 13:02:21 +08:00
OG T
28fa8e6af4
feat(web): Phase 6.5c implement [Y/n] execution wiring
...
DualStateIncidentCard:
- Add proposalId prop for approval actions
- Add onApprovalChange callback for status updates
- Implement handleApprove() calling POST /api/v1/approvals/{id}/sign
- Implement handleReject() calling POST /api/v1/approvals/{id}/reject
- Add ButtonState management (idle/loading/approved/rejected/error)
- Loading spinner during API call
- Success state: green "已授權" / red "已拒絕"
- Error state: orange "錯誤" with auto-recovery
API Client:
- Fix endpoint mismatch: rename approveApproval to signApproval
- Use correct endpoint /sign instead of /approve
- Add signer parameter for multi-sig support
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 12:37:56 +08:00
OG T
be8ed1f7ba
fix(web): resolve interface mismatch + add defensive null checks
...
- P0/P1/P2 now map to 'alert' status (was P0/P1 only)
- Tier mapping: P0=Tier3, P1=Tier2, P2=Tier1
- Added null/undefined guards in mapToDualState()
- Optional chaining on incidents array access
- Safe fallback for missing serviceName, message, timestamp
Fixes frontend warroom showing no cards despite API returning data.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 12:17:58 +08:00
OG T
cb5d0ecfe4
feat(phase-6.4g-6.5b): API Synaptic Integration + Dual-State WarRoom UI
...
Phase 6.4g (API 突觸對接):
- lewooogo-brain dependency binding in apps/api/pyproject.toml
- POST /api/v1/incidents/{id}/propose route (proposals.py)
- Guardrails integration (8/8 tests passed)
Phase 6.5a (視覺皮層建置):
- DualStateIncidentCard.tsx with Nothing.tech visual compliance
- Ping radar animation for alert state
- Tier-based decision layer UI (AI 執行中 / 等待親核)
Phase 6.5b (神經網路串接):
- Main warroom page integration (page.tsx)
- IncidentResponse → DualState mapper function
- Empty state: "系統穩定。0 活躍異常。"
Tests:
- test_guardrails.py (8/8)
- test_incident_engine.py (6/6)
- test_skill_loader.py (6/6)
- Frontend build: 0 errors
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 11:58:28 +08:00
OG T
68f4cf51b6
fix(web): resolve approval card race condition with polling
...
Race condition between polling (5s interval) and sign/reject operations
caused cards to flicker and reappear after being approved.
Fix:
- Pause polling during sign/reject API calls
- Resume polling after 1 second delay to allow backend state sync
- Apply same pattern to both signApproval and rejectApproval
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 09:13:35 +08:00
OG T
196d269b92
feat: add all application source code
...
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages
Co-Authored-By: Claude <noreply@anthropic.com >
2026-03-22 18:57:44 +08:00