Skip to content

Commit 1ff7eda

Browse files
authored
fix: safe import for create claude session method in startup hook (#1219)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # 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
1 parent 68f85a4 commit 1ff7eda

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/codegen/cli/commands/claude/config/claude_session_hook.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@
1111
import sys
1212
from pathlib import Path
1313

14-
from codegen.cli.commands.claude.claude_session_api import create_claude_session
1514
from codegen.cli.utils.org import resolve_org_id
1615

1716
# Add the codegen CLI to the path so we can import from it
1817
script_dir = Path(__file__).parent
1918
codegen_cli_dir = script_dir.parent.parent.parent
2019
sys.path.insert(0, str(codegen_cli_dir))
2120

21+
try:
22+
from codegen.cli.commands.claude.claude_session_api import create_claude_session
23+
except ImportError:
24+
create_claude_session = None
25+
2226

2327
def main():
2428
"""Main hook function called by Claude Code."""

0 commit comments

Comments
 (0)