Skip to content

fix(spawn): wrap backend launches for shell portability - #179

Closed
benawad wants to merge 20 commits into
kunchenguid:mainfrom
benawad:fm/spawn-fish-shell-fix-v3
Closed

benawad wants to merge 20 commits into
kunchenguid:mainfrom
benawad:fm/spawn-fish-shell-fix-v3

Conversation

@benawad

@benawad benawad commented Jul 1, 2026 •

Copy link
Copy Markdown

What Changed

  • Wrapped generated spawn launches in bash -c so tmux, Herdr, crewmate, and secondmate starts behave consistently from non-bash pane shells while preserving raw launch commands.
  • Routed GOTMPDIR setup through the backend launch wrappers and added watcher trap handling so spawn and wake flows keep their environment and signal behavior intact.
  • Updated harness, secondmate, backend, and watcher coverage plus the related docs to reflect the wrapped launch path and verified pipeline fixes.

Risk Assessment

✅ Low: Captain, the change is a narrow launch-command wrapping fix with matching docs/tests and no substantiated merge-blocking issues found in the changed spawn/backend paths.

Testing

Completed 1 recorded test check.

  • Outcome: 🔧 1 issue found → auto-fixed (3) ✅ across 4 runs (50m1s)

Pipeline

Updates from git push no-mistakes

⏭️ **intent** - skipped

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

🔧 **Test** - 1 issue found → auto-fixed (3) ✅
  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"

🔧 Fix: Fix Herdr jq label variables
1 error still open:

  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"

🔧 Fix: No source changes required
1 error still open:

  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"

🔧 Fix: Captain, reset ignored HUP before arm trap
✅ Re-checked - no issues remain.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@benawad benawad changed the title fix: make Firstmate spawns and watcher signatures shell-portable fix: launch harness templates through bash Jul 1, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Thanks for the PR! It looks like this branch has a merge conflict with the base branch right now. When you get a chance, could you rebase onto (or merge in) the latest base branch, resolve the conflict, and push? Once GitHub shows the PR as mergeable again, it'll be picked back up for review.

Noted for firstmate#179 at 5b7776bf.

@benawad
benawad force-pushed the fm/spawn-fish-shell-fix-v3 branch from 5b7776b to f1ec56b Compare July 2, 2026 00:10
@benawad benawad changed the title fix: launch harness templates through bash fix: wrap templated harness launches for non-bash panes Jul 2, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Thanks for the PR! It looks like this branch has a merge conflict with the base branch right now. When you get a chance, could you rebase onto (or merge in) the latest base branch, resolve the conflict, and push? Once GitHub shows the PR as mergeable again, it'll be picked back up for review.

Noted for firstmate#179 at d1b9f9b5.

@benawad
benawad force-pushed the fm/spawn-fish-shell-fix-v3 branch from d1b9f9b to 85a582a Compare July 2, 2026 14:56
benawad added 20 commits July 2, 2026 07:58
Every harness template uses bash-only "$(cat __BRIEF__)" substitution,
sent via tmux send-keys to whatever interactive shell the pane runs.
Under fish (esp. pre-3.4) this fails outright. Wrap the fully assembled
LAUNCH string in shell_quote()'d bash -c so the pane shell only needs to
parse 'bash -c <string>', independent of its own syntax support.

Verified with a standalone repro: built the exact LAUNCH strings for
claude/opencode/codex/secondmate templates (incl. nested quotes and env
prefixes) and ran them wrapped under fish, bash, and zsh - identical
correct output in all three. Also confirmed the separate
'export GOTMPDIR=...' send-keys line is unaffected (fish supports plain
export VAR=val).


These files' Darwin-detection changes duplicate the fix already landed
more thoroughly in the still-open kunchenguid#163 (shared fm-stat-lib.sh). Restore
the prior uname-based branching here so this branch stays scoped to the
fish-shell launch fix.
@benawad
benawad force-pushed the fm/spawn-fish-shell-fix-v3 branch from 85a582a to e60faff Compare July 2, 2026 16:01
@benawad benawad changed the title fix: wrap templated harness launches for non-bash panes fix(spawn): wrap backend launches for shell portability Jul 2, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Thanks for the PR! It looks like this branch has a merge conflict with the base branch right now. When you get a chance, could you rebase onto (or merge in) the latest base branch, resolve the conflict, and push? Once GitHub shows the PR as mergeable again, it'll be picked back up for review.

