Conversation
Fixes the broken Claude Code → OpenClaw feedback loop. The monitor (manage-claude-code.py / claude-tab-monitor cron) reads tracker.json, but openclaw-checkin.py never wrote to it — the two sides were completely disconnected. Changes: - Add TRACKER_PATH constant pointing to tracker.json in WSL workspace - Add _update_tracker(status, detail, project): finds matching active tab by project_name (basename of CLAUDE_PROJECT_DIR), updates last_checkin, appends to checkins[], marks completed on done. Atomic write via .tmp rename. try/except guards never break the flow. - Call _update_tracker() from main() before send_to_openclaw() so tracker is always updated even when the API times out.
The two sides of the checkin system were completely disconnected: - openclaw-checkin.py wrote to comms log + OpenClaw API (which always timed out) - manage-claude-code.py / monitor cron only read tracker.json - Result: 32 checkins in comms log, zero in tracker.json Fix: 1. Add _update_tracker() to openclaw-checkin.py - Reads tracker.json, finds matching active tab by project_name - Appends to checkins[], updates last_checkin - If status=done: marks tab completed with completed_at + summary - Atomic write (tmp -> os.replace), wrapped in try/except (best-effort) - Called BEFORE OpenClaw API POST so tracker is always updated 2. Add --fire-and-forget to argparse (hidden, no-op) - openclaw-checkin.js was passing this flag causing argparse errors 3. Add docs/FEEDBACK-LOOP.md - Full architecture, ASCII diagram, component table, bug description, test instructions Also synced /mnt/c/Users/joelg/.claude/scripts/openclaw-checkin.py to match.
- Detect WSL via /proc/version containing 'microsoft' - Add WSL branch to build_launch_cmd() using wt.exe interop - WSL tabs open via wt.exe new-tab + wsl.exe -d <distro> - get_wt_settings_path() resolves WT settings via cmd.exe in WSL - _get_wsl_distro() reads WSL_DISTRO_NAME env var - Make TRACKER_PATH in openclaw-checkin.py configurable via env var - Make stop-message.txt paths portable (env vars instead of hardcoded) - Add 14 new tests (110 total, all passing)
…in stop-message.txt), T004 (WSL detection + wt.exe launch) done, 110/110 tests pass
- Add _get_wsl_claude_cmd() — prefers native 'claude', falls back to 'claude.exe' - Add WSL process names to terminal_hosts (relay, sessionleader, init-systemd) - Use substring match for pgrep (catches both claude and claude.exe) - Use 'claude' substring match in Unix safety check (same reason) - Verified via dry-run in WSL: shell PID detected, command uses claude.exe
- Add relay, sessionleader, init-systemd to Unix terminal_hosts - Add _get_wsl_claude_cmd() for claude vs claude.exe detection - pgrep uses substring match for claude/claude.exe compat - Audit: 18 Windows patterns all gated behind IS_WIN - WSL dry-run verified: detection, cmd gen, shell PID, claude.exe
…ll --dry-run succeeds
Mock platform flags to test all branches on any OS: - Mac: osascript, Terminal.app, quote escaping (6 tests) - Linux gnome-terminal: --tab, title, quote escaping (6 tests) - Linux fallback: bash -c background, & suffix (3 tests)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/proc/versioncontaining "microsoft"wt.exeinterop →wsl.exe -d <distro> -- bash -lc 'cd ... && claude'claude(native) orclaude.exe(Windows interop) based on availabilityrelay,sessionleader,init-systemd) recognized in shell PID detectionpgrepand safety checks use substring match forclaude/claude.execompatget_wt_settings_path()resolves Windows Terminal settings from WSL viacmd.exeopenclaw-checkin.py:TRACKER_PATHconfigurable viaOPENCLAW_TRACKER_PATHenv varstop-message.txt: all paths use env vars instead of hardcoded pathsVerified
wt.execommand generated,claude.exeselected, shell PID found viarelayprocessIS_WINguardsTest plan
python scripts/test.py— 110 pass, 0 fail