Repository navigation
Remove ChatGPT integration and stop generating social media snippets - #39
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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-openaigem from Bundler dependencies. - Deleted the
Linkafter_createcallback 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.
This was referenced Nov 9, 2026
etagwerker
added a commit
that referenced
this pull request
Nov 9, 2026
The Social Media Snippets section told readers the snippets are created by Open AI. That stopped being true when #39 removed the ChatGPT step, and snippets can now be stored over the JSON API, so it's wrong for new ones too. The copy no longer says where a snippet came from, and points to the shortened links in the Shares section above it. Adds a view spec for the section: snippets are listed under their social media type, the Open AI claim is gone, and the section is left out when a link has no snippets. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
etagwerker
added a commit
that referenced
this pull request
Nov 9, 2026
* Add a JSON API to list and create social media snippets Since #39 removed the ChatGPT step, nothing writes new social media snippets and there is no API for them. This adds the same Bearer-token JSON API shares already have: GET /links/:link_id/social_media_snippets.json (optional ?social_media_type= filter) POST /links/:link_id/social_media_snippets.json A snippet takes social_media_type (Bluesky, GoogleBusiness, LinkedIn, Mastodon, Twitter), content, and an optional share_id that ties the copy to the tracked short URL it was posted with. share_id is a new nullable reference on social_media_snippets; deleting a share nullifies it. Creating a snippet is rejected with a 422 when the type is missing or unknown, when the same content already exists for that link and type, or when share_id points at a share that doesn't exist or belongs to another link. The type, duplicate, and presence checks run on create only, so snippets saved before this change stay editable. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Fix the link page copy that says snippets are created by Open AI The Social Media Snippets section told readers the snippets are created by Open AI. That stopped being true when #39 removed the ChatGPT step, and snippets can now be stored over the JSON API, so it's wrong for new ones too. The copy no longer says where a snippet came from, and points to the shortened links in the Shares section above it. Adds a view spec for the section: snippets are listed under their social media type, the Open AI claim is gone, and the section is left out when a link has no snippets. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Drop share_id from the snippets API social_media_snippets already has the columns the API needs (social_media_type, content, link_id), so this PR shouldn't change the table. Removes the share_id migration and schema change, the share association and its validations, the share_id param and JSON key, and the specs that covered them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the ChatGPT (OpenAI) integration and stops generating social media snippets when a
Linkis created.Why
We no longer want to depend on the OpenAI API or auto-generate snippets on
Linkcreation.Changes
ruby-openaidependency fromGemfile/Gemfile.lock.after_create :create_chat_gpt_snippetscallback and the OpenAI client/prompt code fromLink(create_chat_gpt_snippets,fetch_social_media_snippets,gpt_prompt). No moreOPEN_AI_ACCESS_TOKENusage.fetch_social_media_snippets(withverify_partial_doubles = true, stubbing a missing method would fail).Kept intentionally
The
SocialMediaSnippetmodel, 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.erbstill 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