Repository navigation
Conversation
Herdr's `pane run` returns before zsh has consumed the submitted line, so the rapid pre-launch exports (GOTMPDIR, COMPACT_ADVISER_DISABLE, FM_TASK_ID, TRACEPARENT, LAVISH_AXI_HOST) could reach the pane's input together, lose their separators, and merge with the staged `. launch.sh` source line. zsh then reported `export: not valid in this context` and the worker never started, while the task record looked published. On the Herdr backend, prepend those exports to the private staged launch script instead, ahead of the launch-env-allowlist `env -i` wrapper, so they still run in the pane shell, are forwarded to the worker, and stay set after it exits. Other backends keep their existing delivery. The real-Herdr launcher E2E now asserts that the worker command actually runs, covers an empty launch-env allowlist and a traced secondmate, and points its teardown at its own fixture home.
|
Validation and review clarification: the real-Herdr launch E2E passed all 15 checks twice at this head; replacing only fm-spawn.sh with the pre-fix version reproduced the concatenated-export launch failure. The remote and local trace regression suites also passed. The minimal temporary-root checks in the affected remote test are retained because an earlier validation encountered allocation failure and copied into its own source tree; an injected allocation failure now exits before copying and preserves a disposable source. No general fixture framework or production behavior was added. GitHub currently reports action_required for both CI and Require no-mistakes, with zero jobs executed. This is the fork workflow approval requirement, not a failing test. Please approve those workflow runs when ready so the required checks can execute. No CI pass or merge is being claimed. |
|
Speaking as Kun's firstmate: thanks @veardk. A worker that never starts because several pane exports ran together into the I compared head What I checked: CI: I reviewed the diff first ( Contract-class: restore. Spawning a worker on Herdr is an existing, specified default path, and it was broken. Other backends are untouched. VISION.md, rule by rule: one captain (aligns: no silent dead workers), authority (aligns: no new action), scripts own mechanics (aligns), restart non-event (n/a), delegation with a spine (aligns: real-Herdr regression coverage), vendor (aligns: keeps Herdr a working session manager), scope (aligns: spawn only). Next step: waiting on CI. If CI and no-mistakes go green and it stays mergeable, this auto-merges. Nothing more is needed from you. |
|
Updated head to
Production code in |
|
Speaking as Kun's firstmate: thanks for chasing those two CI fixtures down, @veardk. I re-read the delta
Contract-class: restore (re-verified). Herdr worker spawn is an existing, specified default path that broke when pane exports ran together. Other backends are untouched. Next: this is waiting on CI. If CI and Require no-mistakes go green and it stays mergeable at this head, it auto-merges. Nothing more is needed from you. |
Intent
修复 Firstmate 反复启动 Claude 失败,后两条 export 与启动命令串成一行并报 export: not valid in this context,向 kunchenguid/firstmate 提交 PR 并完成全套验证
What Changed
bin/fm-spawn.sh: on theherdrbackend, the pre-launch pane exports (GOTMPDIR,COMPACT_ADVISER_DISABLE,LAVISH_AXI_HOST,FM_TASK_ID,TRACEPARENT) are no longer typed into the pane as separate lines. Rapid exports could merge with the stagedsourceline in zsh, which producedexport: not valid in this contextand left the worker unstarted. They are now collected through a newspawn_export_linehelper and prepended to the staged launch file, ahead of anyenv -ilaunch-env wrapper, so the variables persist in the pane shell. Other backends keep the existingspawn_send_text_linepath.tests/fm-backend-herdr-launcher-workspace-e2e.test.sh: the real-Herdr E2E now checks that the staged worker command actually runs. It also checks that with an empty launch-env allowlist a ship worker still seesFM_TASK_ID,GOTMPDIRandCOMPACT_ADVISER_DISABLE, thatFM_TASK_IDis still set in the pane after the worker exits, and that a traced secondmate gets and records itsTRACEPARENT.docs/trace-context.mdplusdocs/verification/trace-context.mddescribe the Herdr staged-export delivery.Risk Assessment
✅ Low: 该修复仅作用于 Herdr 后端:把 GOTMPDIR、COMPACT_ADVISER_DISABLE、LAVISH_AXI_HOST、FM_TASK_ID、TRACEPARENT 的 pane export 改为写在暂存启动文件开头,并在 env -i 包装展开前执行,因此不会再与 source 行在 zsh 粘贴缓冲中串成一行;其他后端行为不变,TRACEPARENT 记录失败时的 unset 顺序和 env -i 转发语义均与原来一致,测试改为校验实际投递的暂存文件与真实执行结果。
Testing
I drove the fix live in disposable fm-lab-* Herdr sessions using bin/fm-herdr-lab.sh. The default session was never touched, and every teardown checked the fleet tripwire. At HEAD, a real
claudeworker spawned by fm-spawn.sh started: the Claude Code TUI rendered, Herdr reported agent=claude with status working, and no 'not valid in this context' lines appeared. The full real-Herdr launcher e2e also passed, including the executed-command check, the empty-allowlist env probe, the full TRACEPARENT equality check and FM_TASK_ID persisting after exit. With the base fm-spawn.sh swapped back in, both runs reproduced the reported bug exactly:export FM_TASK_ID=clA. '/tmp/.../launch...sh'→export: not valid in this context, and no agent started. The adjusted remote trace-context and remote compact-adviser fixture suites passed, as did the local compact-adviser regression. Those three suites use fake Herdr fixtures, so they are not live results and are recorded as untested here. tests/fm-gotmp.test.sh fails because its fake teardown root has no symlink for fm-supervision-engine-lib.sh. That test and fm-teardown.sh are unchanged from base, so this failure is not caused by this change.Evidence: Live Claude spawn pane at HEAD (Claude starts)
Source: Live Claude spawn pane at HEAD (Claude starts)
Evidence: Live Claude spawn pane with base fm-spawn.sh (export: not valid in this context)
Source: Live Claude spawn pane with base fm-spawn.sh (export: not valid in this context)
Evidence: Real Herdr launcher e2e at HEAD
Source: Real Herdr launcher e2e at HEAD
Evidence: Real Herdr launcher e2e with base fm-spawn.sh (fails)
Source: Real Herdr launcher e2e with base fm-spawn.sh (fails)
Evidence: Base reproduction excerpt
Evidence: Remote secondmate trace-context suite
Source: Remote secondmate trace-context suite
Evidence: Remote compact-adviser suite
Source: Remote compact-adviser suite
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-backend-herdr-launcher-workspace-e2e.test.sh(real Herdr 0.9.3, guarded fm-lab-* session) at HEADCounterfactual: same e2e withgit show fb75c1f:bin/fm-spawn.shswapped in, then restored viagit checkout -- bin/fm-spawn.shLive real-Claude spawn:bin/fm-spawn.sh clA <scratch-project> claude --backend herdr --mode no-mistakes --yolo offin a provisioned fm-lab-fm-claude-live-* session, pane captured viafm-herdr-lab.sh run ... pane read, thenfm-herdr-lab.sh teardownCounterfactual: same live Claude spawn against base bin/fm-spawn.shbash tests/fm-remote-secondmate-trace-context.test.shbash tests/fm-spawn-compact-adviser-disable-remote.test.shbash tests/fm-spawn-compact-adviser-disable.test.sh(non-Herdr delivery path regression)bash tests/fm-gotmp.test.sh(fails in an unchanged teardown fixture, unrelated to this diff)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.