-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: stream markdown #2230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: stream markdown #2230
Conversation
…er for markdown rendering
…typewriter effect
…ing in StreamWriter
…r management during writes
… control and writer flushing
- Added `OutputPrinter` trait for thread-safe writing to stdout and stderr. - Implemented `OutputPrinterInfra` in various services to utilize the new output printer. - Refactored `ForgeCommandExecutorService` to use `OutputPrinter` for command output. - Updated `SpinnerManager` to support output printing through the new trait. - Removed acknowledgment mechanism from `ChatResponse` to simplify tool call handling. - Enhanced `StreamWriter` to work with `OutputPrinter` for better output management. - Updated dependencies in `Cargo.lock` to include `forge_domain`.
Co-Authored-By: ForgeCode <[email protected]>
…ove spinner management
…ush calls and simplifying text checks
… for graceful completion
…mplementation for DirectWriter
…and direct output
… update references
|
|
||
| /// Start the spinner with a message. | ||
| pub fn start(&self, message: Option<&str>) -> Result<()> { | ||
| self.0.lock().unwrap().start(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panic Risk: Unwrapping mutex lock will panic if the mutex is poisoned (e.g., if a thread panicked while holding the lock). This will crash the application in production.
// Fix: Handle the poison error gracefully
pub fn start(&self, message: Option<&str>) -> Result<()> {
self.0.lock()
.map_err(|e| anyhow::anyhow!("Spinner mutex poisoned: {}", e))?
.start(message)
}| self.0.lock().unwrap().start(message) | |
| self.0.lock() | |
| .map_err(|e| anyhow::anyhow!("Spinner mutex poisoned: {}", e))? | |
| .start(message) |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
| } | ||
| })); | ||
| }); | ||
| *self.tracker.lock().unwrap() = Some(handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panic Risk: Unwrapping mutex lock will panic if the mutex is poisoned. Since this is in the hot path of spinner operations, a poisoned mutex will crash the application.
// Fix: Handle the poison error gracefully
let mut tracker_guard = self.tracker.lock()
.map_err(|e| anyhow::anyhow!("Tracker mutex poisoned: {}", e))?;
*tracker_guard = Some(handle);| *self.tracker.lock().unwrap() = Some(handle); | |
| let mut tracker_guard = self.tracker.lock() | |
| .map_err(|e| anyhow::anyhow!("Tracker mutex poisoned: {}", e))?; | |
| *tracker_guard = Some(handle); | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
| forge_select = { path = "crates/forge_select" } | ||
| forge_test_kit = { path = "crates/forge_test_kit" } | ||
|
|
||
| forge_markdown_stream = { git = "https://github.com/laststylebender14/forge_markdown_stream", branch = "master" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the project into our repo.
No description provided.