mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
Merge pull request #416 from znygugeyx-ctrl/feat/subagent-fork-render
feat: 参考 claude code 官方实现,改进 sub agent 以及 fork agent 的渲染方式
This commit is contained in:
@@ -4,6 +4,7 @@ import * as React from 'react';
|
||||
import { NO_CONTENT_MESSAGE } from '../../constants/messages.js';
|
||||
import {
|
||||
COMMAND_MESSAGE_TAG,
|
||||
FORK_BOILERPLATE_TAG,
|
||||
LOCAL_COMMAND_CAVEAT_TAG,
|
||||
TASK_NOTIFICATION_TAG,
|
||||
TEAMMATE_MESSAGE_TAG,
|
||||
@@ -124,16 +125,21 @@ export function UserTextMessage({
|
||||
}
|
||||
|
||||
// Fork child's first message: collapse the rules/format boilerplate, show
|
||||
// only the directive. FORK_BOILERPLATE_TAG is inlined so the import doesn't
|
||||
// ship in external builds where feature('FORK_SUBAGENT') is false.
|
||||
if (feature('FORK_SUBAGENT')) {
|
||||
if (param.text.includes('<fork-boilerplate>')) {
|
||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||
const { UserForkBoilerplateMessage } =
|
||||
require('./UserForkBoilerplateMessage.js') as typeof import('./UserForkBoilerplateMessage.js');
|
||||
/* eslint-enable @typescript-eslint/no-require-imports */
|
||||
return <UserForkBoilerplateMessage addMargin={addMargin} param={param} />;
|
||||
}
|
||||
// only the user prompt. Independent of FORK_SUBAGENT flag — the fork agent
|
||||
// transcript always needs to render the prompt as a normal user bubble.
|
||||
if (param.text.includes(`<${FORK_BOILERPLATE_TAG}>`)) {
|
||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||
const { UserForkBoilerplateMessage } =
|
||||
require('./UserForkBoilerplateMessage.js') as typeof import('./UserForkBoilerplateMessage.js');
|
||||
/* eslint-enable @typescript-eslint/no-require-imports */
|
||||
return (
|
||||
<UserForkBoilerplateMessage
|
||||
addMargin={addMargin}
|
||||
param={param}
|
||||
isTranscriptMode={isTranscriptMode}
|
||||
timestamp={timestamp}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// Cross-session UDS message (from another Claude session's SendMessage).
|
||||
|
||||
Reference in New Issue
Block a user