fix(claude): ship launcher scripts and detect 2.1.179 tmux ready prompt - #623
Conversation
Reviewer: claude-ce-code-review - Pass 01Code Review — fix-claude-tmux-ready-detector (pass 1)Reviewed High(none) Medium
Nit
|
Reviewer: pr-review-toolkit - Pass 01PR Review — fix-claude-tmux-ready-detector (pr-review-toolkit, pass 1)The Verification performed: High(none) Medium
Nit
(type-design-analyzer: no new types introduced — changes are constants, |
Reviewer: codex-ce-code-review - Pass 02HighMedium
Nit |
Reviewer: pr-review-toolkit - Pass 02PR Review — fix-claude-tmux-ready-detector (pass 2)Diff: Verification performed during review (read-only):
All Requirements-Trace rows (U1–U5) are implemented; no plan-required item is missing. No High or Medium defects found. High(none) Medium(none) Nit
|
Read claude_launcher.rb with explicit UTF-8 encoding in the gem-package script guard so it no longer raises ArgumentError (invalid byte sequence) under a non-UTF-8 default locale. Add a regression fixture for the narrow no-break space (U+202F) caret separator the U3 plan calls out, alongside the existing U+00A0 NBSP coverage. Hive-Task-Slug: fix-claude-tmux-ready-detector-260629-50cc Hive-Fix-Pass: 01 Hive-Fix-Findings: 2 Hive-Triage-Bias: courageous Hive-Reviewer-Sources: claude-ce-code-review,codex-ce-code-review,pr-review-toolkit Hive-Fix-Phase: fix
…stants Remove the dead `line.empty?` branch in claude_prompt_chrome_line? — callers pass `.reject(&:empty?)`-filtered lines, so blank input never reaches the predicate. Correct the readiness doc comment that listed "blank" among accepted below-caret chrome shapes, and note that CLAUDE_PROMPT_TAIL_LINES and CLAUDE_PROMPT_CONTEXT_LINES must stay reconciled (both 12) so a future edit to one cannot silently narrow the scan vs. context window. Hive-Task-Slug: fix-claude-tmux-ready-detector-260629-50cc Hive-Fix-Pass: 01 Hive-Fix-Findings: 4 Hive-Triage-Bias: courageous Hive-Reviewer-Sources: claude-ce-code-review,codex-ce-code-review,pr-review-toolkit Hive-Fix-Phase: fix
`claude_prompt_chrome_line?` treated any line starting with `⏵⏵` as footer chrome, so a stale caret followed by real output such as `⏵⏵ running build step 1/2` was incorrectly reported ready. Tighten the clause to require the `bypass permissions` hint-footer copy (the real footer also carries "for agents", so accept tests stay green) and add a regression test. Also make the gem-package integration guard self-contained by requiring "tmpdir" explicitly. Hive-Task-Slug: fix-claude-tmux-ready-detector-260629-50cc Hive-Fix-Pass: 02 Hive-Fix-Findings: 2 Hive-Triage-Bias: courageous Hive-Reviewer-Sources: claude-ce-code-review,codex-ce-code-review,pr-review-toolkit Hive-Fix-Phase: fix
Hive-Task-Slug: fix-claude-tmux-ready-detector-260629-50cc Hive-Stage: 8-finalize Hive-Auto-Commit: residue Hive-Auto-Commit-Reason: finalize_entry_backstop
3fede60 to
40667fa
Compare
Summary
On a clean release-gem install with Claude Code 2.1.179,
hive runin Claude tmux mode never reachedWAITING— it died at launch withclaude_launch_failed/ "can't find pane". Two independent defects had to line up for a launch to work, and both were broken.First, the gem shipped no shell scripts.
spec.filesglobbedlib/**/*.rbonly, so the wrappersClaudeLaunchershells out to (interactive_claude_wrapper.sh,stop_hook.sh) were absent from the built gem.bash <missing-file>exits instantly, the tmux session collapses, and Hive reports the launch failure. Second, even with the wrapper present, the 2.1.179 idle prompt was not recognized: that build renders a separator / caret / separator / footer box and paints a non-breaking space around the❯caret, which the old detector — a shallow 2-line tail scan tolerating only an ASCII space — read as "not ready" forever.After this change a release build packages the scripts and the detector recognizes the 2.1.179 prompt (and tolerates future TUI tweaks) without misreading trust, permission, or menu states as ready.
What changed
hive.gemspecnow globslib/hive/scripts/**/*.shso every scriptClaudeLauncherinvokes ships in the gem.claude_launcher.rb/stop_hook_installer.rb, builds the real.gem, and fails if any referenced script is missing — a future script reference can't silently drop out.\p{Zs}(incl. NBSP) on both sides of the caret, and accepts a caret only when every line below it is terminal chrome (box/separator/footer/blank) rather than assuming a fixed footer distance.Design notes
return falses — misreading a trust/permission prompt as ready is the dangerous case.stripdoes not normalize NBSP. Ruby'sString#stripleaves\p{Zs}separators in place, so the prompt regex matches the separator class explicitly with anchored\A/\zrather than relying on stripping.Out of scope
No version bump or gem publish, and no fix for the
/usr/bin/hivevs~/.local/bin/hivedaemon binary drift — that drift is documented as a validation caveat inwiki/operating.mdonly.Test plan
rake coveragegreen:100.00% (28895/28895)line coverage, 6869 runs, 73404 assertions, 0 failures, 0 errors.gemspec_test,gem_package_scripts_test,claude_launcher_test,wiki_log_test.skips cleanly whengemis unavailable, so it never hard-fails a build-chain-less runner.GEM_HOME(build → install →hive runreachingWAITING,hive doctorgreen) is documented as a manual check inwiki/operating.md.Review summary
Five review passes (two
ce-code-review, twopr-review-toolkit, twocodexpasses) found no High defects. The Medium findings — a non-UTF-8 locale crash in the packaging guard's sourceFile.read, and an over-loose⏵⏵chrome clause that could mark a stale caret with real footer-prefixed output as ready — were both fixed (read source as UTF-8; require the bypass-permissions footer copy). Nits (unreachable blank-line chrome branch, coupled-constant reconciliation comment, an explicitrequire "tmpdir", and a U+202F narrow-no-break-space regression test) were also addressed. Remaining no-fix items (the intentional?/+/-chrome looseness per plan R2, and the invariant-lock trust/permission rejection tests) were reviewed and accepted. All plan units U1–U5 are implemented; no version bump or publish, consistent with the OUT scope.Linked task
fix-claude-tmux-ready-detector-260629-50ccadd-local-hive-web-install-260629-f4careachesWAITINGinstead ofclaude_launch_failed, withhive doctorgreen (manual e2e check perwiki/operating.md).