fix: Add run_in_background=false to all agent Task invocations

Ensure all agent executions wait for results before proceeding.
Modified 20 workflow command files with 32 Task call updates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-18 10:00:22 +08:00
parent ae07df612d
commit 4329bd8e80
20 changed files with 36 additions and 5 deletions

View File

@@ -81,6 +81,7 @@ ELSE:
**Framework-Based Analysis** (when guidance-specification.md exists): **Framework-Based Analysis** (when guidance-specification.md exists):
```bash ```bash
Task(subagent_type="conceptual-planning-agent", Task(subagent_type="conceptual-planning-agent",
run_in_background=false,
prompt="Generate API designer analysis addressing topic framework prompt="Generate API designer analysis addressing topic framework
## Framework Integration Required ## Framework Integration Required
@@ -136,6 +137,7 @@ Task(subagent_type="conceptual-planning-agent",
# For existing analysis updates # For existing analysis updates
IF update_mode = "incremental": IF update_mode = "incremental":
Task(subagent_type="conceptual-planning-agent", Task(subagent_type="conceptual-planning-agent",
run_in_background=false,
prompt="Update existing API designer analysis prompt="Update existing API designer analysis
## Current Analysis Context ## Current Analysis Context

View File

@@ -128,6 +128,7 @@ for (let i = 0; i < allQuestions.length; i += BATCH_SIZE) {
```javascript ```javascript
Task( Task(
subagent_type="context-search-agent", subagent_type="context-search-agent",
run_in_background=false,
description="Gather project context for brainstorm", description="Gather project context for brainstorm",
prompt=` prompt=`
Execute context-search-agent in BRAINSTORM MODE (Phase 1-2 only). Execute context-search-agent in BRAINSTORM MODE (Phase 1-2 only).

View File

@@ -81,6 +81,7 @@ ELSE:
**Framework-Based Analysis** (when guidance-specification.md exists): **Framework-Based Analysis** (when guidance-specification.md exists):
```bash ```bash
Task(subagent_type="conceptual-planning-agent", Task(subagent_type="conceptual-planning-agent",
run_in_background=false,
prompt="Generate system architect analysis addressing topic framework prompt="Generate system architect analysis addressing topic framework
## Framework Integration Required ## Framework Integration Required
@@ -136,6 +137,7 @@ Task(subagent_type="conceptual-planning-agent",
# For existing analysis updates # For existing analysis updates
IF update_mode = "incremental": IF update_mode = "incremental":
Task(subagent_type="conceptual-planning-agent", Task(subagent_type="conceptual-planning-agent",
run_in_background=false,
prompt="Update existing system architect analysis prompt="Update existing system architect analysis
## Current Analysis Context ## Current Analysis Context

View File

@@ -380,6 +380,7 @@ TodoWrite({
```bash ```bash
Task(subagent_type="{meta.agent}", Task(subagent_type="{meta.agent}",
run_in_background=false,
prompt="Execute task: {task.title} prompt="Execute task: {task.title}
{[FLOW_CONTROL]} {[FLOW_CONTROL]}

View File

@@ -86,6 +86,7 @@ bash(cp .workflow/project.json .workflow/project.json.backup)
```javascript ```javascript
Task( Task(
subagent_type="cli-explore-agent", subagent_type="cli-explore-agent",
run_in_background=false,
description="Deep project analysis", description="Deep project analysis",
prompt=` prompt=`
Analyze project for workflow initialization and generate .workflow/project.json. Analyze project for workflow initialization and generate .workflow/project.json.

View File

@@ -333,6 +333,7 @@ Complete each task according to its "Done when" checklist.
Task( Task(
subagent_type="code-developer", subagent_type="code-developer",
run_in_background=false,
description=batch.taskSummary, description=batch.taskSummary,
prompt=formatBatchPrompt({ prompt=formatBatchPrompt({
tasks: batch.tasks, tasks: batch.tasks,

View File

@@ -164,6 +164,7 @@ Launching ${selectedAngles.length} parallel diagnoses...
const diagnosisTasks = selectedAngles.map((angle, index) => const diagnosisTasks = selectedAngles.map((angle, index) =>
Task( Task(
subagent_type="cli-explore-agent", subagent_type="cli-explore-agent",
run_in_background=false,
description=`Diagnose: ${angle}`, description=`Diagnose: ${angle}`,
prompt=` prompt=`
## Task Objective ## Task Objective
@@ -400,6 +401,7 @@ Write(`${sessionFolder}/fix-plan.json`, JSON.stringify(fixPlan, null, 2))
```javascript ```javascript
Task( Task(
subagent_type="cli-lite-planning-agent", subagent_type="cli-lite-planning-agent",
run_in_background=false,
description="Generate detailed fix plan", description="Generate detailed fix plan",
prompt=` prompt=`
Generate fix plan and write fix-plan.json. Generate fix plan and write fix-plan.json.

View File

@@ -388,6 +388,7 @@ Write(`${sessionFolder}/plan.json`, JSON.stringify(plan, null, 2))
```javascript ```javascript
Task( Task(
subagent_type="cli-lite-planning-agent", subagent_type="cli-lite-planning-agent",
run_in_background=false,
description="Generate detailed implementation plan", description="Generate detailed implementation plan",
prompt=` prompt=`
Generate implementation plan and write plan.json. Generate implementation plan and write plan.json.
@@ -432,10 +433,11 @@ Generate plan.json following the schema obtained above. Key constraints:
## Execution ## Execution
1. Read schema file (cat command above) 1. Read schema file (cat command above)
2. Read ALL exploration files for comprehensive context 2. Execute CLI planning using Gemini (Qwen fallback)
3. Synthesize findings and generate plan following schema 3. Read ALL exploration files for comprehensive context
4. Write JSON: Write('${sessionFolder}/plan.json', jsonContent) 4. Synthesize findings and generate plan following schema
5. Return brief completion summary 5. Write JSON: Write('${sessionFolder}/plan.json', jsonContent)
6. Return brief completion summary
` `
) )
``` ```

View File

@@ -391,6 +391,7 @@ done
```javascript ```javascript
Task( Task(
subagent_type="cli-explore-agent", subagent_type="cli-explore-agent",
run_in_background=false,
description=`Execute ${dimension} review analysis via Deep Scan`, description=`Execute ${dimension} review analysis via Deep Scan`,
prompt=` prompt=`
## Task Objective ## Task Objective
@@ -476,6 +477,7 @@ Task(
```javascript ```javascript
Task( Task(
subagent_type="cli-explore-agent", subagent_type="cli-explore-agent",
run_in_background=false,
description=`Deep-dive analysis for critical finding: ${findingTitle} via Dependency Map + Deep Scan`, description=`Deep-dive analysis for critical finding: ${findingTitle} via Dependency Map + Deep Scan`,
prompt=` prompt=`
## Task Objective ## Task Objective

View File

@@ -401,6 +401,7 @@ git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u
```javascript ```javascript
Task( Task(
subagent_type="cli-explore-agent", subagent_type="cli-explore-agent",
run_in_background=false,
description=`Execute ${dimension} review analysis via Deep Scan`, description=`Execute ${dimension} review analysis via Deep Scan`,
prompt=` prompt=`
## Task Objective ## Task Objective
@@ -487,6 +488,7 @@ Task(
```javascript ```javascript
Task( Task(
subagent_type="cli-explore-agent", subagent_type="cli-explore-agent",
run_in_background=false,
description=`Deep-dive analysis for critical finding: ${findingTitle} via Dependency Map + Deep Scan`, description=`Deep-dive analysis for critical finding: ${findingTitle} via Dependency Map + Deep Scan`,
prompt=` prompt=`
## Task Objective ## Task Objective

View File

@@ -70,6 +70,7 @@ Invoke `universal-executor` agent to analyze session and prepare archive metadat
``` ```
Task( Task(
subagent_type="universal-executor", subagent_type="universal-executor",
run_in_background=false,
description="Analyze session for archival", description="Analyze session for archival",
prompt=` prompt=`
Analyze workflow session for archival preparation. Session is STILL in active location. Analyze workflow session for archival preparation. Session is STILL in active location.

View File

@@ -221,6 +221,7 @@ return "conservative";
```javascript ```javascript
Task( Task(
subagent_type="cli-planning-agent", subagent_type="cli-planning-agent",
run_in_background=false,
description=`Analyze test failures (iteration ${N}) - ${strategy} strategy`, description=`Analyze test failures (iteration ${N}) - ${strategy} strategy`,
prompt=` prompt=`
## Task Objective ## Task Objective
@@ -271,6 +272,7 @@ Task(
```javascript ```javascript
Task( Task(
subagent_type="test-fix-agent", subagent_type="test-fix-agent",
run_in_background=false,
description=`Execute ${task.meta.type}: ${task.title}`, description=`Execute ${task.meta.type}: ${task.title}`,
prompt=` prompt=`
## Task Objective ## Task Objective

View File

@@ -108,7 +108,7 @@ Phase 4: Apply Modifications
**Agent Delegation**: **Agent Delegation**:
```javascript ```javascript
Task(subagent_type="cli-execution-agent", prompt=` Task(subagent_type="cli-execution-agent", run_in_background=false, prompt=`
## Context ## Context
- Session: {session_id} - Session: {session_id}
- Risk: {conflict_risk} - Risk: {conflict_risk}

View File

@@ -121,6 +121,7 @@ const sessionFolder = `.workflow/active/${session_id}/.process`;
const explorationTasks = selectedAngles.map((angle, index) => const explorationTasks = selectedAngles.map((angle, index) =>
Task( Task(
subagent_type="cli-explore-agent", subagent_type="cli-explore-agent",
run_in_background=false,
description=`Explore: ${angle}`, description=`Explore: ${angle}`,
prompt=` prompt=`
## Task Objective ## Task Objective
@@ -215,6 +216,7 @@ Write(`${sessionFolder}/explorations-manifest.json`, JSON.stringify(explorationM
```javascript ```javascript
Task( Task(
subagent_type="context-search-agent", subagent_type="context-search-agent",
run_in_background=false,
description="Gather comprehensive context for plan", description="Gather comprehensive context for plan",
prompt=` prompt=`
## Execution Mode ## Execution Mode

View File

@@ -218,6 +218,7 @@ const userConfig = {
```javascript ```javascript
Task( Task(
subagent_type="action-planning-agent", subagent_type="action-planning-agent",
run_in_background=false,
description="Generate planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md)", description="Generate planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md)",
prompt=` prompt=`
## TASK OBJECTIVE ## TASK OBJECTIVE
@@ -344,6 +345,7 @@ Hard Constraints:
const planningTasks = modules.map(module => const planningTasks = modules.map(module =>
Task( Task(
subagent_type="action-planning-agent", subagent_type="action-planning-agent",
run_in_background=false,
description=`Generate ${module.name} module task JSONs`, description=`Generate ${module.name} module task JSONs`,
prompt=` prompt=`
## TASK OBJECTIVE ## TASK OBJECTIVE
@@ -424,6 +426,7 @@ const moduleResults = await Promise.all(planningTasks);
// Launch +1 Coordinator Agent // Launch +1 Coordinator Agent
Task( Task(
subagent_type="action-planning-agent", subagent_type="action-planning-agent",
run_in_background=false,
description="Integrate module tasks and generate unified documents", description="Integrate module tasks and generate unified documents",
prompt=` prompt=`
## TASK OBJECTIVE ## TASK OBJECTIVE

View File

@@ -194,6 +194,7 @@ const templatePath = hasCliExecuteFlag
```javascript ```javascript
Task( Task(
subagent_type="action-planning-agent", subagent_type="action-planning-agent",
run_in_background=false,
description="Generate TDD task JSON and implementation plan", description="Generate TDD task JSON and implementation plan",
prompt=` prompt=`
## Execution Context ## Execution Context

View File

@@ -76,6 +76,7 @@ Phase 3: Output Validation (Command)
```javascript ```javascript
Task( Task(
subagent_type="cli-execution-agent", subagent_type="cli-execution-agent",
run_in_background=false,
description="Analyze test coverage gaps and generate test strategy", description="Analyze test coverage gaps and generate test strategy",
prompt=` prompt=`
## TASK OBJECTIVE ## TASK OBJECTIVE

View File

@@ -86,6 +86,7 @@ if (file_exists(testContextPath)) {
```javascript ```javascript
Task( Task(
subagent_type="test-context-search-agent", subagent_type="test-context-search-agent",
run_in_background=false,
description="Gather test coverage context", description="Gather test coverage context",
prompt=` prompt=`
You are executing as test-context-search-agent (.claude/agents/test-context-search-agent.md). You are executing as test-context-search-agent (.claude/agents/test-context-search-agent.md).

View File

@@ -94,6 +94,7 @@ Phase 2: Test Document Generation (Agent)
```javascript ```javascript
Task( Task(
subagent_type="action-planning-agent", subagent_type="action-planning-agent",
run_in_background=false,
description="Generate test planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md)", description="Generate test planning documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md)",
prompt=` prompt=`
## TASK OBJECTIVE ## TASK OBJECTIVE

View File

@@ -161,6 +161,7 @@ echo "[Phase 1] Starting parallel agent analysis (3 agents)"
```javascript ```javascript
Task(subagent_type="ui-design-agent", Task(subagent_type="ui-design-agent",
run_in_background=false,
prompt="[STYLE_TOKENS_EXTRACTION] prompt="[STYLE_TOKENS_EXTRACTION]
Extract visual design tokens from code files using code import extraction pattern. Extract visual design tokens from code files using code import extraction pattern.
@@ -276,6 +277,7 @@ Task(subagent_type="ui-design-agent",
```javascript ```javascript
Task(subagent_type="ui-design-agent", Task(subagent_type="ui-design-agent",
run_in_background=false,
prompt="[ANIMATION_TOKEN_GENERATION_TASK] prompt="[ANIMATION_TOKEN_GENERATION_TASK]
Extract animation tokens from code files using code import extraction pattern. Extract animation tokens from code files using code import extraction pattern.
@@ -355,6 +357,7 @@ Task(subagent_type="ui-design-agent",
```javascript ```javascript
Task(subagent_type="ui-design-agent", Task(subagent_type="ui-design-agent",
run_in_background=false,
prompt="[LAYOUT_TEMPLATE_GENERATION_TASK] prompt="[LAYOUT_TEMPLATE_GENERATION_TASK]
Extract layout patterns from code files using code import extraction pattern. Extract layout patterns from code files using code import extraction pattern.