Dev server loses its exit code and output across a stimd restart: bring back a per-workspace helper as its parent
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- node.js, react-native, typescript
Research direction
Start with the regression audit in packages/stim-cli/src/stimd/metro/children.ts, stimd/metro/child-server.ts, and stimd/main.ts, then read the 1.40.0 versions of those files. The proposed design starts as an llp/ decision document; define how a per-workspace helper survives stimd restarts and preserves output and exit status. Done means the decision document is reviewed and implementation scope is clear.
Written by the indexing model from the issue text.
Description
Problem
Since the per-workspace dev-server supervisor moved into stimd, Metro (Expo child, metro.command, bare React Native metro-host.cjs, Re.Pack) is a stimd child. When stimd restarts (crash, in-place update, engine switch, idle exit), the new stimd adopts the running dev server without a process handle:
- its exit code is lost: the adopted child settles with
settleExited(child, null, null)and logs "exit code unknown"; - output written between the dead stimd's last read and adoption is never recorded, because offsets are saved only on a graceful close and the adopter starts at end of file;
- output written by group members after the leader exits is not captured, because the tail stops at the leader's
exit; - on Windows a running dev server holds a stimd update and stops with stimd.
1.40's supervisor held the dev server's pipes and recorded its exit code.
Maintainer decisions, 2026-11-12: "i think supervisors might still be needed to allow stimd restarting? I think we need to keep this in mind for future designs" and "Bring back helper for both and fix 3 to 6 in stimd". This issue covers the dev server; the physical iPhone console helper is a separate lane.
Evidence
Regression audit of v1.40.0 against origin/main 7aa28e5a8, sections A1, A3, A4, A6: packages/stim-cli/src/stimd/metro/children.ts (adoption with handle: null, settle with null code, leader-exit early return), stimd/metro/child-server.ts (tail start offset, tail stops at leader exit), stimd/main.ts (heldBy: 'dev-servers' on Windows).
Cause
The process that holds the dev server's pipes and is its parent is stimd. The exit status of a process can only be read by its parent, and a pipe or tail that the parent owns ends with it.
Fix idea
A small per-workspace helper process, detached from stimd, is the dev server's parent. It holds the pipes, writes every line and the exit (code or signal) to the workspace's Metro log sink, and survives stimd restarts. stimd stays the coordinator (start, stop, readiness, Metro claim, heartbeat, adoption) and finds the helper again through its claim and verified process identity. Design first as an llp/ decision document, then implementation.
- Dominant language
- TypeScript
- Stars
- 100
- Forks
- 8
- Avg merge
- 4h 24m
- Merged PRs (30d)
- 971
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from appandflow/stim
-
area: cli priority: P3 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
appandflow/stim#5640 · 1 comment ·
Maintainers usually reply within 1 day
-
tests: stream tests read an empty pid file as pid 0 and kill(0, 0) succeedsPossibly taken @janicduplessis claimed this today. Openarea: cli priority: P2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
appandflow/stim#5637 · 1 comment ·
Maintainers usually reply within 1 day
-
area: cli priority: P2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
appandflow/stim#5509 ·
Maintainers usually reply within 1 day
-
area: repo priority: P2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
appandflow/stim#5475 ·
Maintainers usually reply within 1 day
-
area: cli priority: P3 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
appandflow/stim#5403 ·
Maintainers usually reply within 1 day
Similar issues
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededPossibly taken @github-actions claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SSWConsulting/SSW.Rules#2809 · 1 comment ·
Maintainers usually reply within 1 day
-
automated-triage type/bug type/ci
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Translate the READMEOpendocumentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
asasemahmed/openboard#68 ·
Maintainers usually reply within 1 day