fix: preserve prompt-submit and stop lifecycle events#179
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b7e1b1cf3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/native_hooks.rs
Outdated
| "userpromptsubmit" | "user-prompt-submit" | "user-prompt-submitted" | "prompt-submitted" => { | ||
| Some("session.prompt-submitted") |
There was a problem hiding this comment.
Accept canonical prompt-submitted hook event names
map_common_event now accepts canonical dotted names for session.prompt-delivered, session.prompt-delivery-failed, and session.stopped, but the prompt-submitted arm omits session.prompt-submitted. When a native hook payload already uses canonical event names (for example, a wrapper forwarding normalized events), incoming_event_from_native_hook_json will reject session.prompt-submitted as unsupported and drop that lifecycle signal while the other canonical prompt events are accepted.
Useful? React with 👍 / 👎.
1b7e1b1 to
a6d6111
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6d6111925
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| insert_u64_if_missing(object, "elapsed_secs", elapsed_secs); | ||
| insert_string_if_missing(object, "status", status); | ||
| insert_string_if_missing(object, "status", status.clone()); | ||
| insert_string_if_missing(object, "normalized_event", status); |
There was a problem hiding this comment.
Avoid deriving normalized_event from status globally
Setting normalized_event from status here causes unrelated events to be reclassified on the second normalization pass in from_incoming_event (src/event/compat.rs, line 22). For example, an event with kind github.ci-failed and payload status: "failed" will gain normalized_event: "failed", and then native_contract_kind remaps it to session.failed, changing routing/rendering semantics. This regression affects any non-native event payload that includes status values like started/finished/failed.
Useful? React with 👍 / 👎.
Summary
Testing
Closes #178