@a5c-ai/babysitter-codex 0.1.11-staging.f6cb97d6 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/bin/install-shared.js +2 -5
- package/hooks/babysitter-session-start.sh +1 -1
- package/hooks/babysitter-stop-hook.sh +1 -1
- package/hooks/user-prompt-submit.sh +1 -1
- package/hooks.json +3 -3
- package/package.json +2 -2
- package/skills/babysit/SKILL.md +8 -5
- package/skills/doctor/SKILL.md +15 -101
package/README.md
CHANGED
|
@@ -83,10 +83,9 @@ Verify the active shared process-library binding:
|
|
|
83
83
|
babysitter process-library:active --json
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
On native Windows, Codex
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
not fire after install, run `codex --version` and upgrade if needed.
|
|
86
|
+
On native Windows, Codex currently does not execute hooks. The plugin still
|
|
87
|
+
installs correctly, but the lifecycle hooks will not fire until Codex enables
|
|
88
|
+
Windows hook execution.
|
|
90
89
|
|
|
91
90
|
## License
|
|
92
91
|
|
package/bin/install-shared.js
CHANGED
|
@@ -489,11 +489,8 @@ function warnWindowsHooks() {
|
|
|
489
489
|
if (process.platform !== 'win32') {
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
// pinned/older versions know to upgrade.
|
|
495
|
-
console.warn('[babysitter] Note: Codex hooks on Windows require Codex CLI >= 0.119.0.');
|
|
496
|
-
console.warn('[babysitter] If hooks do not fire, run `codex --version` and upgrade if you are below 0.119.0.');
|
|
492
|
+
console.warn('[babysitter] Warning: Codex hooks are currently disabled on native Windows.');
|
|
493
|
+
console.warn('[babysitter] The plugin will install correctly, but SessionStart/UserPromptSubmit/Stop hooks will not fire until Codex enables Windows hook execution.');
|
|
497
494
|
}
|
|
498
495
|
|
|
499
496
|
module.exports = {
|
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
5
|
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
6
|
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
-
LOG_DIR="${BABYSITTER_LOG_DIR:-$
|
|
7
|
+
LOG_DIR="${BABYSITTER_LOG_DIR:-$PLUGIN_ROOT/.a5c/logs}"
|
|
8
8
|
LOG_FILE="$LOG_DIR/babysitter-session-start-hook.log"
|
|
9
9
|
|
|
10
10
|
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
5
|
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
6
|
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
-
LOG_DIR="${BABYSITTER_LOG_DIR:-$
|
|
7
|
+
LOG_DIR="${BABYSITTER_LOG_DIR:-$PLUGIN_ROOT/.a5c/logs}"
|
|
8
8
|
LOG_FILE="$LOG_DIR/babysitter-stop-hook.log"
|
|
9
9
|
|
|
10
10
|
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
5
|
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
6
|
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
-
LOG_DIR="${BABYSITTER_LOG_DIR:-$
|
|
7
|
+
LOG_DIR="${BABYSITTER_LOG_DIR:-$PLUGIN_ROOT/.a5c/logs}"
|
|
8
8
|
|
|
9
9
|
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
10
10
|
export BABYSITTER_STATE_DIR="${STATE_DIR}"
|
package/hooks.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"hooks": {
|
|
3
3
|
"SessionStart": [
|
|
4
4
|
{
|
|
5
|
-
"matcher": "
|
|
5
|
+
"matcher": "*",
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"UserPromptSubmit": [
|
|
15
15
|
{
|
|
16
|
-
"matcher": "
|
|
16
|
+
"matcher": "*",
|
|
17
17
|
"hooks": [
|
|
18
18
|
{
|
|
19
19
|
"type": "command",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"Stop": [
|
|
26
26
|
{
|
|
27
|
-
"matcher": "
|
|
27
|
+
"matcher": "*",
|
|
28
28
|
"hooks": [
|
|
29
29
|
{
|
|
30
30
|
"type": "command",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-codex",
|
|
3
|
-
"version": "0.1.11
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Babysitter Codex skill bundle and integration package for OpenAI Codex CLI with SDK-managed process-library bootstrapping, 15 orchestration modes, and BOM-safe SKILL installation",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node test/integration.test.js && node test/packaged-install.test.js",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-codex#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@a5c-ai/babysitter-sdk": "0.0.188
|
|
48
|
+
"@a5c-ai/babysitter-sdk": "0.0.188"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/skills/babysit/SKILL.md
CHANGED
|
@@ -18,27 +18,30 @@ Read the SDK version from `versions.json` to ensure version compatibility:
|
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${CODEX_PLUGIN_ROOT}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}")
|
|
21
|
-
|
|
21
|
+
sudo npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
|
|
22
|
+
# sudo is depending on the env and system
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
then use the CLI alias: CLI="babysitter"
|
|
26
|
+
|
|
27
|
+
**Alternatively, use the CLI alias:** `CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"`
|
|
25
28
|
|
|
26
29
|
### jq
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
make sure you have jq installed and available in the path. if not, install it.
|
|
29
32
|
|
|
30
33
|
## Instructions
|
|
31
34
|
|
|
32
35
|
Run the following command to get full orchestration instructions:
|
|
33
36
|
|
|
34
37
|
```bash
|
|
35
|
-
|
|
38
|
+
babysitter instructions:babysit-skill --harness codex --interactive
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
For non-interactive runs (e.g., with `-p` flag or no question tool):
|
|
39
42
|
|
|
40
43
|
```bash
|
|
41
|
-
|
|
44
|
+
babysitter instructions:babysit-skill --harness codex --no-interactive
|
|
42
45
|
```
|
|
43
46
|
|
|
44
47
|
Follow the instructions returned by the command above to orchestrate the run.
|
package/skills/doctor/SKILL.md
CHANGED
|
@@ -5,9 +5,9 @@ description: Diagnose babysitter run health - journal integrity, state cache, ef
|
|
|
5
5
|
|
|
6
6
|
# doctor
|
|
7
7
|
|
|
8
|
-
You are a diagnostic agent for the babysitter runtime. Your job is to perform a comprehensive health check across
|
|
8
|
+
You are a diagnostic agent for the babysitter runtime. Your job is to perform a comprehensive health check across 10 areas and produce a structured diagnostic report. Follow each section methodically. Track results as you go and produce the final summary at the end.
|
|
9
9
|
|
|
10
|
-
Initialize a results tracker with these
|
|
10
|
+
Initialize a results tracker with these 10 checks, all starting as PENDING:
|
|
11
11
|
1. Run Discovery
|
|
12
12
|
2. Journal Integrity
|
|
13
13
|
3. State Cache Consistency
|
|
@@ -18,10 +18,6 @@ Initialize a results tracker with these 14 checks, all starting as PENDING:
|
|
|
18
18
|
8. Disk Usage
|
|
19
19
|
9. Process Validation
|
|
20
20
|
10. Hook Execution Health
|
|
21
|
-
11. Session-ID Provenance
|
|
22
|
-
12. Ancestor Liveness
|
|
23
|
-
13. Concurrent Session Detection
|
|
24
|
-
14. Windows Ancestor-Walk Strategy
|
|
25
21
|
|
|
26
22
|
---
|
|
27
23
|
|
|
@@ -182,13 +178,13 @@ Mark as PASS if no issues. Mark as WARN if runaway loops or stale sessions detec
|
|
|
182
178
|
**Goal:** Analyze babysitter log files for errors, warnings, and stop hook decisions.
|
|
183
179
|
|
|
184
180
|
Read the last 50 lines of each of these log files (if they exist):
|
|
185
|
-
- `$
|
|
186
|
-
- `$
|
|
187
|
-
- `$
|
|
188
|
-
- `$
|
|
189
|
-
- `$
|
|
190
|
-
- `$
|
|
191
|
-
- `$
|
|
181
|
+
- `$CLAUDE_PLUGIN_ROOT/.a5c/logs/hooks.log`
|
|
182
|
+
- `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook.log`
|
|
183
|
+
- `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook-stderr.log`
|
|
184
|
+
- `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-session-start-hook.log`
|
|
185
|
+
- `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-session-start-hook-stderr.log`
|
|
186
|
+
- `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter.log`
|
|
187
|
+
- `$HOME/.a5c/logs/` and relevant logs and run/session specific logs there
|
|
192
188
|
|
|
193
189
|
|
|
194
190
|
For each log file:
|
|
@@ -290,7 +286,7 @@ The hooks delegate to the `babysitter` CLI. Check if it is available:
|
|
|
290
286
|
Check whether the stop hook has actually been invoked during this run's lifetime:
|
|
291
287
|
|
|
292
288
|
**From log files:**
|
|
293
|
-
- Read `$
|
|
289
|
+
- Read `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook.log` (if it exists).
|
|
294
290
|
- Count the number of "Hook script invoked" lines. This is the total invocation count.
|
|
295
291
|
- Count the number of "CLI exit code=" lines and extract exit codes.
|
|
296
292
|
- If the log file does not exist or has zero invocations, the stop hook has NOT been running.
|
|
@@ -302,7 +298,7 @@ Check whether the stop hook has actually been invoked during this run's lifetime
|
|
|
302
298
|
- If no STOP_HOOK_INVOKED events exist in the journal, note that the stop hook has not recorded any decisions for this run.
|
|
303
299
|
|
|
304
300
|
**From stderr:**
|
|
305
|
-
- Read `$
|
|
301
|
+
- Read `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook-stderr.log`.
|
|
306
302
|
- If it contains error output, display it and diagnose:
|
|
307
303
|
- "command not found" or exit code 127 → CLI not installed (see 10c)
|
|
308
304
|
- "MODULE_NOT_FOUND" or "Cannot find module" → SDK package corrupted or not built
|
|
@@ -355,65 +351,9 @@ Mark as FAIL if:
|
|
|
355
351
|
|
|
356
352
|
---
|
|
357
353
|
|
|
358
|
-
## 11. Session-ID Provenance
|
|
359
|
-
|
|
360
|
-
**Goal:** Verify how the current babysitter session ID was resolved and flag stale or shadowed values.
|
|
361
|
-
|
|
362
|
-
- Invoke: `npx babysitter session:whoami --json`
|
|
363
|
-
- Parse the output and inspect the `resolvedFrom` field. Classify as follows:
|
|
364
|
-
- `resolvedFrom: "pid-marker"` → mark as PASS ("Session ID derives from the live Claude Code ancestor process -- authoritative").
|
|
365
|
-
- `resolvedFrom: "env-file"` → mark as PASS with a note ("CLAUDE_ENV_FILE was used; typically healthy").
|
|
366
|
-
- `resolvedFrom: "env-var"` → mark as WARN ("`BABYSITTER_SESSION_ID` is set without a corroborating PID marker. Likely stale from a prior Claude Code session -- see GitHub issue #130").
|
|
367
|
-
- Remediation: run `babysitter session:cleanup` and start a fresh Claude Code session, or `unset BABYSITTER_SESSION_ID` before invoking babysitter.
|
|
368
|
-
- `resolvedFrom: "none"` → mark as ERROR ("No session ID resolvable. Either no session-start hook fired, or the ancestor walk failed").
|
|
369
|
-
|
|
370
|
-
**Env-var shadow check:**
|
|
371
|
-
- Independently inspect `envVarPresent` and `envVarMatches` in the output.
|
|
372
|
-
- If `envVarPresent && !envVarMatches`, mark as WARN ("`BABYSITTER_SESSION_ID` in env does not match the resolved session ID; a stale value is shadowing the authoritative one. Unset the env var").
|
|
373
|
-
|
|
374
|
-
---
|
|
375
|
-
|
|
376
|
-
## 12. Ancestor Liveness
|
|
377
|
-
|
|
378
|
-
**Goal:** Confirm the PID marker references a live Claude Code process.
|
|
379
|
-
|
|
380
|
-
- Reuse the `session:whoami --json` output from check 11.
|
|
381
|
-
- Inspect the `ancestorAlive` field.
|
|
382
|
-
- If `ancestorAlive === false`, mark as ERROR ("The PID marker references a dead Claude Code process").
|
|
383
|
-
- Remediation: `babysitter session:cleanup`.
|
|
384
|
-
- Otherwise mark as PASS.
|
|
385
|
-
|
|
386
|
-
---
|
|
387
|
-
|
|
388
|
-
## 13. Concurrent Session Detection
|
|
389
|
-
|
|
390
|
-
**Goal:** Surface multiple live harness sessions that may compete for the same session ID.
|
|
391
|
-
|
|
392
|
-
- Enumerate files in `~/.a5c/` matching the pattern `current-session-*-pid-*`.
|
|
393
|
-
- Count markers per harness (derived from the filename).
|
|
394
|
-
- If more than one live marker exists for the same harness, mark as INFO ("Multiple live Claude Code / harness sessions detected; ensure each shell scopes `BABYSITTER_SESSION_ID` appropriately -- the PID marker handles this automatically").
|
|
395
|
-
- Otherwise mark as PASS.
|
|
396
|
-
|
|
397
|
-
---
|
|
398
|
-
|
|
399
|
-
## 14. Windows Ancestor-Walk Strategy
|
|
400
|
-
|
|
401
|
-
**Goal:** Verify the ancestor-walk strategy works on Windows, where `wmic` is no longer guaranteed to be present.
|
|
402
|
-
|
|
403
|
-
- Only run this check when `process.platform === 'win32'`. On other platforms, mark as PASS ("Not applicable -- non-Windows platform").
|
|
404
|
-
- Attempt the ancestor walk by invoking `npx babysitter session:whoami --json` (reuse output from check 11 if available).
|
|
405
|
-
- If resolution succeeded (any `resolvedFrom` other than `none`), mark as PASS.
|
|
406
|
-
- If `resolvedFrom: "none"` on Windows:
|
|
407
|
-
- Test `wmic` availability: `where wmic` via shell.
|
|
408
|
-
- If absent, document that Windows 11 24H2 removed `wmic`; the fallback PowerShell CIM path should handle this.
|
|
409
|
-
- If the PowerShell ancestor walk also failed, mark as ERROR with remediation: ensure PowerShell is available (`powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter ProcessId=$PID"` should work).
|
|
410
|
-
- If the cascade works but is slow (>5s on first probe), add an INFO note on first-probe latency.
|
|
411
|
-
|
|
412
|
-
---
|
|
413
|
-
|
|
414
354
|
## Final Report
|
|
415
355
|
|
|
416
|
-
After completing all
|
|
356
|
+
After completing all 10 checks, produce the diagnostic report in this format:
|
|
417
357
|
|
|
418
358
|
```
|
|
419
359
|
============================================
|
|
@@ -440,10 +380,6 @@ OVERALL HEALTH: <HEALTHY | WARNING | CRITICAL>
|
|
|
440
380
|
| 8 | Disk Usage | <status> |
|
|
441
381
|
| 9 | Process Validation | <status> |
|
|
442
382
|
| 10 | Hook Execution Health | <status> |
|
|
443
|
-
| 11 | Session-ID Provenance | <status> |
|
|
444
|
-
| 12 | Ancestor Liveness | <status> |
|
|
445
|
-
| 13 | Concurrent Session Detection | <status> |
|
|
446
|
-
| 14 | Windows Ancestor-Walk Strategy | <status> |
|
|
447
383
|
|
|
448
384
|
--------------------------------------------
|
|
449
385
|
ISSUES & RECOMMENDATIONS
|
|
@@ -457,9 +393,9 @@ OVERALL HEALTH: <HEALTHY | WARNING | CRITICAL>
|
|
|
457
393
|
```
|
|
458
394
|
|
|
459
395
|
**Overall health determination:**
|
|
460
|
-
- **HEALTHY**: All
|
|
461
|
-
- **WARNING**: At least one check is WARN but none are FAIL
|
|
462
|
-
- **CRITICAL**: At least one check is FAIL
|
|
396
|
+
- **HEALTHY**: All 10 checks are PASS.
|
|
397
|
+
- **WARNING**: At least one check is WARN but none are FAIL.
|
|
398
|
+
- **CRITICAL**: At least one check is FAIL.
|
|
463
399
|
|
|
464
400
|
Present the full detailed findings for each check BEFORE the summary table, so the user can see the evidence. End with the summary table and recommendations. Also, create a single HTML report file with all the findings that uses the arwes UI framework and open it for the user in the browser.
|
|
465
401
|
|
|
@@ -489,25 +425,3 @@ After diagnosing issues, prompt the user to report or fix what was found -- they
|
|
|
489
425
|
Example prompt after diagnosis:
|
|
490
426
|
|
|
491
427
|
> "Diagnosis found a stale lock -- process 12847 crashed without cleanup. This is a known edge case in the orchestration loop. Even if you don't want to fix it yourself, reporting it helps: run `/babysitter:contrib bug report: orchestration loop doesn't release lock on unhandled rejection` to open an issue."
|
|
492
|
-
|
|
493
|
-
---
|
|
494
|
-
|
|
495
|
-
## Self-Heal Suggestions
|
|
496
|
-
|
|
497
|
-
If any of checks 11-14 surface issues (stale env vars, dead ancestor PIDs, shadowed session IDs, or Windows ancestor-walk failures), suggest the following remediation sequence, in order. Present it as an actionable block:
|
|
498
|
-
|
|
499
|
-
```bash
|
|
500
|
-
# 1. Cleanup dead markers and orphaned state files
|
|
501
|
-
babysitter session:cleanup --dry-run # preview
|
|
502
|
-
babysitter session:cleanup # apply
|
|
503
|
-
|
|
504
|
-
# 2. Unset a stale env var
|
|
505
|
-
unset BABYSITTER_SESSION_ID
|
|
506
|
-
|
|
507
|
-
# 3. Re-bind a run explicitly if needed
|
|
508
|
-
babysitter session:resume --session-id <fresh-id> --state-dir ~/.a5c --run-id <runId> --runs-dir .a5c/runs
|
|
509
|
-
|
|
510
|
-
# 4. Start a fresh Claude Code session (closes and reopens the session)
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
Run steps 1 and 2 first; re-run `/babysitter:doctor` after each step to confirm the session-provenance checks return to PASS. Step 3 is only needed when a specific run must be re-bound to the fresh session. If the issue persists after step 4, escalate via `/debug` or `/babysitter:contrib`.
|