diff options
| author | Adam Malczewski <[email protected]> | 2026-06-05 15:52:42 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-05 15:52:42 +0900 |
| commit | 966caf74a75a6579a9a187ea3959dbe40d07164e (patch) | |
| tree | ec166d7a91cb40c58de4dde9bc8a051bc6a0e5ab | |
| parent | dded4cc5570f47167edf3ea36f232ad4a32bcbc4 (diff) | |
| download | dispatch-966caf74a75a6579a9a187ea3959dbe40d07164e.tar.gz dispatch-966caf74a75a6579a9a187ea3959dbe40d07164e.zip | |
docs(orchestrator): live-validation process cleanup — the [x] bracket trick (pkill self-match scar)
A plain pkill -f 'host-bin/src/main.ts' matches its own command line and kills the parent shell (no output -> looks like a wedged/timed-out session). Use the [h]ost-bin bracket trick in ps/pgrep/pkill, and always clean up the backgrounded app + spawned collector after each live run (leaked processes inflated counts and made a correct supervisor look buggy).
| -rw-r--r-- | ORCHESTRATOR.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ORCHESTRATOR.md b/ORCHESTRATOR.md index 4a5e114..c192569 100644 --- a/ORCHESTRATOR.md +++ b/ORCHESTRATOR.md @@ -300,6 +300,23 @@ curl -s -X POST localhost:4567/chat -H 'content-type: application/json' \ ``` Note the chat field is **`conversationId`** (threads multi-turn), not `tabId`. +**Live validation & process cleanup — the `[x]` bracket trick (scar tissue).** When +you live-validate you background the app (`bun packages/host-bin/src/main.ts &`), and it +now spawns a child **observability collector** process. To list or kill those, ALWAYS +use the bracket trick in `ps`/`pgrep`/`pkill` patterns: +```bash +ps -eo pid,args | grep '[o]bservability-collector/src/main' # list (won't self-match) +pkill -9 -f '[h]ost-bin/src/main.ts' # kill the app +pkill -9 -f '[o]bservability-collector/src/main' # kill the collector +``` +**Why it matters:** a plain `pkill -f 'host-bin/src/main.ts'` matches its OWN command +line and kills the parent shell → the tool call prints NOTHING and times out, looking +exactly like a wedged session. `[h]ost-bin` matches the target "host-bin" while the +literal pattern `[h]ost-bin` does not match itself. ALWAYS clean up the backgrounded app ++ its spawned collector after each live run — leaked processes pollute the next run's +counts (this is precisely what made a correct supervisor look like it spawned 3 +collectors and left 2 behind). + **Next suggested work** (post-MVP, see `tasks.md` "Open items"): wire auth→provider properly (auth-apikey is currently vestigial), then add the first TOOL extension to exercise the dispatch loop (turns currently run with `tools: |
