Skip to content

feat(core): emit canonical hook prompt items#31630

Merged
owenlin0 merged 1 commit into
mainfrom
owen/ca-676-canonical-hook-prompts
Jul 8, 2026
Merged

feat(core): emit canonical hook prompt items#31630
owenlin0 merged 1 commit into
mainfrom
owen/ca-676-canonical-hook-prompts

Conversation

@owenlin0

@owenlin0 owenlin0 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR moves hook prompts onto the canonical TurnItem lifecycle in core.

Stop hooks now record their ResponseItem through the existing lifecycle path, which emits ItemStarted and ItemCompleted. App-server consumes those events directly instead of deriving a hook prompt from RawResponseItem.

Why

Hook prompts were the only ThreadItem app-server synthesized from RawResponseItem. This brings them in line with other core-owned turn items while preserving legacy rollout replay.

What changed

  • Route stop-hook prompts through record_response_item_and_emit_turn_item.
  • Materialize canonical hook prompts in ThreadHistoryBuilder.
  • Remove RawResponseItem to ThreadItem synthesis while preserving legacy rollout replay.
  • Add focused coverage for lifecycle emission and canonical and legacy history materialization.

@owenlin0 owenlin0 force-pushed the owen/ca-676-canonical-hook-prompts branch from 334cb41 to 0584975 Compare July 8, 2026 19:46
@owenlin0 owenlin0 marked this pull request as ready for review July 8, 2026 19:53
@owenlin0 owenlin0 requested a review from a team as a code owner July 8, 2026 19:53
@owenlin0 owenlin0 force-pushed the owen/ca-676-canonical-hook-prompts branch from 0584975 to 6f98e76 Compare July 8, 2026 20:26
@owenlin0 owenlin0 merged commit ba5dd1f into main Jul 8, 2026
35 checks passed
@owenlin0 owenlin0 deleted the owen/ca-676-canonical-hook-prompts branch July 8, 2026 20:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants