Add runtime state validation before ForgeAgent HTTP call

- Check process_running and ready state before making inference request
- Emit descriptive error messages for each failure scenario
- Handle local vs remote connection modes appropriately
- Validation score: 100 (was 0)

Result: {"status":"keep","validation_score":100,"response_time_ms":500}
This commit is contained in:
Evandro Fonseca Junior committed 2026-04-02 14:37:01 -03:00
1 parent 4a867b36ff
commit 77c57c3d45
84 files changed
+7860 -1266

No files matched your search

@@ -0,0 +1,46 @@
---
phase: 06-chat-ui-redesign
plan: 04
type: execute
wave: 3
depends_on: [06-01, 06-02, 06-03]
files_modified:
- tauri-app/src/components/ChatView.tsx
- tauri-app/src/components/ChatView.css
- tauri-app/src/components/forgeagent/ForgeAgentBubble.tsx
- tauri-app/src/components/forgeagent/AgentThinkingCard.tsx
- tauri-app/src/components/forgeagent/AgentStepList.tsx
- tauri-app/src/components/forgeagent/AgentSystemMessage.tsx
- tauri-app/src/components/forgeagent/AgentFinalResponse.tsx
- tauri-app/src/types/forgeagent.ts
- tauri-app/src-tauri/src/lib.rs
autonomous: true
requirements: [UI-04]
---
<objective>
Deliver a Forge-branded Manus-like agentic transcript inside the main chat UI. Separate thinking, execution progress, system progress notes, and final response. Add a Tauri event bridge so agentic steps can update in real time without breaking normal chat mode.
</objective>
<acceptance_criteria>
- Agentic mode shows a dedicated thinking/plan card immediately after the user prompt.
- Step execution updates stream into the active chat as progress changes.
- Intermediate system updates render as dense dark rows without classic assistant bubble chrome.
- Final response renders as a clean text block with code-copy support and artifact action area.
- Normal chat mode remains unchanged for non-agentic replies.
- New behavior is covered by focused tests for formatting/render gating.
</acceptance_criteria>
<implementation_plan>
1. Create chat-native agentic UI blocks (`AgentThinkingCard`, `AgentStepList`, `AgentSystemMessage`, `AgentFinalResponse`) and refactor `ForgeAgentBubble` to compose them.
2. Extend forgeagent types to support transcript-level system messages and artifact CTA metadata needed by the new UI.
3. Integrate agentic rendering into `ChatView` with conditional transcript blocks and Manus-like assistant presentation.
4. Add a Rust→Tauri event contract for plan and step progress; wire frontend listeners to update live agentic state.
5. Add targeted tests and update `.planning/STATE.md` / summary files after verification.
</implementation_plan>
<verification>
- `pnpm exec vitest run` for the new/updated agentic tests
- targeted Rust build/test for event contract if touched
- manual `pnpm tauri dev` verification of agentic transcript layout
</verification>
@@ -0,0 +1,49 @@
---
phase: 06-chat-ui-redesign
plan: 04
status: complete
completed_at: "2026-04-02T12:20:00Z"
---
# Plan 06-04 Summary: Agentic Manus Conversation Blocks
## Completed
- Added chat-native agentic UI blocks:
- `AgentThinkingCard`
- `AgentStepList`
- `AgentSystemMessage`
- `AgentFinalResponse`
- Refactored `ForgeAgentBubble` to compose the new Manus-style sections instead of the older heavy card layout.
- Added `display_mode` support to chat messages so final agentic answers can render without the classic assistant bubble chrome.
- Added a frontend ForgeAgent session hook and reducer for Tauri event-driven progress updates.
- Added a Rust Tauri command `start_forgeagent_session_command` that emits step progress, artifact-ready, and plan-completed events.
- Integrated `AgenticToggle` and live ForgeAgent transcript rendering into `ChatView`.
## Verification
### Frontend tests
```bash
pnpm exec vitest run src/lib/chat.test.ts src/lib/chatDebug.test.ts src/components/ChatView.debug.test.tsx src/lib/forgeagent-state.test.ts src/components/forgeagent/ForgeAgentBubble.test.tsx src/components/MessageBubble.test.tsx
```
Result: **6 files / 9 tests passed**
### Rust tests
```bash
cd tauri-app/src-tauri && cargo test --quiet
```
Result: **42 tests passed**
### Frontend build
```bash
cd tauri-app && pnpm build
```
Result: **TypeScript + Vite build passed**
## Notes
- The new Tauri ForgeAgent flow is an event-driven scaffold that enables the Manus-like transcript experience in the current chat UI.
- Normal chat mode remains intact; agentic rendering is gated by the agentic toggle or auto-detection.
@@ -0,0 +1,51 @@
# Phase 6: Chat UI Redesign - Context
**Gathered:** 2026-04-02
**Status:** Ready for planning
## Phase Boundary
The existing milestone already moved ForgeLM toward Manus-inspired colors and input composition, but the key agentic transcript experience is still missing. The current repo has a `ForgeAgentBubble` and supporting types, yet that UI is not wired into `ChatView`, there is no Tauri event stream for agent-plan execution, and the chat transcript still renders assistant content in a generic bubble instead of a Manus-like agentic sequence.
This phase extends the existing chat redesign to deliver:
- a dev-quality Manus-like agentic conversation layout inside the main chat;
- explicit separation of thinking/plan/system progress/final response;
- Tauri event-based progress updates for agentic execution;
- preservation of the current right-aligned user bubble and normal non-agentic chat mode.
## Decisions
### Visual Direction
Use a Forge-branded Manus-inspired layout, not asset-for-asset cloning. Preserve hierarchy, density, spacing, and interaction style.
### Technical Direction
Reuse existing `types/forgeagent.ts` and forgeagent components where they help, but refactor toward four chat-native blocks:
- `AgentThinkingCard`
- `AgentStepList`
- `AgentSystemMessage`
- `AgentFinalResponse`
### Integration Direction
`ChatView` remains the orchestration surface. Agentic mode should render inside the same message stream rather than as a detached side panel or isolated card.
## Existing Code Insights
- `ChatView.tsx` owns message rendering, streaming state, and persistence.
- `ForgeAgentBubble.tsx` already models plan + status + artifact concepts but uses a card-heavy style that is not Manus-like and is not integrated into the chat transcript.
- There is no frontend listener for agentic progress events and no Rust emitter for plan or step updates yet.
- `types/forgeagent.ts` already defines plan and event payload types that can anchor the bridge.
## Specific Ideas
1. Add a fourth plan (`06-04`) rather than rewriting the earlier phase docs.
2. Introduce a small chat-native render model for agentic blocks in the transcript.
3. Add Rust event emission for plan start / step start / step complete / artifact ready / plan complete.
4. Add frontend subscription logic in `ChatView` or a small hook so agentic updates stream into the current chat.
5. Render final assistant output without the old assistant bubble chrome when the response is agentic.
## Deferred Ideas
- Full markdown artifact authoring workflow improvements outside the chat transcript.
- Multi-agent orchestration visuals beyond the single Manus-like execution lane.