feat(hooks): include final assistant message in Stop payload - #2443
feat(hooks): include final assistant message in Stop payload#2443ousamabenyounes wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: ee99610 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ad8691842
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
2ad8691 to
ee99610
Compare
|
Addressed the v2 Stop-hook payload gap in |
Related Issue
Resolve #2123
Problem
Stop hooks cannot inspect the assistant response that is about to end the turn, so they cannot validate or conditionally reject that response.
What changed
last_assistant_messageTest verification (RED → GREEN)
RED on unmodified upstream
origin/main(17dfd4976) with only the regression test:GREEN with this patch:
Full local suite proof
The complete
agent-coresuite is iso-or-better against an exact clean-main baseline:The same 63 pre-existing failures occur in both runs and come from missing local workspace/profile fixtures (
workspace.additional_dirand thereviewerprofile); this patch adds one passing test and no failure or skip.Additional validation:
Independent PR review: PASS. Final read-only Codex review: PASS.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.Follow-up review fix
The v2 agent path now sends the same
last_assistant_messagefield as the legacy Stop-hook path, sourced from the latest assistant entry in v2 context memory. The generated v2 state manifest was refreshed after the import change.{ stopHookActive: false }without the documented assistant field.22/22; the full repository run reached16,852passing tests with one unrelated Kap Server timeout that passed immediately in focused replay.