Skip to content

Commit 36e998a

Browse files
committed
feat(k8s): add agentic-sdlc-orchestrator integration
- Add support for agentic-sdlc-orchestrator agent type in implement.sh - Spawn K8s pods for [ASYNC] tasks when using orchestrator agent - Add fallback to standard async delegation if orchestrator not installed - Update agent type detection and task dispatch logic
1 parent 869f540 commit 36e998a

File tree

2 files changed

+54
-8
lines changed

2 files changed

+54
-8
lines changed

scripts/bash/implement.sh

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,56 @@ execute_task() {
224224
local agent_type
225225
agent_type=$(jq -r ".tasks[\"$task_id\"].agent_type // \"general\"" "$TASKS_META_FILE")
226226

227-
# For now, use simple context and requirements
228-
local task_context="Files: $task_files"
229-
local task_requirements="Complete the task according to specifications"
230-
local execution_instructions="Execute the task and provide detailed results"
231-
232-
if dispatch_async_task "$task_id" "$agent_type" "$task_description" "$task_context" "$task_requirements" "$execution_instructions" "$FEATURE_DIR"; then
233-
log_success "ASYNC task $task_id dispatched successfully"
227+
# Check if using local orchestrator (agentic-sdlc-orchestrator)
228+
if [[ "$agent_type" == "agentic-sdlc-orchestrator" ]]; then
229+
# Use local K8s orchestrator
230+
log_info "Spawning K8s pod via agentic-sdlc-orchestrator for task $task_id"
231+
232+
# Get repository info
233+
local repo_url
234+
repo_url=$(git remote get-url origin 2>/dev/null || echo "")
235+
local branch_name
236+
branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
237+
238+
# Call the orchestrator script if available
239+
if command -v agentic-sdlc-orchestrator &>/dev/null; then
240+
agentic-sdlc-orchestrator spawn \
241+
--task-id "$task_id" \
242+
--branch "specs/$(basename "$FEATURE_DIR")/${task_id}-async" \
243+
--repo "$repo_url" \
244+
--context-dir "$FEATURE_DIR"
245+
246+
if [[ $? -eq 0 ]]; then
247+
log_success "K8s pod spawned for task $task_id"
248+
safe_json_update "$TASKS_META_FILE" --arg task_id "$task_id" '.tasks[$task_id].status = "running"'
249+
else
250+
handle_task_failure "$task_id" "Failed to spawn K8s pod"
251+
fi
252+
else
253+
log_warn "agentic-sdlc-orchestrator not installed. Install with: pip install agentic-sdlc-orchestrator"
254+
log_info "Falling back to standard async delegation"
255+
# Fall back to standard dispatch_async_task
256+
local task_context="Files: $task_files"
257+
local task_requirements="Complete the task according to specifications"
258+
local execution_instructions="Execute the task and provide detailed results"
259+
260+
if dispatch_async_task "$task_id" "$agent_type" "$task_description" "$task_context" "$task_requirements" "$execution_instructions" "$FEATURE_DIR"; then
261+
log_success "ASYNC task $task_id dispatched successfully"
262+
else
263+
handle_task_failure "$task_id" "Failed to dispatch ASYNC task"
264+
fi
265+
fi
234266
else
235-
handle_task_failure "$task_id" "Failed to dispatch ASYNC task"
267+
# Standard async delegation (MCP agents like jules, async-copilot, async-codex)
268+
local task_context="Files: $task_files"
269+
local task_requirements="Complete the task according to specifications"
270+
local execution_instructions="Execute the task and provide detailed results"
271+
272+
if dispatch_async_task "$task_id" "$agent_type" "$task_description" "$task_context" "$task_requirements" "$execution_instructions" "$FEATURE_DIR"; then
273+
log_success "ASYNC task $task_id dispatched successfully"
274+
else
275+
handle_task_failure "$task_id" "Failed to dispatch ASYNC task"
276+
fi
236277
fi
237278
else
238279
# Execute SYNC task (would normally involve AI agent execution)

src/specify_cli/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ def _format_rate_limit_error(status_code: int, headers: httpx.Headers, url: str)
309309
"url": "https://mcp.async-codex.ai/",
310310
"description": "Connect to Async Codex for autonomous development workflows",
311311
},
312+
"agentic-sdlc-orchestrator": {
313+
"name": "Agentic SDLC Orchestrator",
314+
"type": "local",
315+
"description": "Run async tasks in Kubernetes pods via local orchestrator",
316+
},
312317
}
313318

314319
SCRIPT_TYPE_CHOICES = {"sh": "POSIX Shell (bash/zsh)", "ps": "PowerShell"}

0 commit comments

Comments
 (0)