feat: support for gpt-oss in interactive chat#79
Conversation
fix: refactor
📝 WalkthroughWalkthroughThe pull request extends the chat workflow in the Rust runtime to support memory-mode-aware behavior throughout the response handling pipeline. Changes update function signatures to accept Sequence DiagramsequenceDiagram
participant User
participant ChatFn as chat()
participant Streaming as Streaming Handler
participant Conversion as convert_to_chat_response()
participant Extraction as extract_reply()
User->>ChatFn: Input + RunArgs
activate ChatFn
ChatFn->>Streaming: Stream response with memory_mode
activate Streaming
Streaming->>Streaming: Track is_answer_start flag
alt memory_mode enabled
Streaming->>User: Print full response
else memory_mode disabled
Streaming->>User: Print dimmed deltas until marker
Streaming->>User: Print normal deltas after marker
end
Streaming-->>ChatFn: Final content
deactivate Streaming
ChatFn->>Conversion: Content + memory_mode
activate Conversion
Conversion->>Extraction: Content + memory_mode
activate Extraction
alt memory_mode enabled
Extraction->>Extraction: Extract reply tag content
else memory_mode disabled
Extraction->>Extraction: Extract final answer (marker-based)
end
Extraction-->>Conversion: Parsed reply
deactivate Extraction
Conversion-->>ChatFn: ChatResponse
deactivate Conversion
ChatFn-->>User: ChatResponse
deactivate ChatFn
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tiles/src/runtime/mlx.rs (1)
487-533: Answer‑marker detection can miss when the marker is split across stream chunks.SSE deltas can split
**[Answer]**across chunks, so checking only the currentdeltacan leaveis_answer_startfalse and keep all output dimmed. Consider detecting on the accumulated buffer (or a small rolling window) to handle chunk boundaries.🛠️ Suggested fix
- if !run_args.memory && delta.contains("**[Answer]**") { - is_answer_start = true; - } + if !run_args.memory && !is_answer_start && accumulated.contains("**[Answer]**") { + is_answer_start = true; + }
fix: refactor