Open
Conversation
Collaborator
RoniCycode
commented
Apr 9, 2026
- Change "ensure-auth" to "session-start" which includes conversation creation and MCP usage checks (once per session)
Ilanlido
reviewed
Apr 9, 2026
| def _build_session_payload(payload: dict, ide: str) -> AIHookPayload: | ||
| """Build an AIHookPayload from a session-start stdin payload.""" | ||
| if ide == AIIDEType.CLAUDE_CODE: | ||
| ide_version, model, _ = _extract_from_claude_transcript(payload.get('transcript_path')) |
Collaborator
There was a problem hiding this comment.
we should probably get rid of _extract_from_claude_transcript now, i created it because other hooks didn't provide the model, as far as i know session start provides the model in stdin
Regarding ide_version, do we have it in stdin / claude.json file?
| ide_user_email = get_user_email(claude_config) if claude_config else None | ||
|
|
||
| return AIHookPayload( | ||
| event_name='session_start', |
Collaborator
There was a problem hiding this comment.
no need - its not used later when creating conversation
| except Exception as e: | ||
| logger.debug('Failed to create conversation during session start', exc_info=e) | ||
|
|
||
| # Step 5: Report data flow (MCP servers, Claude Code only) |
Collaborator
There was a problem hiding this comment.
we should handle cursor too, also extract to func
|
|
||
| _CONVERSATIONS_PATH = 'v4/ai-security/interactions/conversations' | ||
| _EVENTS_PATH = 'v4/ai-security/interactions/events' | ||
| _DATA_FLOW_PATH = 'v4/ai-security/interactions/data-flow' |
Collaborator
There was a problem hiding this comment.
i dont know if i like that route name
Comment on lines
+71
to
+75
| # Step 2: Read stdin payload (backward compat: old hooks pipe no stdin) | ||
| if sys.stdin.isatty(): | ||
| logger.debug('No stdin payload (TTY), skipping session initialization') | ||
| return | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.