mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 23:42:03 +00:00
refactor: streamline debug logging and remove Notifications component
- Remove verbose tool execution debug logs to reduce noise - Add debug logging for config initialization phases - Add comprehensive debug logging for skill loading/management - Add rate limiting for QwenLogger network error logs - Remove Notifications component from DefaultAppLayout - Update tests to reflect UI changes and logging behavior Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
9b524a59c1
commit
846cc75f10
13 changed files with 154 additions and 55 deletions
|
|
@ -66,7 +66,6 @@ describe('App', () => {
|
|||
);
|
||||
|
||||
expect(lastFrame()).toContain('MainContent');
|
||||
expect(lastFrame()).toContain('Notifications');
|
||||
expect(lastFrame()).toContain('Composer');
|
||||
});
|
||||
|
||||
|
|
@ -98,7 +97,6 @@ describe('App', () => {
|
|||
);
|
||||
|
||||
expect(lastFrame()).toContain('MainContent');
|
||||
expect(lastFrame()).toContain('Notifications');
|
||||
expect(lastFrame()).toContain('DialogManager');
|
||||
});
|
||||
|
||||
|
|
@ -157,6 +155,6 @@ describe('App', () => {
|
|||
</UIStateContext.Provider>,
|
||||
);
|
||||
|
||||
expect(lastFrame()).toContain('MainContent\nNotifications\nComposer');
|
||||
expect(lastFrame()).toContain('MainContent\nComposer');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,10 +7,12 @@
|
|||
import { Box, Static } from 'ink';
|
||||
import { HistoryItemDisplay } from './HistoryItemDisplay.js';
|
||||
import { ShowMoreLines } from './ShowMoreLines.js';
|
||||
import { Notifications } from './Notifications.js';
|
||||
import { OverflowProvider } from '../contexts/OverflowContext.js';
|
||||
import { useUIState } from '../contexts/UIStateContext.js';
|
||||
import { useAppContext } from '../contexts/AppContext.js';
|
||||
import { AppHeader } from './AppHeader.js';
|
||||
import { DebugModeNotification } from './DebugModeNotification.js';
|
||||
|
||||
// Limit Gemini messages to a very high number of lines to mitigate performance
|
||||
// issues in the worst case if we somehow get an enormous response from Gemini.
|
||||
|
|
@ -35,6 +37,8 @@ export const MainContent = () => {
|
|||
key={uiState.historyRemountKey}
|
||||
items={[
|
||||
<AppHeader key="app-header" version={version} />,
|
||||
<DebugModeNotification key="debug-notification" />,
|
||||
<Notifications key="notifications" />,
|
||||
...uiState.history.map((h) => (
|
||||
<HistoryItemDisplay
|
||||
terminalWidth={terminalWidth}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import { useAppContext } from '../contexts/AppContext.js';
|
|||
import { useUIState } from '../contexts/UIStateContext.js';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
import { StreamingState } from '../types.js';
|
||||
import { DebugModeNotification } from './DebugModeNotification.js';
|
||||
import { UpdateNotification } from './UpdateNotification.js';
|
||||
|
||||
export const Notifications = () => {
|
||||
|
|
@ -23,7 +22,6 @@ export const Notifications = () => {
|
|||
return (
|
||||
<>
|
||||
{updateInfo && <UpdateNotification message={updateInfo.message} />}
|
||||
<DebugModeNotification />
|
||||
{showStartupWarnings && (
|
||||
<Box
|
||||
borderStyle="round"
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ export const useGeminiStream = (
|
|||
|
||||
if (typeof query === 'string') {
|
||||
const trimmedQuery = query.trim();
|
||||
onDebugMessage(`User query: '${trimmedQuery}'`);
|
||||
onDebugMessage(`Received user query (${trimmedQuery.length} chars)`);
|
||||
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
|
||||
|
||||
// Handle UI-only commands first
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
import type React from 'react';
|
||||
import { Box } from 'ink';
|
||||
import { Notifications } from '../components/Notifications.js';
|
||||
import { MainContent } from '../components/MainContent.js';
|
||||
import { DialogManager } from '../components/DialogManager.js';
|
||||
import { Composer } from '../components/Composer.js';
|
||||
|
|
@ -23,8 +22,6 @@ export const DefaultAppLayout: React.FC = () => {
|
|||
<MainContent />
|
||||
|
||||
<Box flexDirection="column" ref={uiState.mainControlsRef}>
|
||||
<Notifications />
|
||||
|
||||
{uiState.dialogsVisible ? (
|
||||
<Box marginX={2} flexDirection="column" width={uiState.mainAreaWidth}>
|
||||
<DialogManager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue