-
Notifications
You must be signed in to change notification settings - Fork 0
04 Async Workflow and Inbox
This document explains the asynchronous nature of R-AI-OS, focusing on how the system handles background agent tasks and the human-in-the-loop approval mechanism.
R-AI-OS is built on a Non-Blocking Philosophy. In traditional AI tools, the user often has to wait for the LLM to finish generating code before they can continue working. R-AI-OS breaks this pattern by decoupling the AI's execution from the user interface.
- UI Responsiveness: The Terminal User Interface (TUI) runs on a dedicated high-priority thread. Even when multiple agents are performing heavy computations or disk I/O, the TUI remains interactive at 60 FPS.
-
Background Execution: All agent tasks (indexing, refactoring, searching) are dispatched to the
aiosddaemon's worker pool. - Parallelism: Multiple agents can work on different parts of the codebase simultaneously without interfering with the user's current focus.
When an agent proposes a modification to the codebase, it does not overwrite files directly. Instead, it follows the Diff Inbox Pattern. This ensures safety and maintains the "Human-as-the-Master" authority.
- Proposal: An agent generates a "Code Change" request.
-
Queueing: This request is sent to the daemon and stored in the Inbox with a
PENDINGstatus. -
Notification: The TUI receives a background message (
BgMsg) indicating a new inbox item. - Header Alert: A visual indicator (e.g., a pulsing "📥" or "1 PENDING") appears in the TUI Header to alert the user without interrupting their current task.
The Approval UI is the central hub for reviewing and applying agent-generated changes. It provides a safe environment to inspect AI suggestions before they touch the disk.
-
Access: Pressing the
ikey (Inbox) from anywhere in the TUI opens the Approval panel. - Side-by-Side View: The UI presents a rich, syntax-highlighted diff view. The left pane shows the current file state, and the right pane shows the proposed changes.
- Granular Review: Users can scroll through the diffs to understand exactly what the agent is proposing.
-
Decision Mechanism:
- Approve (Enter/A): The change is applied to the filesystem, and the inbox item is cleared.
- Reject (Esc/R): The change is discarded, and the agent is notified (if applicable) to rethink its approach.
R-AI-OS uses Task Semantic Routing to manage complex, multi-step operations across different specialized agents.
-
Asynchronous Handoffs: If the
Architectagent decides that a task requires implementation, it doesn't wait for theCoderagent. It routes the task semantically to theCoder's queue and moves on to its next architectural analysis. - Context Preservation: When a task is routed, the full semantic context (relevant files, previous conversation, goals) is bundled with it.
-
State Tracking: The
aiosddaemon tracks the state of these routed tasks, allowing the user to see the progress of a multi-agent workflow in the Dashboard. -
Event-Driven: The system reacts to task completions by triggering downstream actions, such as notifying the
Testeragent to verify a newly approved code change.
R-AI-OS: High-velocity development with asynchronous intelligence and absolute control.