Compare commits
3 Commits
v0.2.3
...
fix/issue-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f6a30f01c | ||
|
|
f39e39156a | ||
| deb18f1e32 |
@@ -310,12 +310,31 @@ get_pending_tasks() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find "$QUEUE_ITEMS_DIR" -name "*.json" -type f 2>/dev/null | while read -r file; do
|
python3 -c "
|
||||||
local state=$(python3 -c "import json; print(json.load(open('$file')).get('state', ''))" 2>/dev/null || echo "")
|
import json
|
||||||
if [ "$state" = "pending" ]; then
|
import os
|
||||||
cat "$file"
|
import sys
|
||||||
fi
|
|
||||||
done | head -"$limit"
|
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() {
|
get_queue_stats() {
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ source "$SCRIPT_DIR/kugetsu-index.sh"
|
|||||||
source "$SCRIPT_DIR/kugetsu-worktree.sh"
|
source "$SCRIPT_DIR/kugetsu-worktree.sh"
|
||||||
source "$SCRIPT_DIR/kugetsu-log.sh"
|
source "$SCRIPT_DIR/kugetsu-log.sh"
|
||||||
|
|
||||||
# Load GITEA_TOKEN from default.env
|
load_agent_env "pm-agent"
|
||||||
if [ -f "$HOME/.kugetsu/env/default.env" ]; then
|
|
||||||
source "$HOME/.kugetsu/env/default.env"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if a notified task has completed (forked session ended or has new commits)
|
# Check if a notified task has completed (forked session ended or has new commits)
|
||||||
check_task_completion() {
|
check_task_completion() {
|
||||||
|
|||||||
Reference in New Issue
Block a user