fix(statusline): non-blocking Herdr launch, full disclosure, risk-based default (#563) - #564
Merged
Conversation
…ed default (#563) Herdr 首次 launch 被 statusline 提問卡住(乾淨機器驗證發現);提問本身 缺少用途/影響/可逆性揭露;預設一律 N 對純新增情境過度保守。 - A Herdr-launched pane (CCXRAY_AGENT_ID=herdr:*) skips the interactive gate: the one-line 'ccxray setup-statusline' hint replaces the question and the declined marker is NOT written, so a later direct TTY launch still gets to answer. - The prompt now discloses purpose (subscription limits on the Usage page), impact (writes a statusline adapter into settings.json; an existing statusline keeps rendering via delegation), and reversibility (auto-restored on removal). - Default follows risk: [Y/n] when no statusline is configured (pure addition), [y/N] when wrapping an existing one (consent must be a conscious act). - test/statusline-prompt.test.js: 3 pty-driven e2e scenarios (fail-on-old: 0/3 on origin/main — the herdr case blocks forever, Enter declines the pure addition, and the old prompt lacks every disclosure). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…test env pinning - settings.json that exists but fails to parse defaults to [y/N] and Enter declines (installing would overwrite unknown content); missing file stays the pure-addition [Y/n] path - answer handling survives readline EOF (String(answer ?? '')) - tests: pin CCXRAY_AGENT_ID='' in the base env (ambient herdr:* id from a monitored pane would silently skip the prompt — docs/testing.md §1b class), scenario-dir cleanup, exact pkill pattern, +2 scenarios (explicit y with delegation preserved; unparseable file untouched) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-2 P3)
The wrap line claimed 'delegated, not replaced', but with an unparseable
settings.json an explicit y rewrites the file from {} — say so. Test locks
the copy.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Round-2 grok verdict on the final diff: SHIP — all five round-1 dispositions verified present. One remaining P3 (the unparseable-settings prompt borrowed the wrap copy 'delegated, not replaced' while an explicit y actually rewrites the file from {}) fixed in the latest commit: dedicated impact line ('could not be parsed — installing would REWRITE it') + test locks it. 6/6 e2e green. |
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.
摘要
修 #563:statusline 同意提問的時機、內容、預設值三件事一起收。
CCXRAY_AGENT_ID=herdr:*的 pane 跳過互動提問,改印一行ccxray setup-statusline提示;不寫拒絕標記,之後直接在 TTY 啟動仍會被問。settings.json;既有 statusline 經委派照常渲染)、可逆性(移除時自動還原)。[Y/n],Enter 即裝;要包既有 statusline 或 settings.json 存在但 parse 失敗(覆寫風險)→ 維持[y/N],同意必須是有意識的y。差異檢查證據(fail-on-old)
test/statusline-prompt.test.js— 5 個 pty 驅動的 e2e(真實ccxray --port N claudeboot + script(1) pty,#556 的平台分支寫法)。前 3 個複製到 origin/main 拋棄式 worktree:0/3 pass(herdr 情境永久卡在提問、純新增按 Enter 被拒絕、舊提問缺所有揭露文字)。新碼 5/5。全套(隔離 CCXRAY_HOME、scrub 被監控 session 的 client env):2224/2224 pass。
乾淨機器驗證(DO droplet,Ubuntu 22.04)
把修過的
server/index.js部署到 droplet 的 plugin checkout、移除先前手動建立的拒絕標記(還原成會觸發 bug 的狀態)、從 Herdr plugin 重新 launch:pane 直接進入 Claude Code 畫面,無提問;.statusline-declined不存在(skip 未偽造 decline);~/.claude/settings.json無statusLine鍵(未偷裝)。這正是發現此 bug 的同一台機器、同一條路徑。Review gate (grok stand-in — codex out of quota until 2026-08-20)
Verdict: SHIP, no P1. Findings & disposition:
CCXRAY_AGENT_ID— a suite run from a Herdr pane would silently skip the prompt in the non-Herdr scenarios (docs/testing.md §1b class)CCXRAY_AGENT_ID: ''pinned in the base env; Herdr test overridesanswer.trim()throws on readline EOF (swallowed by spawnAgent's catch — harmless but re-asks)String(answer ?? '')yon wrap (delegation preserved) + unparseable-file scenario; the rest (YES, whitespace, pre-existing marker, unset CLAUDE_CONFIG_DIR) judged not worth a server boot eachConsent-safety check (grok): nothing on any path installs without the TTY prompt; the Herdr skip only withholds the question and can neither install nor forge a decline; the skip cannot fire outside the plugin's
herdr:id prefix.Detail
server/index.jspromptClaudeStatusline(): herdr-launch guard (falls to the existing hint path), three-line disclosure prompt,hasExistingdetection with unparseable-file conservatism, risk-based default, EOF-safe answer handling. Install/uninstall/delegation mechanics untouched.test/statusline-prompt.test.js(new): 5 pty e2e scenarios, isolated per docs/testing.md.Closes #563
🤖 Generated with Claude Code