Skip to content

Conversation

@kojiromike
Copy link
Contributor

  • docs(agents): update agents instructions
  • fixup! docs(agents): update agents instructions
  • docs: add OpenEMR vendor directory research guidance
  • feat: add Sinch provisioning CLI and infrastructure
  • docs: add Sinch provisioning CLI quick start
  • feat: enhance ConversationApiClient with new methods and retry logic
  • refactor: inject LoggerInterface into controllers via DI
  • refactor: replace error_log with SystemLogger in public entry points
  • feat: improve template sync and API test UI

kojiromike and others added 11 commits December 18, 2025 12:12
Add critical section explaining where to find OpenEMR source code and
dependency requirements for AI agents:

- Check vendor/openemr/openemr/composer.json for exact versions
- Look in vendor/openemr/openemr/src/ for OpenEMR core classes
- Use ^6.4 constraints for Symfony to match OpenEMR's 6.4.x versions
- Never use version ranges like ^6.0 || ^7.0 that include Symfony 7.x

This prevents AI agents from suggesting incompatible dependency versions
and directs them to the authoritative source for OpenEMR's requirements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add command-line tools for Sinch API management and provisioning:

New CLI Commands (src/Module/Command/):
- sinch:inspect - Inspect Sinch app configuration
- sinch:app:list - List all Sinch apps
- sinch:webhook:create - Create webhooks
- sinch:webhook:list - List webhooks

New Infrastructure:
- cli.php - Standalone CLI entry point with Symfony Console
- AppConfigurationClient - Client for Sinch App Configuration API
- StandaloneConfig - Configuration for CLI context (env vars)
- sinch-infra/ - Inspection utilities and helpers

Use cases:
- Initial setup and configuration inspection
- Multi-tenant/multi-app provisioning
- CI/CD automation for webhook/channel setup
- Avoiding manual Sinch dashboard configuration

All commands support environment variables for credentials:
SINCH_PROJECT_ID, SINCH_APP_ID, SINCH_API_KEY, SINCH_API_SECRET

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add README section documenting the new CLI tool for Sinch configuration:

- Quick start examples with environment variables
- Common CLI commands (inspect, list apps, create webhooks)
- Link to full CLI-PROVISIONING.md documentation (in .local/)
- Use cases: setup, multi-tenant, CI/CD automation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add new methods and reliability improvements to ConversationApiClient:

New Methods:
- getApp() - Fetch Sinch app configuration details
- sendMessageByChannelIdentity() - Send messages using channel identity
  (alternative to contact ID for SMS/WhatsApp)

Reliability Improvements:
- Add executeWithRetry() with exponential backoff for transient failures
- Improved error messages with detailed exception context
- Better OAuth2 token request error handling

Use Cases:
- Display app configuration in settings/testing
- Send SMS via phone number instead of requiring contact creation
- Handle transient API failures gracefully with automatic retry

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Replace direct SystemLogger instantiation with proper dependency injection
of PSR-3 LoggerInterface in all controllers:

Changes to Bootstrap.php:
- Pass logger to InboxController, ConversationController, SettingsController

Changes to Controllers:
- Accept LoggerInterface in constructor instead of instantiating SystemLogger
- Use injected logger throughout methods

Changes to public/settings.php:
- Add proper error logging with detailed exception context
- Support JSON error responses for API test actions
- Improve error message formatting

Benefits:
- Follows SOLID principles and PSR-3 logging standard
- Makes controllers testable with mock loggers
- Decouples from specific logger implementation
- Better error diagnostics with file, line, and trace info

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Replace direct error_log() calls with OpenEMR's SystemLogger for
consistent logging across the module:

Changes to conversation.php and index.php:
- Initialize SystemLogger instance
- Replace error_log() with $logger->error()
- Consistent with module's logging standards

This ensures all errors are properly logged through OpenEMR's logging
infrastructure instead of PHP's default error_log().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Template Sync Service improvements:
- Add duplicate detection before creating templates in Sinch
- Skip templates that already exist (based on description matching)
- Track skipped count in sync results
- Better logging with existing template detection
- Prevents duplicate templates when syncing multiple times

Settings Template improvements:
- Display app configuration details after successful API test
- Show display name, channels, and channel states
- Warn if no channels are configured
- Better formatting with pre-wrap for multi-line output
- Clarify that API config can be in Globals, messaging config only here

Benefits:
- Prevents creating duplicate templates in Sinch dashboard
- Better user feedback about Sinch configuration status
- Helps diagnose channel configuration issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add convenience task to automatically open OpenEMR in default browser:

- Detects HTTPS port automatically from Docker
- Opens https://localhost:[PORT] in browser
- Shows login credentials (admin / pass)
- Works on macOS (open) and Linux (xdg-open)
- Falls back to showing URL if no browser launcher found

Usage:
  task dev:browse

Saves developers from manually finding the port and typing the URL.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Update git:clean task to exclude .local/ directory from removal:

- Use -e .local flag to preserve planning docs and local files
- Update description and prompt to reflect this behavior
- Prevents accidental deletion of important local documentation

The .local/ directory contains:
- Planning documents (moved from root)
- Sinch API documentation cache
- Other local-only files not tracked in git

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
The OpenEMR installer's install_gacl() method instantiates GaclApi,
which requires the $sqlconf global variable to be loaded. However,
write_configuration_file() only writes sqlconf.php to disk without
requiring it into the PHP process.

This caused GACL tables to be created but remain empty, preventing
admin login even with correct credentials (no ACL permissions).

Solution: Pre-populate $sqlconf and required globals before calling
quick_install(), ensuring GACL can connect to the database during
installation.

Also added Taskfile tasks for complete environment cleanup to handle
crypto key mismatches when switching between installations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
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.

2 participants