Compare commits
3 Commits
fix/issue-
...
fix/issue-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f6a30f01c | ||
|
|
f39e39156a | ||
| deb18f1e32 |
@@ -310,12 +310,31 @@ get_pending_tasks() {
|
||||
return
|
||||
fi
|
||||
|
||||
find "$QUEUE_ITEMS_DIR" -name "*.json" -type f 2>/dev/null | while read -r file; do
|
||||
local state=$(python3 -c "import json; print(json.load(open('$file')).get('state', ''))" 2>/dev/null || echo "")
|
||||
if [ "$state" = "pending" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | head -"$limit"
|
||||
python3 -c "
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
queue_dir = os.environ.get('QUEUE_ITEMS_DIR', '')
|
||||
limit = int(sys.argv[1]) if len(sys.argv) > 1 else 10
|
||||
|
||||
items = []
|
||||
if os.path.isdir(queue_dir):
|
||||
for filename in os.listdir(queue_dir):
|
||||
if filename.endswith('.json'):
|
||||
filepath = os.path.join(queue_dir, filename)
|
||||
try:
|
||||
with open(filepath) as f:
|
||||
data = json.load(f)
|
||||
if data.get('state') == 'pending':
|
||||
items.append(data)
|
||||
if len(items) >= limit:
|
||||
break
|
||||
except:
|
||||
pass
|
||||
|
||||
print(json.dumps(items))
|
||||
" "$limit"
|
||||
}
|
||||
|
||||
get_queue_stats() {
|
||||
|
||||
@@ -8,10 +8,7 @@ source "$SCRIPT_DIR/kugetsu-index.sh"
|
||||
source "$SCRIPT_DIR/kugetsu-worktree.sh"
|
||||
source "$SCRIPT_DIR/kugetsu-log.sh"
|
||||
|
||||
# Load GITEA_TOKEN from default.env
|
||||
if [ -f "$HOME/.kugetsu/env/default.env" ]; then
|
||||
source "$HOME/.kugetsu/env/default.env"
|
||||
fi
|
||||
load_agent_env "pm-agent"
|
||||
|
||||
# Check if a notified task has completed (forked session ended or has new commits)
|
||||
check_task_completion() {
|
||||
|
||||
Reference in New Issue
Block a user