diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d511fe..66599ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.3.3] - 2026-01-31 + +### Fixed + +- `takt add #N` がIssue内容をAI要約に通してしまい、タスク内容が壊れる問題を修正 (#46) + - Issue参照時は `resolveIssueTask` の結果をそのままタスクとして使用するように変更 + ## [0.3.1] - 2026-01-31 ### Added diff --git a/src/__tests__/addTask.test.ts b/src/__tests__/addTask.test.ts index 4d00009..063883a 100644 --- a/src/__tests__/addTask.test.ts +++ b/src/__tests__/addTask.test.ts @@ -291,15 +291,11 @@ describe('addTask', () => { expect(content).not.toContain('workflow:'); }); - it('should fetch issue and summarize with AI when given issue reference', async () => { + it('should fetch issue and use directly as task content when given issue reference', async () => { // Given: issue reference "#99" const issueText = 'Issue #99: Fix login timeout\n\nThe login page times out after 30 seconds.'; - const summarized = '# ログインタイムアウト修正\nログインページの30秒タイムアウトを修正する'; mockResolveIssueTask.mockReturnValue(issueText); - const mockProviderCall = vi.fn().mockResolvedValue({ content: summarized }); - mockGetProvider.mockReturnValue({ call: mockProviderCall } as any); - mockSummarizeTaskName.mockResolvedValue('fix-login-timeout'); mockConfirm.mockResolvedValue(false); mockListWorkflows.mockReturnValue([]); @@ -313,29 +309,16 @@ describe('addTask', () => { // Then: resolveIssueTask was called expect(mockResolveIssueTask).toHaveBeenCalledWith('#99'); - // Then: summarizeConversation was called with issue text - expect(mockProviderCall).toHaveBeenCalledWith( - 'task-summarizer', - issueText, - expect.objectContaining({ - cwd: testDir, - maxTurns: 1, - allowedTools: [], - }), - ); - - // Then: task file created with summarized content + // Then: task file created with issue text directly (no AI summarization) const taskFile = path.join(testDir, '.takt', 'tasks', 'fix-login-timeout.yaml'); expect(fs.existsSync(taskFile)).toBe(true); const content = fs.readFileSync(taskFile, 'utf-8'); - expect(content).toContain('ログインタイムアウト修正'); + expect(content).toContain('Fix login timeout'); }); - it('should proceed to worktree/workflow settings after issue summarization', async () => { + it('should proceed to worktree/workflow settings after issue fetch', async () => { // Given: issue with worktree enabled mockResolveIssueTask.mockReturnValue('Issue text'); - const mockProviderCall = vi.fn().mockResolvedValue({ content: 'Summarized issue' }); - mockGetProvider.mockReturnValue({ call: mockProviderCall } as any); mockSummarizeTaskName.mockResolvedValue('issue-task'); mockConfirm.mockResolvedValue(true); mockPromptInput.mockResolvedValue(''); diff --git a/src/commands/addTask.ts b/src/commands/addTask.ts index f18e46c..357d8ab 100644 --- a/src/commands/addTask.ts +++ b/src/commands/addTask.ts @@ -82,18 +82,16 @@ export async function addTask(cwd: string, task?: string): Promise { let taskContent: string; if (task && isIssueReference(task)) { - // Issue reference: fetch issue and summarize with AI + // Issue reference: fetch issue and use directly as task content info('Fetching GitHub Issue...'); - let issueText: string; try { - issueText = resolveIssueTask(task); + taskContent = resolveIssueTask(task); } catch (e) { const msg = e instanceof Error ? e.message : String(e); log.error('Failed to fetch GitHub Issue', { task, error: msg }); info(`Failed to fetch issue ${task}: ${msg}`); return; } - taskContent = await summarizeConversation(cwd, issueText); } else { // Interactive mode: AI conversation to refine task const result = await interactiveMode(cwd);