mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +00:00
fix: propagate config to AgentExecutionDisplay to fix type errors
This commit is contained in:
parent
acb93b1e1b
commit
f3cf732493
4 changed files with 16 additions and 1 deletions
|
|
@ -106,6 +106,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
|
|||
: 'medium'
|
||||
}
|
||||
renderOutputAsMarkdown={tool.renderOutputAsMarkdown}
|
||||
config={config}
|
||||
/>
|
||||
</Box>
|
||||
{tool.status === ToolCallStatus.Confirming &&
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ const renderWithContext = (
|
|||
};
|
||||
|
||||
describe('<ToolMessage />', () => {
|
||||
const mockConfig = {} as any; // Mock config for tests
|
||||
|
||||
const baseProps: ToolMessageProps = {
|
||||
callId: 'tool-123',
|
||||
name: 'test-tool',
|
||||
|
|
@ -77,6 +79,7 @@ describe('<ToolMessage />', () => {
|
|||
terminalWidth: 80,
|
||||
confirmationDetails: undefined,
|
||||
emphasis: 'medium',
|
||||
config: mockConfig,
|
||||
};
|
||||
|
||||
it('renders basic tool information', () => {
|
||||
|
|
@ -212,6 +215,7 @@ describe('<ToolMessage />', () => {
|
|||
terminalWidth: 80,
|
||||
callId: 'test-call-id-2',
|
||||
confirmationDetails: undefined,
|
||||
config: mockConfig,
|
||||
};
|
||||
|
||||
const { lastFrame } = renderWithContext(
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import { TOOL_STATUS } from '../../constants.js';
|
|||
import type {
|
||||
TodoResultDisplay,
|
||||
TaskResultDisplay,
|
||||
Config,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import { AgentExecutionDisplay } from '../subagents/index.js';
|
||||
|
||||
|
|
@ -108,11 +109,13 @@ const SubagentExecutionRenderer: React.FC<{
|
|||
data: TaskResultDisplay;
|
||||
availableHeight?: number;
|
||||
childWidth: number;
|
||||
}> = ({ data, availableHeight, childWidth }) => (
|
||||
config: Config;
|
||||
}> = ({ data, availableHeight, childWidth, config }) => (
|
||||
<AgentExecutionDisplay
|
||||
data={data}
|
||||
availableHeight={availableHeight}
|
||||
childWidth={childWidth}
|
||||
config={config}
|
||||
/>
|
||||
);
|
||||
|
||||
|
|
@ -175,6 +178,7 @@ export interface ToolMessageProps extends IndividualToolCallDisplay {
|
|||
terminalWidth: number;
|
||||
emphasis?: TextEmphasis;
|
||||
renderOutputAsMarkdown?: boolean;
|
||||
config: Config;
|
||||
}
|
||||
|
||||
export const ToolMessage: React.FC<ToolMessageProps> = ({
|
||||
|
|
@ -186,6 +190,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
|
|||
terminalWidth,
|
||||
emphasis = 'medium',
|
||||
renderOutputAsMarkdown = true,
|
||||
config,
|
||||
}) => {
|
||||
const availableHeight = availableTerminalHeight
|
||||
? Math.max(
|
||||
|
|
@ -229,6 +234,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
|
|||
data={displayRenderer.data}
|
||||
availableHeight={availableHeight}
|
||||
childWidth={childWidth}
|
||||
config={config}
|
||||
/>
|
||||
)}
|
||||
{displayRenderer.type === 'string' && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue