fix(update-db): accept JSON from argv[1] as well as stdin#11
Open
tyrannomark wants to merge 2 commits into
Open
fix(update-db): accept JSON from argv[1] as well as stdin#11tyrannomark wants to merge 2 commits into
tyrannomark wants to merge 2 commits into
Conversation
- /fluent-review --batch and /fluent-vocab --batch: present all questions upfront as a numbered list, accept all answers in one reply, then evaluate in sequence — reduces round-trip latency during review sessions - /fluent-export-anki: export all SR items to an Anki-importable TSV (export-anki.py); Basic cards with front=target content, back=translation + category + level; tagged by type, category, and mastery level; safe to re-import (Anki deduplicates by front field) - /fluent-import-lr: import vocabulary from a Language Reactor zip or CSV (import-lr.py); deduplicates against existing SR items; spreads due dates at --daily-limit items/day (default 20) to avoid flooding the queue; writes atomically with backup; dry-run flag for preview before committing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When invoked as a background task by Claude Code the JSON payload is passed as a command-line argument, not piped to stdin. The script was blocking forever waiting for stdin that never arrived, silently leaving all 6 databases un-updated. Now reads sys.argv[1] if present, falls back to stdin — both invocation styles work. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
update-db.pyread its JSON payload exclusively from stdin (json.load(sys.stdin))Fix
Check
sys.argv[1]first; fall back to stdin if absent. Both invocation styles now work:Test plan
python3 update-db.py "$PAYLOAD"— updates all 6 DBs, exits 0echo "$PAYLOAD" | python3 update-db.py— updates all 6 DBs, exits 0Generated with Claude Code