Files
cleveragents-core/.opencode/scripts/update_tracking_agents.sh
T
freemo 5ae3f87251
CI / push-validation (push) Successful in 20s
CI / helm (push) Successful in 23s
CI / quality (push) Successful in 2m21s
CI / typecheck (push) Successful in 2m44s
CI / e2e_tests (push) Successful in 3m12s
CI / integration_tests (push) Successful in 3m58s
CI / build (push) Successful in 3m16s
CI / unit_tests (push) Successful in 4m52s
CI / lint (push) Successful in 5m11s
CI / security (push) Successful in 5m54s
CI / benchmark-regression (push) Has been skipped
CI / docker (push) Successful in 1m32s
CI / coverage (push) Successful in 10m26s
CI / status-check (push) Successful in 1s
CI / benchmark-publish (push) Successful in 1h13m35s
fix: update agents to use centralized automation-tracking-manager
- Fixed issue where agents were adding future cycle comments to old tracking issues
- Updated 12 agent definitions to use automation-tracking-manager subagent
- Removed custom tracking functions from all agents
- Ensures one tracking issue per cycle with proper cleanup
- Added helper scripts for tracking system updates
- Created comprehensive update summary documentation

This prevents agents from incorrectly reporting multiple cycles on the same
tracking issue and ensures consistent tracking behavior across all agents.
2026-04-09 11:38:30 -04:00

87 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
# Script to update agents to use automation-tracking-manager
# List of agents to update with their prefixes and tracking types
declare -A agents=(
["architect.md"]="AUTO-ARCH|Architecture Review"
["architecture-guard.md"]="AUTO-GUARD|Code Analysis Report"
["bug-hunter.md"]="AUTO-BUG-POOL|Bug Detection Report"
["docs-writer.md"]="AUTO-DOCS|Documentation Report"
["epic-planner.md"]="AUTO-EPIC|Epic Planning Update"
["human-liaison.md"]="AUTO-LIAISON|Human Activity Report"
["spec-updater.md"]="AUTO-SPEC|Specification Update"
["test-infra-improver.md"]="AUTO-INF-POOL|Infrastructure Analysis"
)
# Function to update an agent file
update_agent() {
local file=$1
local prefix=$2
local tracking_type=$3
echo "Updating $file with prefix $prefix and tracking type '$tracking_type'"
# Create a temporary file with the updated content
cat > /tmp/tracking_update.txt << 'EOF'
## Automation Tracking System
**Updated**: This agent uses the centralized automation-tracking-manager subagent for all tracking operations.
### Tracking Issue Format
- **Health Reports**: `[PREFIX] TRACKING_TYPE (Cycle N)`
- **Announcements**: `[PREFIX] Announce: <message summary>`
- **Labels**: "Automation Tracking" + any relevant priority labels
### Tracking Operations
All tracking operations are now handled by the automation-tracking-manager subagent:
```bash
# Create a new tracking issue (closes previous automatically)
task automation-tracking-manager "CREATE_TRACKING_ISSUE" \
--agent-prefix "PREFIX" \
--tracking-type "TRACKING_TYPE" \
--body "$tracking_body" \
--repo-owner "$owner" \
--repo-name "$repo"
# Update current tracking issue with a comment
task automation-tracking-manager "UPDATE_TRACKING_ISSUE" \
--agent-prefix "PREFIX" \
--tracking-type "TRACKING_TYPE" \
--comment "$update_comment" \
--repo-owner "$owner" \
--repo-name "$repo"
# Get the next cycle number
next_cycle=$(task automation-tracking-manager "GET_NEXT_CYCLE_NUMBER" \
--agent-prefix "PREFIX" \
--tracking-type "TRACKING_TYPE" \
--repo-owner "$owner" \
--repo-name "$repo")
# Read tracking state from latest issue
tracking_state=$(task automation-tracking-manager "READ_TRACKING_STATE" \
--agent-prefix "PREFIX" \
--tracking-type "TRACKING_TYPE" \
--repo-owner "$owner" \
--repo-name "$repo")
```
EOF
# Replace PREFIX and TRACKING_TYPE with actual values
sed -i "s/PREFIX/$prefix/g" /tmp/tracking_update.txt
sed -i "s/TRACKING_TYPE/$tracking_type/g" /tmp/tracking_update.txt
echo "Updated tracking section saved to /tmp/tracking_update.txt"
}
# Process each agent
for agent in "${!agents[@]}"; do
IFS='|' read -r prefix tracking_type <<< "${agents[$agent]}"
update_agent "$agent" "$prefix" "$tracking_type"
echo "---"
done
echo "Script complete. Manual updates still needed for each agent file."