fix: load usage from conversions when used with cli commands#1575
Conversation
| .context | ||
| .and_then(|ctx| ctx.usage) | ||
| .unwrap_or(self.state.usage.clone()); | ||
| self.spinner.stop(None)?; |
There was a problem hiding this comment.
The spinner.stop() call is placed inside the init_conversation method but only in the None branch (when creating a new conversation). However, the spinner.start() is called at the beginning of this branch. If the conversation_id already exists (Some branch), the spinner is never started, so this placement is correct. But if there's an error between spinner.start() and this spinner.stop(), the spinner will remain running. The spinner.stop() should be moved outside the conversation creation logic or wrapped in proper error handling to ensure it's always called after spinner.start().
| self.spinner.stop(None)?; | |
| let _spinner_guard = self.spinner.guard(); |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Fixes
--resume--conversation