feat: add --sender parameter to chat commands#562
Conversation
- Add --sender option to Python CLI chat command - Add --sender option to Rust CLI chat command - Pass sender ID through to channels - Display sender in interactive mode header - Update langfuse integration for compatibility
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Align default sender ID in SingleTurnChannel from "default" to "user" to match ChatChannel's default, ensuring consistent sender identification across interactive and single-turn chat modes.
Change Rust CLI's default sender from "cli_user" to "user" to match Python side (ChatChannel and SingleTurnChannel), ensuring consistent default sender identification across both Rust and Python CLI tools.
When converting from old usage format (prompt_tokens/completion_tokens/total_tokens) to usage_details format, also pass through total_tokens as 'total' field if it's available in the usage dict.
Wrap self.langfuse.flush() calls in try/except blocks to prevent flush failures from discarding successfully obtained LLM responses. - In success path: flush() failure only logs debug message - In error path: flush() failure silently ignored (already in error handling)
Temporarily disable langfuse propagate_attributes context manager to fix RuntimeError: generator didn't stop after throw(). The context manager had exception handling issues when exceptions were thrown inside the block. This preserves the API while avoiding the runtime error.
…or error Reimplement propagate_attributes with manual __enter__/__exit__ management to avoid the 'generator didn't stop after throw()' error. Key changes: - Use local variable to avoid name shadowing with the method - Only catch exceptions when entering the context manager - Let inner block exceptions propagate normally - Always exit the context manager in finally block - Restore session_id/user_id propagation to langfuse
Description
Related Issue
Type of Change
Changes Made
Testing
Checklist
Screenshots (if applicable)
Additional Notes