Skip to content

Remove ChatGPT integration and stop generating social media snippets#39

Merged
etagwerker merged 1 commit into
mainfrom
remove-chatgpt-integration
Jun 8, 2026
Merged

Remove ChatGPT integration and stop generating social media snippets#39
etagwerker merged 1 commit into
mainfrom
remove-chatgpt-integration

Conversation

@etagwerker
Copy link
Copy Markdown
Member

What

Removes the ChatGPT (OpenAI) integration and stops generating social media snippets when a Link is created.

Why

We no longer want to depend on the OpenAI API or auto-generate snippets on Link creation.

Changes

  • Drop the ruby-openai dependency from Gemfile / Gemfile.lock.
  • Remove the after_create :create_chat_gpt_snippets callback and the OpenAI client/prompt code from Link (create_chat_gpt_snippets, fetch_social_media_snippets, gpt_prompt). No more OPEN_AI_ACCESS_TOKEN usage.
  • Update specs that stubbed the now-removed fetch_social_media_snippets (with verify_partial_doubles = true, stubbing a missing method would fail).

Kept intentionally

The SocialMediaSnippet model, its table, the association, and the show-page / JSON-API display of existing snippets are left intact, so previously generated records still render. The goal was to stop generating, not to delete existing data.

Notes

  • app/views/links/show.html.erb still tells users existing snippets "are created by Open AI." That copy is accurate for legacy records and only renders when snippets exist, so it was left as-is. Happy to reword or hide it if preferred.

Testing

  • bundle exec rspec — 54 examples, 0 failures.

🤖 Generated with Claude Code

Drop the ruby-openai dependency and the OpenAI-backed generation pipeline
on Link. Links no longer generate social media snippets on create; the
after_create callback and the OpenAI client/prompt code are removed.

The SocialMediaSnippet model, its table, and the display of any existing
snippets are kept intact, so previously generated records still render.

Specs that stubbed the now-removed fetch_social_media_snippets are
updated (verify_partial_doubles would otherwise fail on the missing
method).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@etagwerker etagwerker requested a review from Copilot June 8, 2026 00:36
@etagwerker etagwerker marked this pull request as ready for review June 8, 2026 00:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request removes the application’s OpenAI/ChatGPT-based snippet generation that previously ran automatically when a Link was created, eliminating the external API dependency while keeping previously generated SocialMediaSnippet records renderable.

Changes:

  • Removed the ruby-openai gem from Bundler dependencies.
  • Deleted the Link after_create callback and all OpenAI client/prompt code used to generate snippets.
  • Updated specs by removing stubs for the now-deleted snippet-fetching method.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/models/link.rb Removes the after_create callback and OpenAI snippet generation methods.
Gemfile Drops the ruby-openai gem declaration.
Gemfile.lock Removes ruby-openai from the resolved gem set and dependencies list.
spec/controllers/shares_controller_spec.rb Removes stubbing and fixture text tied to snippet generation.
spec/models/share_spec.rb Removes stubbing of the deleted Link snippet-fetching method.
spec/requests/api_links_spec.rb Removes stubbing of the deleted Link snippet-fetching method in request specs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@etagwerker etagwerker merged commit 98a81ec into main Jun 8, 2026
2 checks passed
@etagwerker etagwerker deleted the remove-chatgpt-integration branch June 8, 2026 00:37
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