Noted for firstmate#179 at e60faff8.

@benawad benawad closed this Jul 3, 2026
mseibert added a commit to mseibert/firstmate that referenced this pull request Sep 8, 2026
Three of the last five fleet PRs (kunchenguid#176, kunchenguid#177, kunchenguid#179) shipped a review
verdict older than their branch head, because a commit or rebase landed
after the verdict and invalidated it, costing a full loop round. Embed
the ordering structurally in the ship brief instead of relying on
per-task discipline: implement and fix, rebase onto the current main as
the last code step, then request the verdict, then freeze the branch
until the verdict covers the head, checking mergeability before every
verdict request.

The ordering lives once in fm_verdict_ordering_block and is rendered
into the direct-PR and no-mistakes definitions of done (the two modes
that request a review verdict); local-only never requests one and stays
free of it. Tests pin the generated briefs for both verdict modes and
the local-only negative; docs updated.
mseibert added a commit to mseibert/firstmate that referenced this pull request Sep 8, 2026
)

Three of the last five fleet PRs (kunchenguid#176, kunchenguid#177, kunchenguid#179) shipped a review
verdict older than their branch head, because a commit or rebase landed
after the verdict and invalidated it, costing a full loop round. Embed
the ordering structurally in the ship brief instead of relying on
per-task discipline: implement and fix, rebase onto the current main as
the last code step, then request the verdict, then freeze the branch
until the verdict covers the head, checking mergeability before every
verdict request.

The ordering lives once in fm_verdict_ordering_block and is rendered
into the direct-PR and no-mistakes definitions of done (the two modes
that request a review verdict); local-only never requests one and stays
free of it. Tests pin the generated briefs for both verdict modes and
the local-only negative; docs updated.
@msylergy

Copy link
Copy Markdown

This issue was resolved in commit b2f741e (fix(clients): preserve in-progress Edit Client edits across background refetch, 2026-09-08). The fix adds a reseed decision gate in EditClientDialog that prevents form state reset when the same client arrives through a new object identity on background refetch. Regression coverage exists at src/lib/editClientReseed.test.ts, and the full test suite passes (1386/1386 tests). No further fix is required.

@sachindayl

Copy link
Copy Markdown

Which Compose artifacts remain on the iOS classpath (and why)

Two Compose artifacts stay on the iOS classpath, on purpose:

artifact why it is still there
org.jetbrains.compose.runtime (→ androidx.compose.runtime) The Compose compiler plugin requires the runtime on every compilation, the iOS ones included. It is pure Kotlin — no Skia, no ICU, no HarfBuzz.
org.jetbrains.compose.components (→ components-resources) The Compose resources plugin only generates the Res accessor class into commonMain while this is declared there (generateResClass = auto), and Res is read only by the Android screens. On iOS the klib links but is inert: no iOS code references its symbols.

So read this as "the Compose UI and Skia machinery is gone from iOS", not as "all Compose is gone from iOS". Everything that draws is gone, measured on the linked archive: 0 libskia, 0 libicu, 0 libharfbuzz, 0 libskottie/libsksg/libskparagraph and 0 image-codec objects.

The Review warning in the pipeline section ("two Compose artifacts are deliberately kept") records this decision; it is not an open defect.

Candidate follow-up, not attempted here

Removing the residual components-resources would mean generateResClass = always plus moving the Compose resources and their Res accessors to androidMain. That is a build-system change with a real chance of breaking Android resource loading, so it belongs in a separate change with its own evidence. Open size question for it: how many bytes do compose.runtime + components-resources still contribute to the shipped framework once -dead_strip has run? That is not measured, and it is the number that would justify doing the follow-up at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants