feat: Implement lesson generation feature and update status display

- Added functionality to generate lessons based on code reviews, including prompts and instructions for the reviewer.
- Updated the `.gitignore` to exclude lesson documentation files.
- Removed the `/lesson` command from the help menu and command parsing.
- Enhanced the status bar to display a message when a lesson is being generated.
- Introduced a new `lesson_running` state to track lesson generation progress.
- Updated various components to handle the new lesson generation workflow, including subagent events and token usage tracking.
This commit is contained in:
asepharyana
2026-07-15 03:11:55 +07:00
parent f87ab133f1
commit 1c08b8e4e9
18 changed files with 468 additions and 256 deletions
+2 -1
View File
@@ -79,7 +79,6 @@ const COMMANDS: &[&str] = &[
"/help",
"/quit",
"/clear",
"/lesson",
"/login",
"/login zen",
"/login openai",
@@ -291,6 +290,7 @@ pub struct MiscState {
pub api_context_length: Option<u32>,
pub tick_count: u64,
pub todo_content: String,
pub lesson_running: bool,
}
impl MiscState {
@@ -309,6 +309,7 @@ impl MiscState {
api_context_length: None,
tick_count: 0,
todo_content: String::new(),
lesson_running: false,
}
}
+10
View File
@@ -108,6 +108,16 @@ pub enum TurnEvent {
tokens_in: u64,
tokens_out: u64,
},
/// Token usage from a subagent (review, test-gen, arch-review, etc.)
/// routed to `UsageStats::review_tokens` so the Usage panel can split
/// "main" tokens from "self-learning" tokens. Same shape as `Usage` but
/// kept as a distinct variant so future subagent-specific metadata
/// (origin tag, subagent name) can be attached without breaking the
/// main-agent path.
ReviewUsage {
tokens_in: u64,
tokens_out: u64,
},
Compacted(Vec<crate::dto::chat::message::ChatMessage>),
Error(String),
Done,