mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: propagate config to AgentExecutionDisplay to fix type errors
This commit is contained in:
@@ -106,6 +106,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
|
|||||||
: 'medium'
|
: 'medium'
|
||||||
}
|
}
|
||||||
renderOutputAsMarkdown={tool.renderOutputAsMarkdown}
|
renderOutputAsMarkdown={tool.renderOutputAsMarkdown}
|
||||||
|
config={config}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
{tool.status === ToolCallStatus.Confirming &&
|
{tool.status === ToolCallStatus.Confirming &&
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ const renderWithContext = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
describe('<ToolMessage />', () => {
|
describe('<ToolMessage />', () => {
|
||||||
|
const mockConfig = {} as any; // Mock config for tests
|
||||||
|
|
||||||
const baseProps: ToolMessageProps = {
|
const baseProps: ToolMessageProps = {
|
||||||
callId: 'tool-123',
|
callId: 'tool-123',
|
||||||
name: 'test-tool',
|
name: 'test-tool',
|
||||||
@@ -77,6 +79,7 @@ describe('<ToolMessage />', () => {
|
|||||||
terminalWidth: 80,
|
terminalWidth: 80,
|
||||||
confirmationDetails: undefined,
|
confirmationDetails: undefined,
|
||||||
emphasis: 'medium',
|
emphasis: 'medium',
|
||||||
|
config: mockConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
it('renders basic tool information', () => {
|
it('renders basic tool information', () => {
|
||||||
@@ -212,6 +215,7 @@ describe('<ToolMessage />', () => {
|
|||||||
terminalWidth: 80,
|
terminalWidth: 80,
|
||||||
callId: 'test-call-id-2',
|
callId: 'test-call-id-2',
|
||||||
confirmationDetails: undefined,
|
confirmationDetails: undefined,
|
||||||
|
config: mockConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
const { lastFrame } = renderWithContext(
|
const { lastFrame } = renderWithContext(
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { TOOL_STATUS } from '../../constants.js';
|
|||||||
import type {
|
import type {
|
||||||
TodoResultDisplay,
|
TodoResultDisplay,
|
||||||
TaskResultDisplay,
|
TaskResultDisplay,
|
||||||
|
Config,
|
||||||
} from '@qwen-code/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { AgentExecutionDisplay } from '../subagents/index.js';
|
import { AgentExecutionDisplay } from '../subagents/index.js';
|
||||||
|
|
||||||
@@ -108,11 +109,13 @@ const SubagentExecutionRenderer: React.FC<{
|
|||||||
data: TaskResultDisplay;
|
data: TaskResultDisplay;
|
||||||
availableHeight?: number;
|
availableHeight?: number;
|
||||||
childWidth: number;
|
childWidth: number;
|
||||||
}> = ({ data, availableHeight, childWidth }) => (
|
config: Config;
|
||||||
|
}> = ({ data, availableHeight, childWidth, config }) => (
|
||||||
<AgentExecutionDisplay
|
<AgentExecutionDisplay
|
||||||
data={data}
|
data={data}
|
||||||
availableHeight={availableHeight}
|
availableHeight={availableHeight}
|
||||||
childWidth={childWidth}
|
childWidth={childWidth}
|
||||||
|
config={config}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -175,6 +178,7 @@ export interface ToolMessageProps extends IndividualToolCallDisplay {
|
|||||||
terminalWidth: number;
|
terminalWidth: number;
|
||||||
emphasis?: TextEmphasis;
|
emphasis?: TextEmphasis;
|
||||||
renderOutputAsMarkdown?: boolean;
|
renderOutputAsMarkdown?: boolean;
|
||||||
|
config: Config;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ToolMessage: React.FC<ToolMessageProps> = ({
|
export const ToolMessage: React.FC<ToolMessageProps> = ({
|
||||||
@@ -186,6 +190,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
|
|||||||
terminalWidth,
|
terminalWidth,
|
||||||
emphasis = 'medium',
|
emphasis = 'medium',
|
||||||
renderOutputAsMarkdown = true,
|
renderOutputAsMarkdown = true,
|
||||||
|
config,
|
||||||
}) => {
|
}) => {
|
||||||
const availableHeight = availableTerminalHeight
|
const availableHeight = availableTerminalHeight
|
||||||
? Math.max(
|
? Math.max(
|
||||||
@@ -229,6 +234,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
|
|||||||
data={displayRenderer.data}
|
data={displayRenderer.data}
|
||||||
availableHeight={availableHeight}
|
availableHeight={availableHeight}
|
||||||
childWidth={childWidth}
|
childWidth={childWidth}
|
||||||
|
config={config}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{displayRenderer.type === 'string' && (
|
{displayRenderer.type === 'string' && (
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { Colors } from '../../../colors.js';
|
|||||||
import type {
|
import type {
|
||||||
TaskResultDisplay,
|
TaskResultDisplay,
|
||||||
SubagentStatsSummary,
|
SubagentStatsSummary,
|
||||||
|
Config,
|
||||||
} from '@qwen-code/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { theme } from '../../../semantic-colors.js';
|
import { theme } from '../../../semantic-colors.js';
|
||||||
import { useKeypress } from '../../../hooks/useKeypress.js';
|
import { useKeypress } from '../../../hooks/useKeypress.js';
|
||||||
@@ -23,6 +24,7 @@ export interface AgentExecutionDisplayProps {
|
|||||||
data: TaskResultDisplay;
|
data: TaskResultDisplay;
|
||||||
availableHeight?: number;
|
availableHeight?: number;
|
||||||
childWidth?: number;
|
childWidth?: number;
|
||||||
|
config: Config;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStatusColor = (
|
const getStatusColor = (
|
||||||
@@ -76,6 +78,7 @@ export const AgentExecutionDisplay: React.FC<AgentExecutionDisplayProps> = ({
|
|||||||
data,
|
data,
|
||||||
availableHeight,
|
availableHeight,
|
||||||
childWidth,
|
childWidth,
|
||||||
|
config,
|
||||||
}) => {
|
}) => {
|
||||||
const [displayMode, setDisplayMode] = React.useState<DisplayMode>('default');
|
const [displayMode, setDisplayMode] = React.useState<DisplayMode>('default');
|
||||||
|
|
||||||
@@ -152,6 +155,7 @@ export const AgentExecutionDisplay: React.FC<AgentExecutionDisplayProps> = ({
|
|||||||
<Box flexDirection="column">
|
<Box flexDirection="column">
|
||||||
<ToolConfirmationMessage
|
<ToolConfirmationMessage
|
||||||
confirmationDetails={data.pendingConfirmation}
|
confirmationDetails={data.pendingConfirmation}
|
||||||
|
config={config}
|
||||||
isFocused={true}
|
isFocused={true}
|
||||||
availableTerminalHeight={availableHeight}
|
availableTerminalHeight={availableHeight}
|
||||||
terminalWidth={childWidth ?? 80}
|
terminalWidth={childWidth ?? 80}
|
||||||
|
|||||||
Reference in New Issue
Block a user