mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
Simple debug mode for CLI side (#66)
* Adds debug mode config flag. * Wire through debug lines * Add debug mode logging example * Run format * Run format again
This commit is contained in:
parent
99f5ed9ecb
commit
a66ad2e2af
5 changed files with 45 additions and 10 deletions
|
|
@ -49,6 +49,7 @@ export const useGeminiStream = (
|
|||
const [streamingState, setStreamingState] = useState<StreamingState>(
|
||||
StreamingState.Idle,
|
||||
);
|
||||
const [debugMessage, setDebugMessage] = useState<string>('');
|
||||
const [initError, setInitError] = useState<string | null>(null);
|
||||
const abortControllerRef = useRef<AbortController | null>(null);
|
||||
const chatSessionRef = useRef<Chat | null>(null);
|
||||
|
|
@ -104,6 +105,10 @@ export const useGeminiStream = (
|
|||
if (streamingState === StreamingState.Responding) return;
|
||||
if (typeof query === 'string' && query.trim().length === 0) return;
|
||||
|
||||
if (typeof query === 'string') {
|
||||
setDebugMessage(`User query: ${query}`);
|
||||
}
|
||||
|
||||
const userMessageTimestamp = Date.now();
|
||||
const client = geminiClientRef.current;
|
||||
if (!client) {
|
||||
|
|
@ -403,7 +408,7 @@ export const useGeminiStream = (
|
|||
],
|
||||
);
|
||||
|
||||
return { streamingState, submitQuery, initError };
|
||||
return { streamingState, submitQuery, initError, debugMessage };
|
||||
};
|
||||
|
||||
// Define ServerTool interface here if not importing from server (circular dep issue?)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue