Per the same pattern as Opencode::Instrumentation in opencode-ruby:
zero-dependency default (no-op), host plugs an adapter in to route
errors to Rails.error / Honeybadger / Sentry / etc.
Used by Session, Turn, MessageArtifacts (ported in the next commit) to
report swallowed exceptions and degraded paths without coupling the
gem to any specific error-tracking library.
# config/initializers/opencode.rb
Opencode::ErrorReporter.adapter = ->(error, **opts) {
Rails.error.report(error, **opts)
}
- opencode-rails.gemspec (Ruby >= 3.2, MIT)
- runtime: opencode-ruby ~> 0.0.1.alpha1
- runtime: activerecord/activestorage/activesupport >= 7.1, < 9.0
Per-sublibrary deps (not the rails umbrella) so host apps don't
pull in ActionMailer/ActionCable/ActionView just to use this gem.
- lib/opencode-rails.rb (umbrella; requires opencode-ruby then leaves
then session/turn)
- lib/opencode/rails/version.rb (Opencode::Rails::VERSION = 0.0.1.alpha1)
- Gemfile (sibling-path pull of opencode-ruby for local dev)
- Rakefile, .gitignore
Source files will be ported in the next commit.