← Back to Pull requests

[17.0][ADD] social_media_x #1891

Closed
unknown closed this pull request without merging on Oct 26, 2026 08:49 UTC
View on GitHub
unknown unknown commented on Jul 28, 2026 19:15 UTC
Author

@BinhexTeam

T25184

Integration of the X social media.

What it adds

  • Account integration through the X OAuth 1.0a flow, with the credentials stored on social.account.

  • Publishing on X from the standard post form, with images or a video, plus deleting a publication and checking whether it is still online.

  • Statistics on the card of the account: the publications of the last 30 days are refreshed once a day and on Update, and the card adds up the counters its publications hold. Social Media X Sync widens what is known (the publications Odoo did not send, and the older history), but the card is not empty without it.

  • Reposts and quotes, the two figures only X reports, shown in the Statistics dialog of a publication and counted towards its Interactions and Engagement.

  • X Premium read from X when the account is associated and on Update account. It sets the message limit of the account.

  • Credit balance of the developer App, read once per API Key every 2 hours and when the account is associated, updated or its statistics refreshed. The responsible is warned once each time it drops under the Credit Warning of the account.

  • Limits checked while the post is written: 280 characters without X Premium and 25 000 with it, 4 images of at most 5 MB each (15 MB for a GIF) in JPG, PNG, WEBP or GIF, or one video of at most 512 MB in MP4. X takes images or a video, never both, so a post mixing them is refused instead of warned about. The same rules refuse the publication if the post reaches it through an import or an RPC call.
  • Design notes

  • *An X account never draws a time series in Social Media > Statistics. That screen reads a history per day, and the metrics the API v2 answers are the current lifetime counters of each post, with no way of asking for them grouped by day. Repeating the lifetime counter per day draws a cumulative curve of a different shape than the other networks on the same graph, and storing the delta between two readings is false for any day the scheduled action did not run. Neither is a measurement, so nothing is written and the figures live on the card of the account.

  • A post X refuses is not a credentials problem. A 401 flags the account to be authorized again. A 400 or 403 on publishing leaves the account as it is and fails the publication with the reason: an App without a paid plan, or an account whose X Premium was cancelled after the plan was last read (Update account reads it again).
  • Note on the X API

    There is no Free access tier any more. The developer App has to be connected to a Pay Per Use project with credit in the Developer Console. An App left on the Default project, on Standard Basic, cannot spend against the API and is refused, so reviewing or testing this module end to end needs an App with credits. This is a platform restriction, not a limitation of the module. The Configuration* section of the readme walks through it.

    References:

  • Pricing: https://docs.x.com/x-api/getting-started/pricing

  • Rate limits: https://docs.x.com/x-api/fundamentals/rate-limits

  • Access levels and limits: https://docs.x.com/x-api/introduction

  • Current plans: https://developer.x.com/en/portal/products
  • <img width="2243" height="788" alt="image" src="https://github.com/user-attachments/assets/07e227ba-993f-486a-b5c0-4b8f0e3246cb" />

    Diff: 436 lines (+327 / -109) across 5 files Reviewer: edescalona Review duration: 128973m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 436 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.364
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1891"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.2% (MEDIUM) · Higher = larger blast radius
    45.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.9% · Safe to merge
    17.9%
    Repository