@hayasaka7/haya-pet 0.3.2 → 0.3.3
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/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ All notable changes to HAYA Pet are documented here. This project adheres to
|
|
|
7
7
|
> 0.2.0 npm publish; they are listed under 0.2.1, which is the first version that
|
|
8
8
|
> ships them.
|
|
9
9
|
|
|
10
|
+
## [0.3.3]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **Claude Code subagent completion no longer changes the main session status.**
|
|
14
|
+
Claude Code can emit `SubagentStop` after the main agent has already stopped,
|
|
15
|
+
so treating that event as `idle` could make the pet react to a stale subagent
|
|
16
|
+
completion instead of the main agent's real state. The Claude hook adapter now
|
|
17
|
+
ignores `SubagentStop`; the main turn still ends on Claude's `Stop` event.
|
|
18
|
+
|
|
10
19
|
## [0.3.2]
|
|
11
20
|
|
|
12
21
|
### Changed
|
package/README.md
CHANGED
package/docs/known-issues.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Issues found in live use, with their current status.
|
|
4
4
|
|
|
5
|
+
## ✅ Resolved: Claude Code subagent completion changed the main session status
|
|
6
|
+
|
|
7
|
+
- **Symptom:** In Claude Code multi-agent runs, the main agent could already be
|
|
8
|
+
stopped while a subagent was still finishing. When that late subagent emitted
|
|
9
|
+
`SubagentStop`, the pet treated it as a main-session `idle` update and could
|
|
10
|
+
show a misleading working/done transition after the main agent had settled.
|
|
11
|
+
- **Root cause:** The Claude hook table mapped `SubagentStop` to `idle`. That is
|
|
12
|
+
only safe if subagent completion is ordered before the main turn finishes, which
|
|
13
|
+
Claude Code does not guarantee.
|
|
14
|
+
- **Fix:** Claude `SubagentStop` is now ignored. Main-session idle still comes
|
|
15
|
+
from Claude's real `Stop` hook, while late subagent completion cannot override
|
|
16
|
+
the current main-agent state. Codex keeps its separate behavior because Codex
|
|
17
|
+
uses `Stop` as the only idle signal and treats `SubagentStop` as mid-turn.
|
|
18
|
+
|
|
5
19
|
## ✅ Resolved: false "waiting for approval" while Codex auto-reviews an approval (Approve for me)
|
|
6
20
|
|
|
7
21
|
- **Symptom:** Running Codex under the pet with the **"Approve for me"** preset
|
|
@@ -228,8 +242,9 @@ observation (`--observe`) or L1 lifecycle as the fallback. Current state:
|
|
|
228
242
|
lifecycle status). Live in-session status is **opt-in** via `HAYA_PET_HOOKS=1`,
|
|
229
243
|
which injects a settings file (`claude --settings <stable-file>`, no change to
|
|
230
244
|
your global config) wiring Claude's `UserPromptSubmit`/`PreToolUse`/`PostToolUse`/
|
|
231
|
-
`Notification`/`PreCompact`/`Stop
|
|
232
|
-
|
|
245
|
+
`Notification`/`PreCompact`/`Stop` events to `haya-pet state <state>`, reported
|
|
246
|
+
to the daemon over the IPC pipe. `SubagentStop` is intentionally ignored because
|
|
247
|
+
it is not a main-turn idle signal. `PreToolUse` distinguishes
|
|
233
248
|
file-editing tools (`Edit`/`Write`/`MultiEdit`/`NotebookEdit` → *editing files*)
|
|
234
249
|
from other tools (→ *running tools*) via the hook `matcher`. **Why opt-in:**
|
|
235
250
|
injecting hooks makes Claude show a one-time *review hooks* trust prompt; the
|
package/docs/troubleshooting.md
CHANGED
|
@@ -16,6 +16,7 @@ deferred problems with known root causes.
|
|
|
16
16
|
| Terminal scroll / Shift+Tab / backspace odd while a CLI runs under `haya-pet run` | Fixed — `haya-pet run` now uses native passthrough by default (full fidelity). If you opted into `--observe`, drop it. See [known-issues.md](known-issues.md). |
|
|
17
17
|
| Pet shows only **idle/lifecycle** while **Claude Code** works | Live in-session status is opt-in: run `haya-pet hooks on` once (persisted). The first `haya-pet run` afterward shows a one-time Claude *review hooks* prompt — approve it. Also make sure the companion is running (`haya-pet start`). Check the toggle with `haya-pet hooks status`. |
|
|
18
18
|
| Typing doesn't work / **Claude Code** TUI frozen under `haya-pet run` | You have hooks enabled and Claude is showing its *review hooks* trust prompt (approve it once), or your Claude is too old for `--settings`. Run `haya-pet hooks off` (or set `HAYA_PET_NO_HOOKS=1`) for native passthrough with lifecycle-only status — typing and Shift+Tab work normally. |
|
|
19
|
+
| Pet changes status after a **Claude Code** subagent finishes, even though the main agent already stopped | Fixed — Claude `SubagentStop` is ignored because it is not a reliable main-turn state. Update to the latest version and restart the wrapped Claude session so the new hook settings are used. |
|
|
19
20
|
| Pet shows only **idle/lifecycle** while **Codex** works | Live status is opt-in: run `haya-pet hooks on` once (persisted, global), then `haya-pet run --client codex -- codex`; approve Codex's one-time *review hooks* prompt. `thinking`/`idle` come from hooks, `running_tool`/`editing_files` from a transcript watcher, and approval states from the `PermissionRequest` hook plus a guardian-review watcher. |
|
|
20
21
|
| Pet showed **waiting for approval** while **Codex** auto-reviewed the request ("Approve for me") | Fixed — with `approvals_reviewer = auto_review` (legacy `guardian_subagent`) Codex's guardian decides without asking you; the pet now shows **reviewing** during the assessment, then **working** on an allow verdict or **thinking** on a deny. *Waiting for approval* still shows when Codex actually asks you (`approvals_reviewer = "user"`). |
|
|
21
22
|
| **Codex** live status didn't turn on / you pass your own `-p`/`--profile` | Codex allows only one profile, so haya-pet skips hook injection when you supply your own and prints a notice. Drop your `-p` for that run to get live status, or accept lifecycle-only. |
|
package/package.json
CHANGED
|
@@ -34,8 +34,7 @@ const HOOK_TABLE = Object.freeze([
|
|
|
34
34
|
{ event: "PermissionDenied", state: "idle", summary: "denied" },
|
|
35
35
|
{ event: "PreCompact", state: "compacting" },
|
|
36
36
|
{ event: "Stop", state: "idle" },
|
|
37
|
-
{ event: "StopFailure", state: "idle", summary: "stopped" }
|
|
38
|
-
{ event: "SubagentStop", state: "idle" }
|
|
37
|
+
{ event: "StopFailure", state: "idle", summary: "stopped" }
|
|
39
38
|
]);
|
|
40
39
|
|
|
41
40
|
// Resolve the pet state for a Claude event. `detail` is the tool name for
|
|
@@ -9,12 +9,15 @@ test("mapClaudeEventToState covers activity events", () => {
|
|
|
9
9
|
assert.equal(mapClaudeEventToState("PreCompact"), "compacting");
|
|
10
10
|
assert.equal(mapClaudeEventToState("Stop"), "idle");
|
|
11
11
|
assert.equal(mapClaudeEventToState("StopFailure"), "idle");
|
|
12
|
-
assert.equal(mapClaudeEventToState("SubagentStop"), "idle");
|
|
13
12
|
assert.equal(mapClaudeEventToState("PermissionDenied"), "idle");
|
|
14
13
|
assert.equal(mapClaudeEventToState("PermissionRequest"), "waiting_approval");
|
|
15
14
|
assert.equal(mapClaudeEventToState("Unknown"), undefined);
|
|
16
15
|
});
|
|
17
16
|
|
|
17
|
+
test("mapClaudeEventToState ignores Claude SubagentStop", () => {
|
|
18
|
+
assert.equal(mapClaudeEventToState("SubagentStop"), undefined);
|
|
19
|
+
});
|
|
20
|
+
|
|
18
21
|
test("mapClaudeEventToState branches PreToolUse on tool name", () => {
|
|
19
22
|
assert.equal(mapClaudeEventToState("PreToolUse", "Bash"), "running_tool");
|
|
20
23
|
assert.equal(mapClaudeEventToState("PreToolUse", "Edit"), "editing_files");
|
|
@@ -80,8 +83,9 @@ test("buildClaudeHookSettings includes all subscribed events", () => {
|
|
|
80
83
|
for (const event of [
|
|
81
84
|
"UserPromptSubmit", "PreToolUse", "PostToolUse", "PostToolUseFailure",
|
|
82
85
|
"PermissionRequest", "Notification", "PermissionDenied", "PreCompact",
|
|
83
|
-
"Stop", "StopFailure"
|
|
86
|
+
"Stop", "StopFailure"
|
|
84
87
|
]) {
|
|
85
88
|
assert.ok(settings.hooks[event], `missing hook event ${event}`);
|
|
86
89
|
}
|
|
90
|
+
assert.equal(settings.hooks.SubagentStop, undefined);
|
|
87
91
|
});
|