Skip to content

Conversation

@rushilpatel0
Copy link
Contributor

Motivation

Content

Testing

Please check the following before marking your PR as ready for review

  • I have added tests for my changes
  • I have updated the documentation or added new documentation as needed

@rushilpatel0 rushilpatel0 requested review from a team and codegen-team as code owners August 19, 2025 18:38
@rushilpatel0 rushilpatel0 merged commit e422651 into develop Aug 19, 2025
2 of 4 checks passed
@rushilpatel0 rushilpatel0 deleted the rpatel/safe-import branch August 19, 2025 18:39

from codegen.cli.utils.org import resolve_org_id

# Add the codegen CLI to the path so we can import from it
Copy link
Contributor

Choose a reason for hiding this comment

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

Logic error: resolve_org_id can be undefined if import fails

If the import inside the try block raises ImportError, only create_claude_session is set to None. resolve_org_id remains undefined and later usage (if org_id is None and resolve_org_id:) will raise a NameError, causing the hook to fail at runtime.

Suggested change
# Add the codegen CLI to the path so we can import from it
try:
from codegen.cli.commands.claude.claude_session_api import create_claude_session
from codegen.cli.utils.org import resolve_org_id
except ImportError:
create_claude_session = None
resolve_org_id = None

@codegen-sh
Copy link
Contributor

codegen-sh bot commented Aug 19, 2025

Found 0 critical and 1 important issues. Please review my inline comments above.

🔍 View my analysis

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.

3 participants