slug エージェントが暴走するのを対処
This commit is contained in:
parent
d185039c73
commit
eb32cf0138
@ -130,6 +130,7 @@ describe('template file existence', () => {
|
||||
'score_interactive_policy',
|
||||
'score_summary_system_prompt',
|
||||
'score_slug_system_prompt',
|
||||
'score_slug_user_prompt',
|
||||
'perform_phase1_message',
|
||||
'perform_phase2_message',
|
||||
'perform_phase3_message',
|
||||
|
||||
@ -63,11 +63,16 @@ describe('summarizeTaskName', () => {
|
||||
// Then
|
||||
expect(result).toBe('add-auth');
|
||||
expect(mockGetProvider).toHaveBeenCalledWith('claude');
|
||||
const callPrompt = mockProviderCall.mock.calls[0]?.[0];
|
||||
expect(callPrompt).toContain('Generate a slug from the task description below.');
|
||||
expect(callPrompt).toContain('<task_description>');
|
||||
expect(callPrompt).toContain('long task name for testing');
|
||||
expect(callPrompt).toContain('</task_description>');
|
||||
expect(mockProviderCall).toHaveBeenCalledWith(
|
||||
'long task name for testing',
|
||||
expect.any(String),
|
||||
expect.objectContaining({
|
||||
cwd: '/project',
|
||||
allowedTools: [],
|
||||
permissionMode: 'readonly',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@ -70,10 +70,11 @@ export class TaskSummarizer {
|
||||
name: 'summarizer',
|
||||
systemPrompt: loadTemplate('score_slug_system_prompt', 'en'),
|
||||
});
|
||||
const response = await agent.call(taskName, {
|
||||
const prompt = loadTemplate('score_slug_user_prompt', 'en', { taskDescription: taskName });
|
||||
const response = await agent.call(prompt, {
|
||||
cwd: options.cwd,
|
||||
model,
|
||||
allowedTools: [],
|
||||
permissionMode: 'readonly',
|
||||
});
|
||||
|
||||
const slug = sanitizeSlug(response.content);
|
||||
|
||||
12
src/shared/prompts/en/score_slug_user_prompt.md
Normal file
12
src/shared/prompts/en/score_slug_user_prompt.md
Normal file
@ -0,0 +1,12 @@
|
||||
<!--
|
||||
template: score_slug_user_prompt
|
||||
role: user prompt for task-name-to-slug generation
|
||||
vars: taskDescription
|
||||
caller: infra/task/summarize
|
||||
-->
|
||||
Generate a slug from the task description below.
|
||||
Output ONLY the slug text.
|
||||
|
||||
<task_description>
|
||||
{{taskDescription}}
|
||||
</task_description>
|
||||
12
src/shared/prompts/ja/score_slug_user_prompt.md
Normal file
12
src/shared/prompts/ja/score_slug_user_prompt.md
Normal file
@ -0,0 +1,12 @@
|
||||
<!--
|
||||
template: score_slug_user_prompt
|
||||
role: user prompt for task-name-to-slug generation
|
||||
vars: taskDescription
|
||||
caller: infra/task/summarize
|
||||
-->
|
||||
Generate a slug from the task description below.
|
||||
Output ONLY the slug text.
|
||||
|
||||
<task_description>
|
||||
{{taskDescription}}
|
||||
</task_description>
|
||||
Loading…
x
Reference in New Issue
Block a user