feat(panel): --allow-fresh flag + fix cube feedback stdin double-read#185
Conversation
Two fixes batched: 1. --allow-fresh CLI flag on 'cube peer-review' and 'cube pr-review' (alias prv). Soft-fall-through to fresh for judges with missing/stale sessions instead of hard-crashing. Default stays hard-crash so cube state bugs surface loudly; operators opt in when they know sessions are dead. Plumbs through launch_judge_panel -> peer_review_command -> _run_pr_review -> _run_branch_review. 2. 'cube feedback /dev/stdin <<EOF' was silently no-op'ing because typer consumed stdin during arg parsing, then feedback_path.read_text() saw EOF and codex got an empty prompt. Special-case /dev/stdin and - to drain sys.stdin once into a temp file. Errors loud on empty input.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis pull request introduces an ChangesAllow-fresh graceful judge panel resume
Stdin feedback submission support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
Comment |
…l delete (#195) PR #185 added --allow-fresh which auto-falls-through stale judge sessions without nuking the panel state or making the operator hand-delete files. Old advice predates that flag and tells operators to delete sessions + use --fresh (heavier). Updated to recommend --allow-fresh as the primary remedy in both drift and missing-session messages.
Two fixes batched into one PR.
1.
--allow-freshCLI flag oncube peer-reviewandcube pr-review(aliasprv). Soft-fall-through to fresh for judges with missing/stale sessions instead of hard-crashing the whole panel. Default stays hard-crash so cube state-management bugs surface loudly; operators opt in when they already know the sessions are dead. Plumbs throughlaunch_judge_panel→peer_review_command→_run_pr_review→_run_branch_review.2.
cube feedback /dev/stdin <<EOFno-op fix. Typer consumed stdin during arg parsing;feedback_path.read_text()then saw EOF and sent codex an empty prompt. Special-case/dev/stdinand-to drainsys.stdinonce into a temp file. Errors loud on empty input.Test plan
cube prv <pr> --allow-freshagainst a task with deleted/stale session files — proceeds with that judge fresh, others resumecube prv <pr>without the flag — still hard-crashes on missing session (default behavior preserved)cube feedback writer-a my-task /dev/stdin <<EOF ... EOF— codex actually receives the heredoc contentOverview
This PR adds two independent features to improve panel reliability and feedback UX:
1. --allow-fresh Flag
Adds optional
--allow-freshtocube peer-reviewandcube pr-review(aliasprv) commands. When enabled, judges with missing or stale session files soft-fall through to launching a fresh instance instead of hard-crashing the entire panel. Default remains strict (hard-crash) to surface state-management bugs; operators opt in when expecting dead sessions. The flag threads through: CLI →peer_review_command/pr_review_cmd→_run_pr_review/_run_branch_review→launch_judge_panel.2. Feedback stdin Double-Read Fix
Fixes silent no-op when running
cube feedback writer-a task /dev/stdin <<EOF ... EOF. Typer's argument parsing consumes stdin during setup, leaving subsequent reads seeing EOF. Now special-cases/dev/stdinand-to drain remainingsys.stdininto a temporary file under.prompts/, with loud error on empty input to surface the issue immediately.Files Modified
launch_judge_panel()gainsallow_freshparameter with conditional soft-fall-through logic--allow-freshoption to peer-review and pr-review command definitionsallow_freshthroughpeer_review_command(),_run_pr_review(),_run_branch_review()Test Coverage
Existing test suite (237 tests) passes. Test
test_run_judge_retries_fresh_when_saved_session_missingvalidates judge retry logic with missing sessions.