-
Notifications
You must be signed in to change notification settings - Fork 0
Fix duplicate consciousness bootstrap and import organization #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -438,9 +438,20 @@ async def initialize_core_services(): | |||||
| # Bootstrap consciousness after initialization | ||||||
| if hasattr(cognitive_manager, 'consciousness_engine') and cognitive_manager.consciousness_engine: | ||||||
| try: | ||||||
| logger.info("🌅 Bootstrapping consciousness in cognitive manager...") | ||||||
| await cognitive_manager.consciousness_engine.bootstrap_consciousness() | ||||||
| logger.info("✅ Consciousness engine bootstrapped successfully") | ||||||
| ce = cognitive_manager.consciousness_engine | ||||||
| # Check if bootstrap already completed to avoid duplicate calls | ||||||
| bootstrap_done = False | ||||||
| if (hasattr(ce, 'current_state') and | ||||||
| hasattr(ce.current_state, 'phenomenal_experience') and | ||||||
| ce.current_state.phenomenal_experience): | ||||||
| bootstrap_done = ce.current_state.phenomenal_experience.get('bootstrap_complete', False) | ||||||
|
|
||||||
| if not bootstrap_done: | ||||||
| logger.info("🌅 Bootstrapping consciousness in cognitive manager...") | ||||||
| await ce.bootstrap_consciousness() | ||||||
| logger.info("✅ Consciousness engine bootstrapped successfully") | ||||||
| else: | ||||||
| logger.info("🟡 Consciousness engine bootstrap already completed; skipping duplicate call.") | ||||||
|
||||||
| logger.info("🟡 Consciousness engine bootstrap already completed; skipping duplicate call.") | |
| logger.info("🟡 Consciousness engine bootstrap already completed, skipping duplicate call.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nested hasattr checks could fail if
phenomenal_experienceis not a dictionary. Consider adding a type check or restructuring the guard to be more defensive. For example,if (hasattr(ce, 'current_state') and hasattr(ce.current_state, 'phenomenal_experience') and isinstance(ce.current_state.phenomenal_experience, dict))would prevent potential AttributeError ifphenomenal_experienceis None or another non-dict type.