- Currently enabled in PluginDefinition.cpp:
bool debugMode = true; - This causes verbose logging in streaming callback
Non-Streaming (working) flow:
askChatGPT() → HTTPClient::performRequest() → OpenAIcURLCallback() → handleNonStreamingResponse() → replaceSelectedText()
Streaming (broken) flow:
askChatGPT() → HTTPClient::performStreamingRequest() → OpenAIStreamCallback() → PostMessage(WM_OPENAI_STREAM_CHUNK) → messageProc() → SCI_REPLACESEL
OpenAIStreamCallbackposts messages withPostMessage(targetWindow, WM_OPENAI_STREAM_CHUNK, 0, (LPARAM)pChunk)messageProcshould receive and handle these messages- Potential issue: message queue overflow or delivery failure
StreamParser::extractContent()might not be extracting content properly- Different API types have different parsing logic
- Completion markers might be terminating stream early
s_streamTargetScintillamight not be set correctly- Editor handle might be invalid when chunks arrive
- HTTP version settings:
CURL_HTTP_VERSION_1_1 - Transfer encoding:
CURLOPT_TRANSFER_ENCODING, 1L - These might not be compatible with all APIs
- Check Status Bar Messages: Debug mode should show chunk reception in status bar
- Verify PostMessage Success: Check if
PostMessagecalls are failing - Verify Message Handler: Ensure
messageProcreceivesWM_OPENAI_STREAM_CHUNK - Check Content Extraction: Verify
StreamParser::extractContent()returns valid content - Test Different API Types: Issue might be API-specific
// In PluginDefinition.cpp, line ~54
bool debugMode = false; // Disable verbose streaming debug- Add fallback to raw chunk content if parsing fails
- Check if completion markers are being triggered too early
- Add error checking for PostMessage failures
- Ensure target window handle is valid
- Try without HTTP/1.1 enforcement
- Remove transfer encoding setting
The issue is probably in the content extraction phase where StreamParser::extractContent() is not properly parsing the streaming response format for your specific API configuration, causing empty content to be posted to the message queue, resulting in no visible output.