Story 2451: AI-Assisted Description for Link Posts type#2477
Open
javiercoronadonarvaez wants to merge 110 commits into
Open
Story 2451: AI-Assisted Description for Link Posts type#2477javiercoronadonarvaez wants to merge 110 commits into
javiercoronadonarvaez wants to merge 110 commits into
Conversation
f72233e to
e57a705
Compare
eda4415 to
ebd76ef
Compare
- Add description box alongside 'Saving' + Saving Icon section
- Does not display anything if the user hasn't started typing - Display Saving text + Icon while user types and display Saved text + Icon once he's finished typing
- Corroborate auto generate description works with wysiwyg component
- Fix in accordance to GitHub Actions failure
…ated - Add 'Hold on! We are generating a description for your content, it may take a few seconds' as placeholder in description box
…ter post has been created
…ry.summary - Persist user-typed summary - Skip background regeneration when set
…task keeps retries
- Auto-Generate button disabled unless a properly composed URL is input
…ter post has been created
…ry.summary - Persist user-typed summary - Skip background regeneration when set
…task keeps retries
- Truncation to comply with 1000 character limit from Design templates - Optimize prompt
- Update pre commit config file to match black's version in requirements (26.1.0)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…y task to avoid Gateway time out error
…ent to rich text input
5809a96 to
c1728bf
Compare
herzog0
approved these changes
Jun 23, 2026
herzog0
left a comment
Collaborator
There was a problem hiding this comment.
Looking and working pretty good!! Thanks a ton @javiercoronadonarvaez
3567de4 to
8143846
Compare
…1-ai-assisted-description-link-post
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.
Issue: #2451
Summary & Context
Adds an Auto-Generate Description flow to the Link post type for any public web URL: the backend fetches the page, extracts the main article text (title + body) with trafilatura, and runs it through the same summarizer used by Blog/News so the user gets an editable draft instead of a blank Description field.
localhost:8000/news/add(select Link as the post type)Changes
POST /v3/news/generate-link-description/that accepts any public http(s) URL, fetches the page (10s timeout) through an SSRF-guarded helper, extracts title + body, and returns a summarized description as JSON. Three distinct failure modes (invalid/non-public URL → 400, fetch/extraction failure → 502, summarization failure → 502) map to separate inline messages.extract_articleinnews/helpers.py: trafilatura isolates the main article and strips boilerplate (navigation, footers, comments, ads), keeping the summarizer focused and cheaper than feeding it the whole page. Falls back to a naive visible-text dump (extract_content) when trafilatura can't parse a page, and returns("", "")only when even the fallback is empty. (Replaces the previous cppalliance.org-onlyextract_cppalliance_postCSS selectors.)safe_getinnews/helpers.py, used by both the endpoint and the backgroundset_summary_for_link_entrytask: rejects non-http(s) schemes and hosts resolving to loopback/private/link-local/reserved IPs (e.g.127.0.0.1,10.x,169.254.169.254), and follows redirects manually so each hop's host is re-validated.set_summary_for_link_entrytask now uses trafilatura extraction + the SSRF guard, and skips gracefully (logs and returns) when no readable text can be extracted.descriptionfield is persisted toLink.summaryon submit (same path Blog/News already use), so the generated text is available immediately on the post page without waiting for thesummary_dispatchertask.safe_get, which blocks loopback/private/link-local/reserved targets (including the cloud-metadata address169.254.169.254) and re-validates each redirect hop. Known residual gap: DNS rebinding (a host that resolves to a public IP at check time and a private one at connect time) is not closed — documented insafe_get; fully closing it would require pinning the validated IP into the actual connection.generate_descriptionendpoint — flagged in aNOTE:innews/views.py). Both should get@login_required+ throttling before this is exposed externally — more important now that the fetch target is fully user-controlled.developincludes that PR's work; review against the parent branch (javiercoronarv/2428-ai-assisted-desc-blog-news) for a clean view of the changes unique to this PR.Screenshots
Persistence and Functionality
Functionality.Persistence.mov
Dimensionality and Dark/Light Modes
Dimensionality.DarkLightMode.mov
Self-review Checklist
Frontend
Summary by CodeRabbit
New Features
Improvements
Chores