Skip to content

fix: preserve prompt-submit and stop lifecycle events#179

Merged
Yeachan-Heo merged 1 commit intodevfrom
clawhip-issue-178-first-prompt-delivery
Apr 8, 2026
Merged

fix: preserve prompt-submit and stop lifecycle events#179
Yeachan-Heo merged 1 commit intodevfrom
clawhip-issue-178-first-prompt-delivery

Conversation

@Yeachan-Heo
Copy link
Copy Markdown
Owner

Summary

  • accept UserPromptSubmit and Stop in native hook ingress instead of dropping or collapsing them
  • add canonical session prompt/stop lifecycle events for submit, delivered, delivery-failed, and stopped
  • update compat/render/docs/tests so the new events route truthfully

Testing

  • cargo test native_hook_maps_session_start
  • cargo test maps_all_canonical_session_events_to_typed_agent_variants
  • cargo test native_hook_maps_user_prompt_submit
  • cargo test native_hook_maps_stop_to_stopped_not_finished

Closes #178

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +224 to +225
"userpromptsubmit" | "user-prompt-submit" | "user-prompt-submitted" | "prompt-submitted" => {
Some("session.prompt-submitted")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Yeachan-Heo Yeachan-Heo force-pushed the clawhip-issue-178-first-prompt-delivery branch from 1b7e1b1 to a6d6111 Compare April 8, 2026 20:13
@Yeachan-Heo Yeachan-Heo merged commit 4eaf235 into dev Apr 8, 2026
11 checks passed
@Yeachan-Heo Yeachan-Heo deleted the clawhip-issue-178-first-prompt-delivery branch April 8, 2026 20:15
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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