From 665b5187be199338e6a7782443cba3d9435d880f Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Tue, 27 Jan 2026 10:36:11 +0900 Subject: [PATCH] =?UTF-8?q?-r=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92Omit=E3=81=97=E3=80=81=E3=83=87=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=AB=E3=83=88=E3=82=92=E4=BC=9A=E8=A9=B1=E7=B6=99=E7=B6=9A?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli.ts | 13 +++++-------- src/commands/help.ts | 12 ++++-------- src/commands/index.ts | 2 +- src/commands/taskExecution.ts | 16 ++-------------- src/commands/workflowExecution.ts | 20 ++++++++------------ 5 files changed, 20 insertions(+), 43 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 17f0443..8ca706a 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -4,11 +4,10 @@ * TAKT CLI - Task Agent Koordination Tool * * Usage: - * takt {task} - Execute task with current workflow (new session) - * takt -r {task} - Execute task, resuming previous session + * takt {task} - Execute task with current workflow (continues session) * takt /run-tasks - Run all pending tasks from .takt/tasks/ * takt /switch - Switch workflow interactively - * takt /clear - Clear agent conversation sessions + * takt /clear - Clear agent conversation sessions (reset to initial state) * takt /help - Show help * takt /config - Select permission mode interactively */ @@ -46,9 +45,7 @@ program program .argument('[task]', 'Task to execute or slash command') - .option('-r, --resume', 'Resume previous session (continue agent conversations)') - .action(async (task, options: { resume?: boolean }) => { - const resumeSession = options.resume ?? false; + .action(async (task) => { const cwd = resolve(process.cwd()); // Initialize global directories first @@ -150,8 +147,8 @@ program ); } - log.info('Starting task execution', { task, workflow: selectedWorkflow, resumeSession }); - const taskSuccess = await executeTask(task, cwd, selectedWorkflow, { resumeSession }); + log.info('Starting task execution', { task, workflow: selectedWorkflow }); + const taskSuccess = await executeTask(task, cwd, selectedWorkflow); if (!taskSuccess) { process.exit(1); } diff --git a/src/commands/help.ts b/src/commands/help.ts index 455f275..b318e88 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -13,19 +13,15 @@ export function showHelp(): void { console.log(` Usage: - takt {task} Execute task with current workflow (new session) - takt -r {task} Execute task, resuming previous agent sessions + takt {task} Execute task with current workflow (continues session) takt /run-tasks Run all pending tasks from .takt/tasks/ takt /switch Switch workflow interactively - takt /clear Clear agent conversation sessions + takt /clear Clear agent conversation sessions (reset to initial state) takt /help Show this help -Options: - -r, --resume Resume previous session (continue agent conversations) - Examples: - takt "Fix the bug in main.ts" # Start fresh - takt -r "Continue the fix" # Resume previous session + takt "Fix the bug in main.ts" # Execute task (continues session) + takt /clear # Clear sessions, start fresh takt /switch takt /run-tasks diff --git a/src/commands/index.ts b/src/commands/index.ts index eab8eba..e8fff32 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -3,7 +3,7 @@ */ export { executeWorkflow, type WorkflowExecutionResult, type WorkflowExecutionOptions } from './workflowExecution.js'; -export { executeTask, runAllTasks, type ExecuteTaskOptions } from './taskExecution.js'; +export { executeTask, runAllTasks } from './taskExecution.js'; export { showHelp } from './help.js'; export { withAgentSession } from './session.js'; export { switchWorkflow } from './workflow.js'; diff --git a/src/commands/taskExecution.ts b/src/commands/taskExecution.ts index c277bc8..a7926d6 100644 --- a/src/commands/taskExecution.ts +++ b/src/commands/taskExecution.ts @@ -18,23 +18,14 @@ import { DEFAULT_WORKFLOW_NAME } from '../constants.js'; const log = createLogger('task'); -/** Options for task execution */ -export interface ExecuteTaskOptions { - /** Resume previous session instead of starting fresh */ - resumeSession?: boolean; -} - /** * Execute a single task with workflow */ export async function executeTask( task: string, cwd: string, - workflowName: string = DEFAULT_WORKFLOW_NAME, - options: ExecuteTaskOptions = {} + workflowName: string = DEFAULT_WORKFLOW_NAME ): Promise { - const { resumeSession = false } = options; - const workflowConfig = loadWorkflow(workflowName); if (!workflowConfig) { @@ -47,12 +38,9 @@ export async function executeTask( log.debug('Running workflow', { name: workflowConfig.name, steps: workflowConfig.steps.map(s => s.name), - resumeSession, }); - const result = await executeWorkflow(workflowConfig, task, cwd, { - resumeSession, - }); + const result = await executeWorkflow(workflowConfig, task, cwd); return result.success; } diff --git a/src/commands/workflowExecution.ts b/src/commands/workflowExecution.ts index b911b34..edb1c2b 100644 --- a/src/commands/workflowExecution.ts +++ b/src/commands/workflowExecution.ts @@ -5,7 +5,7 @@ import { WorkflowEngine } from '../workflow/engine.js'; import type { WorkflowConfig } from '../models/types.js'; import type { IterationLimitRequest } from '../workflow/types.js'; -import { loadAgentSessions, updateAgentSession, clearAgentSessions } from '../config/paths.js'; +import { loadAgentSessions, updateAgentSession } from '../config/paths.js'; import { header, info, @@ -54,8 +54,6 @@ export interface WorkflowExecutionResult { /** Options for workflow execution */ export interface WorkflowExecutionOptions { - /** Resume previous session instead of starting fresh */ - resumeSession?: boolean; /** Header prefix for display */ headerPrefix?: string; } @@ -70,19 +68,13 @@ export async function executeWorkflow( options: WorkflowExecutionOptions = {} ): Promise { const { - resumeSession = false, headerPrefix = 'Running Workflow:', } = options; - // Clear previous sessions if not resuming - if (!resumeSession) { - log.debug('Starting fresh session (clearing previous agent sessions)'); - clearAgentSessions(cwd); - } else { - log.debug('Resuming previous session'); - } + // Always continue from previous sessions (use /clear to reset) + log.debug('Continuing session (use /clear to reset)'); - header(`${headerPrefix} ${workflowConfig.name}${resumeSession ? ' (resuming)' : ''}`); + header(`${headerPrefix} ${workflowConfig.name}`); const workflowSessionId = generateSessionId(); const sessionLog = createSessionLog(task, cwd, workflowConfig.name); @@ -170,6 +162,7 @@ export async function executeWorkflow( step: step.name, status: response.status, contentLength: response.content.length, + sessionId: response.sessionId, }); if (displayRef.current) { displayRef.current.flush(); @@ -177,6 +170,9 @@ export async function executeWorkflow( } console.log(); status('Status', response.status); + if (response.sessionId) { + status('Session', response.sessionId); + } addToSessionLog(sessionLog, step.name, response); });