Skip to content

CM-72541: Report the model on every AI guardrails hook event - #543

Closed
Altruistus wants to merge 1 commit into
mainfrom
CM-72541-pov-tempo-cursor-ai-guardrails-not-reporting-correct-model
Closed

Altruistus wants to merge 1 commit into
mainfrom
CM-72541-pov-tempo-cursor-ai-guardrails-not-reporting-correct-model

Conversation

@Altruistus

@Altruistus Altruistus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

TL;DR

A user opens a chat on one model, switches to another mid-conversation, and the platform keeps attributing every later prompt, file read and MCP call to the model they started on. Hook events now carry the model they ran under, so the platform can attribute each event to the model that actually served it.

Why

The model reached the backend in exactly one place: create_conversation, called by the session-start hook. create_event never carried one, so the model of the conversation's first turn stood in for every event in it.

No IDE starts a new conversation when the user picks a different model. Cursor keeps the same conversation_id when the composer's model changes and fires no sessionStart, so nothing ever corrected the record. Every hook payload already carries the model configured at that moment - Cursor.parse_hook_payload has been reading it into AIHookPayload.model all along - so the CLI had the right answer in hand on every hook and dropped it on the floor.

Reviewer notes

  • One field on the event body. Attribution moves from the conversation to the event, which is the level the switch actually happens at; no other CLI behaviour changes.
  • model is sent even when it is None (a Claude Code transcript with no assistant turn yet, for one), consistent with the other optional fields on this body.
  • The conversation record is untouched. It keeps reporting the model the session opened with; the backend is what joins events to models from here.

Reproduced against the ticket's flow in Cursor - a conversation opened on grok-4.6 and switched to gpt-5.6-sol.

CM-72541

🤖 Generated with Claude Code

@Altruistus
Altruistus force-pushed the CM-72541-pov-tempo-cursor-ai-guardrails-not-reporting-correct-model branch from bb15f38 to 4d72391 Compare September 14, 2026 10:02
The model reached the platform only through the conversation created at session
start, and switching models starts no new conversation, so every event after a
switch was attributed to the model the conversation opened with.

Hook payloads already carry the model configured at the time of the event; send
it with the event so the platform can attribute each one to the model that
actually ran.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Altruistus
Altruistus force-pushed the CM-72541-pov-tempo-cursor-ai-guardrails-not-reporting-correct-model branch from 4d72391 to 83e9e9c Compare September 14, 2026 10:06
@Altruistus Altruistus changed the title CM-72541: Re-report the conversation model when the IDE switches models CM-72541: Report the model on every AI guardrails hook event Sep 14, 2026
@Altruistus
Altruistus requested a review from Ilanlido September 14, 2026 10:20
@Altruistus Altruistus closed this Sep 14, 2026
@Altruistus
Altruistus deleted the CM-72541-pov-tempo-cursor-ai-guardrails-not-reporting-correct-model branch September 14, 2026 10:39
@cycodehq cycodehq deleted a comment from Altruistus Sep 14, 2026
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