openclaw - 💡(How to fix) Fix Migrate OpenSource Contribute Watch (OSCW) from openclaw cron to standalone Python + launchd [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56928Fetched 2026-04-08 01:45:53
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

  • launchd plist loads without error

Code Example

┌─────────────────────────┐
│  macOS launchd           │
  (Tue 3:00+4:00 AM)     │  ← DST-safe dual trigger
└──────────┬──────────────┘
┌──────────────────────────┐
│  opensource-watch-cron.sh │  ← thin bash wrapper (PATH setup)
└──────────┬──────────────┘
┌──────────────────────────────────────────┐
│  opensource_watch.py (NEW)│                                          │
1. GitHub API via gh CLI- search/issues?q=commenter:USER- repos/OWNER/REPO/issues/N/comments │
│                                          │
2. Filter: waiting_for_response == true│                                          │
3. Format Slack mrkdwn report           │
- Group by @user                     │
- emoji + <url|title> links          │
- Days since last updated            │
│                                          │
4. POST Slack API (chat.postMessage)- Bot token from openclaw.json- Channel: C0AJ2PMU5BM│                                          │
5. Date-lock (/tmp) prevent re-send     │
└──────────────────────────────────────────┘
RAW_BUFFERClick to expand / collapse

Original Request

好 要迁移oscw,先列计划,发 /fr

English Translation: OK, migrate OSCW (OpenSource Contribute Watch). First list the plan, then file /fr.

Agent's Two Cents (could be wrong)

Everything below is the AI agent's best guess based on the current codebase. Take with a grain of salt — the original request above is the only thing that came from a human.

Suggested priority: p3

Problem / Motivation

OSCW currently runs as an openclaw cron job that spawns an isolated agent session (LLM-powered) just to run a bash script and format the output. This is wasteful — the actual work is a pure GitHub API query + text formatting, zero LLM needed. Migrating to standalone Python + launchd (like the model-usage-report migration) eliminates LLM cost, reduces latency, and makes it independent of openclaw gateway uptime.

Proposed Solution

Migrate OSCW to a standalone Python script + macOS launchd plist, following the same pattern as the successful model-usage-report migration.

Architecture Diagram

┌─────────────────────────┐
│  macOS launchd           │
│  (Tue 3:00+4:00 AM)     │  ← DST-safe dual trigger
└──────────┬──────────────┘
┌──────────────────────────┐
│  opensource-watch-cron.sh │  ← thin bash wrapper (PATH setup)
└──────────┬──────────────┘
┌──────────────────────────────────────────┐
│  opensource_watch.py (NEW)                │
│                                          │
│  1. GitHub API via gh CLI                │
│     - search/issues?q=commenter:USER     │
│     - repos/OWNER/REPO/issues/N/comments │
│                                          │
│  2. Filter: waiting_for_response == true │
│                                          │
│  3. Format Slack mrkdwn report           │
│     - Group by @user                     │
│     - emoji + <url|title> links          │
│     - Days since last updated            │
│                                          │
│  4. POST Slack API (chat.postMessage)    │
│     - Bot token from openclaw.json       │
│     - Channel: C0AJ2PMU5BM              │
│                                          │
│  5. Date-lock (/tmp) prevent re-send     │
└──────────────────────────────────────────┘

Migration Plan

  1. Create scripts/opensource_watch.py — Port bash logic to Python, add Slack formatting + posting
  2. Create scripts/opensource-watch-cron.sh — Thin bash wrapper (PATH → exec python)
  3. Create launchd plistcom.peteradams.opensource-watch.plist, weekly Tue, DST-safe
  4. Test end-to-end — Manual run, verify Slack output
  5. Disable openclaw cron jobopenclaw cron edit 616498c2-... --disable
  6. Monitor first automated run

Dependencies & Potential Blockers

No major blockers identified. All dependencies already exist: gh CLI (installed+authed), Python 3, Slack bot token in openclaw.json.

How to Validate

  • python3 scripts/opensource_watch.py produces correctly formatted Slack message
  • Message appears in #peteradams-report with proper <url|title> links
  • Date-lock prevents re-send on same day
  • launchd plist loads without error
  • openclaw cron job disabled

Scope Estimate

small

Key Files/Modules Likely Involved

  • scripts/opensource-watch.sh (existing, reference)
  • scripts/opensource_watch.py (new)
  • scripts/opensource-watch-cron.sh (new)
  • ~/Library/LaunchAgents/com.peteradams.opensource-watch.plist (new)
  • scripts/model_usage_cron_runner.py (reference pattern)

Open Questions

  • Should the script also email the report (like media-watch does)?
  • Keep same Slack target #peteradams-report (C0AJ2PMU5BM)?

Potential Risks or Gotchas

  • gh api does N+1 queries (1 search + 1 per issue). Fine at 50 items but could hit rate limits if scaled.
  • launchd weekly uses Weekday key (0=Sun, 2=Tue).

extent analysis

Fix Plan

To migrate OSCW to a standalone Python script, follow these steps:

  • Create a new Python script scripts/opensource_watch.py with the following content:
import subprocess
import json
import os

# GitHub API query
def get_github_data():
    # Search issues
    search_cmd = "gh api /search/issues --method=GET -f q='commenter:USER'"
    search_output = subprocess.check_output(search_cmd, shell=True)
    search_data = json.loads(search_output)

    # Get issue comments
    issues = []
    for issue in search_data['items']:
        issue_cmd = f"gh api /repos/OWNER/REPO/issues/{issue['number']}/comments --method=GET"
        issue_output = subprocess.check_output(issue_cmd, shell=True)
        issue_data = json.loads(issue_output)
        issues.extend(issue_data)

    return issues

# Filter and format data
def format_data(issues):
    filtered_issues = [issue for issue in issues if issue['waiting_for_response']]
    formatted_data = {}
    for issue in filtered_issues:
        user = issue['user']['login']
        if user not in formatted_data:
            formatted_data[user] = []
        formatted_data[user].append(issue)

    return formatted_data

# Post to Slack
def post_to_slack(data):
    # Load bot token from openclaw.json
    with open('openclaw.json') as f:
        bot_token = json.load(f)['bot_token']

    # Post to Slack
    for user, issues in data.items():
        message = f"*{user}* has {len(issues)} waiting issues:"
        for issue in issues:
            message += f" <{issue['html_url']}|{issue['title']}>"
        subprocess.check_output(f"curl -X POST -H 'Authorization: Bearer {bot_token}' -H 'Content-Type: application/json' -d '{{\"channel\": \"C0AJ2PMU5BM\", \"text\": \"{message}\"}}' https://slack.com/api/chat.postMessage", shell=True)

# Main function
def main():
    issues = get_github_data()
    data = format_data(issues)
    post_to_slack(data)

if __name__ == '__main__':
    main()
  • Create a thin bash wrapper scripts/opensource-watch-cron.sh to execute the Python script:
#!/bin/bash
python3 scripts/opensource_watch.py
  • Create a launchd plist com.peteradams.opensource-watch.plist to run the script weekly:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING