Skip to content

hooks: a subagent's hand-back draws no question context - #38

Merged
lneto merged 1 commit into
masterfrom
prompt-handback
Nov 26, 2026
Merged

lneto merged 1 commit into
masterfrom
prompt-handback

Conversation

@lneto

@lneto lneto commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

A subagent's hand-back reaches the session as a prompt that opens with <agent-message from="<id>">, and on-prompt.sh read it as the maintainer's: on 2026-11-26 one drew the [question] context, which told the turn that he had asked and that it changes nothing.

The hook now skips that opening as it skips a background task's <task-notification>, and a message he types is read as before.

Closes #34

on-prompt.sh skipped only a prompt that opens with `<task-notification>`.
A subagent's hand-back is queued as a prompt too, opening with
`<agent-message from="<id>">`, and on 2026-11-26 one drew the
`[question]` context, which told the turn that the maintainer had asked
and that it changes nothing. The skip takes that opening as well.

Closes #34

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto lneto added the complexity: small One line or one file, with a trivial or existing test label Nov 26, 2026
@lneto

lneto commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Note

This comment was written by an LLM, not a human.

Proof for head 99cc3dac589d7e781f22dced9ac0290fdc18a248.

Three prompts given to .claude/hooks/on-prompt.sh as hook input, {prompt, session_id, transcript_path: ""}, printing the first 40 characters of the context it adds:

  • handback: <agent-message from="a1df547bc7bc0fcff">, the hand-back's opening, then a report line that ends in a question mark
  • notification: <task-notification> and a line that ends in one
  • question: o que mais na fila?, a question the maintainer typed
for c in handback notification question; do printf '%s: ' $c; bash .claude/hooks/on-prompt.sh < $c.json | jq -r '.hookSpecificOutput.additionalContext[0:40] // empty'; echo; done

Before, on 1e9e601, the hand-back draws the question context:

handback: [question] The maintainer asked, and did
notification:
question: [question] The maintainer asked, and did

After, on this head, it draws nothing, and the maintainer's question still draws it:

handback:
notification:
question: [question] The maintainer asked, and did

@lneto
lneto merged commit fd8480b into master Nov 26, 2026
1 check passed
lneto added a commit to luainkernel/luaebpf that referenced this pull request Nov 26, 2026
The mount moves to luainkernel/harness@feb9545, which carries
luainkernel/harness#38 and luainkernel/harness#39.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lneto added a commit to luainkernel/lunatik that referenced this pull request Nov 26, 2026
The mount moves to luainkernel/harness@feb9545, which carries
luainkernel/harness#38 and luainkernel/harness#39.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto
lneto deleted the prompt-handback branch November 27, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: small One line or one file, with a trivial or existing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

on-prompt: a subagent's hand-back draws the question context

1 participant