Skip to content

fix(issues): pull hook exits on subagent input, delta stays with the head agent - #551

Merged
aaronsb merged 1 commit into
mainfrom
fix/issues-pull-skip-subagents
Sep 21, 2026
Merged

aaronsb merged 1 commit into
mainfrom
fix/issues-pull-skip-subagents

Conversation

@aaronsb

@aaronsb aaronsb commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • PostToolUse fires inside subagents. A subagent's gh issue view ran the issues hook under the parent's session id, whispered the delta into the subagent, and consumed the previous snapshot. The head agent never saw opened #532 on 2026-09-19 (session 51270d38).
  • issues-pull.sh now exits before touching the store when the hook input carries agent_id. SessionStart and UserPromptSubmit do not fire in subagents, so the guard's live effect is the PostToolUse gh issue * lane.
  • The issues way states that the hooks act for the head agent only.

Test plan

  • tests/gh-tasks-test.sh drives the hook script with subagent and head inputs: 94 passed. Against the pre-fix hook the five new assertions fail.
  • /code-review medium on the diff: no findings.
  • ways lint and scripts/check-portability.sh clean.

Residual

A forced pull rotates the previous snapshot before the whisper reads it. A head agent's gh issue command landing while an earlier pull's delta is unread loses that delta the same way. Filed separately.

… to the head agent

PostToolUse fires inside subagents. When a subagent ran `gh issue view`, the
hook force-pulled under the parent's session id, whispered the delta into the
subagent's context, and deleted the previous snapshot. The head agent never
saw the "opened" line (session 51270d38, 2026-09-19).

The hook now reads agent_id from the hook input and exits before touching the
store when it is set. The test drives issues-pull.sh with subagent and head
inputs: the subagent run leaves snapshot.prev.json in place and the delta
still whispers to the head; the head run gets the PostToolUse context.
@aaronsb
aaronsb merged commit d3ba655 into main Sep 21, 2026
4 checks passed
@aaronsb
aaronsb deleted the fix/issues-pull-skip-subagents branch September 21, 2026 18:59
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.

1 participant