Skip to content

Commit cdcf472

Browse files
committed
Merge branch 'master' into 'opensource'
Detailing and effect enhancement See merge request ai_native/DeepVCode/DeepVcodeClient!329
2 parents ed3954e + 53a7a3d commit cdcf472

6 files changed

Lines changed: 36 additions & 46 deletions

File tree

packages/cli/src/ui/components/HealthyUseReminder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface HealthyUseReminderProps {
1515
}
1616

1717
export function HealthyUseReminder({ onDismiss }: HealthyUseReminderProps): React.JSX.Element {
18-
const [countdown, setCountdown] = useState(300); // 300秒倒计时
18+
const [countdown, setCountdown] = useState(60); // 60秒倒计时
1919
const [canDismiss, setCanDismiss] = useState(false);
2020

2121
useEffect(() => {

packages/core/src/core/prompts.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ You are a long-running autonomous coding agent. Execute silently until done or b
4747
4848
1. **NO NARRATION.** Never explain what you're about to do. Never summarize steps. No filler phrases.
4949
2. **EXECUTE FIRST.** Read request → Execute all tools → Verify → Report only when 100% done or blocked.
50-
3. **BATCH AGGRESSIVELY.** Multiple independent operations in ONE function_calls block.
50+
3. **SEQUENTIAL EXECUTION.** Execute tools one by one in separate function_calls blocks. Use batch tool only for 5+ truly independent operations.
5151
4. **OUTPUT BUDGET:** 1-2 sentences max unless user asks for explanation.
5252
5. **SILENT EXECUTION.** Do NOT output any text between tool calls. No progress updates, no intermediate explanations.
5353
@@ -541,10 +541,6 @@ IMPORTANT: Assist with authorized security testing, defensive security, CTF chal
541541
542542
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
543543
544-
If the user asks for help or wants to give feedback inform them of the following:
545-
- /help: Get help with using the CLI
546-
- To give feedback, users should use the /bug command
547-
548544
# Tone and style
549545
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
550546
- Output is displayed on a command line interface. Responses should be short and concise. Use Github-flavored markdown, rendered in monospace font under CommonMark specification.
@@ -830,10 +826,6 @@ When requested to perform tasks like fixing bugs, adding features, refactoring,
830826
- **Remembering Facts:** Use the '${MemoryTool.Name}' tool to remember specific, *user-related* facts or preferences when the user explicitly asks, or when they state a clear, concise piece of information that would help personalize or streamline *your future interactions with them* (e.g., preferred coding style, common project paths they use, personal tool aliases). This tool is for user-specific information that should persist across sessions. Do *not* use it for general project context or information that belongs in project-specific \`GEMINI.md\` files. If unsure whether to save something, you can ask the user, "Should I remember that for you?"
831827
- **Respect User Confirmations:** Most tool calls (also denoted as 'function calls') will first require confirmation from the user, where they will either approve or cancel the function call. If a user cancels a function call, respect their choice and do _not_ try to make the function call again. It is okay to request the tool call again _only_ if the user requests that same tool call on a subsequent prompt. When a user cancels a function call, assume best intentions from the user and consider inquiring if they prefer any alternative paths forward.
832828
833-
## Interaction Details
834-
- **Help Command:** The user can use '/help' to display help information.
835-
- **Feedback:** To report a bug or provide feedback, please use the /bug command.
836-
837829
# Examples (Illustrating Tone and Workflow)
838830
<example>
839831
user: 1 + 2

packages/core/src/tools/batch.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ export class BatchTool extends BaseTool<BatchToolParams, ToolResult> {
2626
super(
2727
BatchTool.Name,
2828
'Batch',
29-
`Execute multiple tools in parallel (or sequentially if dependencies exist, but this implementation runs them sequentially for safety).
29+
`Execute multiple independent tools sequentially.
3030
31-
WHEN TO USE:
32-
- Calling 2+ different tool types together (e.g., read_file + search_file_content + glob)
33-
- Performing 3+ independent operations of the same type
34-
- Gathering information from multiple sources at once
31+
Use this tool ONLY when you need to perform 5+ truly independent operations that have no sequential dependencies. For most cases, prefer individual tool calls in sequence.
3532
36-
WHY USE BATCH:
37-
- JSON format is simpler and less error-prone than nested XML tool calls
38-
- Clearly expresses "these operations are a group"
39-
- Reduces cognitive load when generating multiple tool calls
33+
AVOID using batch for:
34+
- Operations with dependencies (one result feeds into another)
35+
- File edits followed by testing/validation
36+
- Less than 5 independent operations
37+
- Different tool types that may need result inspection between calls
4038
41-
Example: To read a file, search for a pattern, and list files:
39+
Example (when appropriate - 5+ independent file reads):
4240
[
43-
{"tool": "read_file", "parameters": {"absolute_path": "/path/to/file.ts"}},
44-
{"tool": "search_file_content", "parameters": {"pattern": "TODO", "path": "/src"}},
45-
{"tool": "glob", "parameters": {"pattern": "**/*.ts"}}
41+
{"tool": "read_file", "parameters": {"absolute_path": "/path/to/file1.ts"}},
42+
{"tool": "read_file", "parameters": {"absolute_path": "/path/to/file2.ts"}},
43+
{"tool": "read_file", "parameters": {"absolute_path": "/path/to/file3.ts"}},
44+
{"tool": "read_file", "parameters": {"absolute_path": "/path/to/file4.ts"}},
45+
{"tool": "read_file", "parameters": {"absolute_path": "/path/to/file5.ts"}}
4646
]`,
4747
Icon.Tasks,
4848
{

packages/core/src/tools/memoryTool.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ export const MEMORY_SECTION_HEADER = '## DeepV Code Added Memories';
5959
export const DEFAULT_CONTEXT_FILENAMES = [
6060
'AGENTS.md',
6161
'DEEPV.md',
62-
'GEMINI.md',
63-
'CLAUDE.md',
6462
'.augement/*.md',
6563
'.cursor/rules/*.mdc'
6664
];
@@ -100,11 +98,11 @@ export function getAllGeminiMdFilenames(): string[] {
10098
*/
10199
export async function discoverContextFilenames(baseDir: string = path.join(homedir(), GEMINI_CONFIG_DIR)): Promise<string[]> {
102100
const foundFiles = await findContextFilesInDirectory(baseDir, DEFAULT_CONTEXT_FILENAMES);
103-
101+
104102
if (foundFiles.length > 0) {
105103
return [path.basename(foundFiles[0])];
106104
}
107-
105+
108106
return [DEFAULT_CONTEXT_FILENAME];
109107
}
110108

@@ -165,21 +163,21 @@ export const COMMON_IGNORE_PATTERNS = [
165163
*/
166164
async function findContextFilesInDirectory(baseDir: string, filePatterns: string[]): Promise<string[]> {
167165
const foundFiles: string[] = [];
168-
166+
169167
try {
170168
// Ensure directory exists
171169
await fs.mkdir(baseDir, { recursive: true });
172170
} catch (error) {
173171
console.warn(`Warning: failed to create directory ${baseDir}: ${error}`);
174172
return [];
175173
}
176-
174+
177175
for (const pattern of filePatterns) {
178176
if (pattern.includes('*')) {
179177
// Handle glob patterns
180178
try {
181179
const fullPattern = path.join(baseDir, pattern);
182-
const matches = await glob(fullPattern, {
180+
const matches = await glob(fullPattern, {
183181
cwd: baseDir,
184182
absolute: true,
185183
nodir: true,
@@ -195,21 +193,21 @@ async function findContextFilesInDirectory(baseDir: string, filePatterns: string
195193
} else {
196194
// Handle direct file paths
197195
const filePath = path.join(baseDir, pattern);
198-
196+
199197
// Check if the file path matches any ignore patterns
200198
const relativePath = path.relative(baseDir, filePath);
201199
const shouldIgnore = COMMON_IGNORE_PATTERNS.some(ignorePattern => {
202200
// Remove /** suffix for directory matching
203201
const cleanPattern = ignorePattern.replace('/**', '');
204-
return relativePath.startsWith(cleanPattern) ||
202+
return relativePath.startsWith(cleanPattern) ||
205203
relativePath.includes(`/${cleanPattern}/`) ||
206204
relativePath.includes(`\\${cleanPattern}\\`);
207205
});
208-
206+
209207
if (shouldIgnore) {
210208
continue; // Skip this file
211209
}
212-
210+
213211
try {
214212
await fs.access(filePath);
215213
foundFiles.push(filePath);
@@ -219,7 +217,7 @@ async function findContextFilesInDirectory(baseDir: string, filePatterns: string
219217
}
220218
}
221219
}
222-
220+
223221
return foundFiles;
224222
}
225223

@@ -234,22 +232,22 @@ async function discoverProjectContextFilenames(projectDir: string = process.cwd(
234232
// Check if the project directory itself should be ignored
235233
const shouldIgnoreProjectDir = COMMON_IGNORE_PATTERNS.some(ignorePattern => {
236234
const cleanPattern = ignorePattern.replace('/**', '');
237-
return projectDir.includes(`/${cleanPattern}/`) ||
235+
return projectDir.includes(`/${cleanPattern}/`) ||
238236
projectDir.includes(`\\${cleanPattern}\\`) ||
239237
projectDir.endsWith(`/${cleanPattern}`) ||
240238
projectDir.endsWith(`\\${cleanPattern}`);
241239
});
242-
240+
243241
if (shouldIgnoreProjectDir) {
244242
return []; // Don't search in ignored directories
245243
}
246-
244+
247245
const foundFiles = await findContextFilesInDirectory(projectDir, DEFAULT_CONTEXT_FILENAMES);
248-
246+
249247
if (foundFiles.length > 0) {
250248
return [path.basename(foundFiles[0])];
251249
}
252-
250+
253251
return [];
254252
}
255253

packages/vscode-ui-plugin/webview/src/components/HealthyUseReminder.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('HealthyUseReminder', () => {
3232
render(<HealthyUseReminder onDismiss={onDismiss} />);
3333

3434
expect(screen.getByText(/healthy.reminderTitle/i)).toBeDefined();
35-
expect(screen.getByText(/300/i)).toBeDefined();
35+
expect(screen.getByText(/60/i)).toBeDefined();
3636
});
3737

3838
it('should countdown every second', () => {
@@ -42,20 +42,20 @@ describe('HealthyUseReminder', () => {
4242
act(() => {
4343
vi.advanceTimersByTime(1000);
4444
});
45-
expect(screen.getByText(/299/i)).toBeDefined();
45+
expect(screen.getByText(/59/i)).toBeDefined();
4646

4747
act(() => {
4848
vi.advanceTimersByTime(10000);
4949
});
50-
expect(screen.getByText(/289/i)).toBeDefined();
50+
expect(screen.getByText(/49/i)).toBeDefined();
5151
});
5252

5353
it('should show dismiss button as enabled when countdown reaches zero', () => {
5454
const onDismiss = vi.fn();
5555
render(<HealthyUseReminder onDismiss={onDismiss} />);
5656

5757
act(() => {
58-
vi.advanceTimersByTime(300000);
58+
vi.advanceTimersByTime(60000);
5959
});
6060

6161
const button = screen.getByRole('button');
@@ -67,7 +67,7 @@ describe('HealthyUseReminder', () => {
6767
render(<HealthyUseReminder onDismiss={onDismiss} />);
6868

6969
act(() => {
70-
vi.advanceTimersByTime(300000);
70+
vi.advanceTimersByTime(60000);
7171
});
7272

7373
const dismissButton = screen.getByRole('button');

packages/vscode-ui-plugin/webview/src/components/HealthyUseReminder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface HealthyUseReminderProps {
1515

1616
export const HealthyUseReminder: React.FC<HealthyUseReminderProps> = ({ onDismiss }) => {
1717
const { t } = useTranslation();
18-
const [countdown, setCountdown] = useState(300); // 300 seconds cooldown
18+
const [countdown, setCountdown] = useState(60); // 60 seconds cooldown
1919
const [canDismiss, setCanDismiss] = useState(false);
2020

2121
useEffect(() => {

0 commit comments

Comments
 (0)