Skip to content

spec: deserialize error-only search responses, add TimelineTrend.grouped_trends - #120

Merged
fa0311 merged 2 commits into
mainfrom
fix/error-only-responses
Oct 16, 2026
Merged

fa0311 merged 2 commits into
mainfrom
fix/error-only-responses

Conversation

@fa0311

@fa0311 fa0311 commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Stacked on #119 (the diff shows both until #119 is merged).

Error-only responses. When a search query fails X answers {"data": {"search_by_raw_query": {"search_timeline": {}}}, "errors": [...]} (seen for filter:quote min_faves:2000, a query X cannot parse, and for an Internal: Unspecified error on a community search). SearchTimeline.timeline was required, so the whole response failed to deserialize with a validation error instead of surfacing X's message. It is optional now, following the existing convention for fields X drops on errors (data.user? on user timelines), and the wrapper helpers raise X's message through error_check (python #TBD / typescript #TBD apply the double error_check on the search helper). The error entries of those responses carry no code (extensions neither), so both are optional; message, kind, name, source, locations, path stay required.

Drift. TimelineTrend.grouped_trends: [{name, url}] (related trends under a trend on ExplorePage) appeared in tonight's strict run; url is the same URT landing url object as trend_url (SocialContextLandingUrl).

Verified: 267 stored responses deserialize at match rate 1.0, including the two error-only search responses; strict live test with the nightly settings, 93 calls, every match rate exactly 1.0.

🤖 Generated with Claude Code

fa0311 and others added 2 commits October 16, 2026 10:11
The three item types were marked never observed in #118 but the stored
responses do carry them: relevance prompts in SearchTimeline (8), subscription
and Community Notes prompts on UserSuperFollowTweets / GenericTimelineById (11)
and community cards on CommunityDiscoveryTimeline (81). Community gains the
is_nsfw flag those cards carry.

Verified: 180 stored responses and the strict live test (93 calls) at match
rate exactly 1.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ped_trends

When a search query fails (bad filter syntax, internal error) X answers
search_timeline: {} plus errors whose entries carry no code, so
SearchTimeline.timeline and ErrorResponse.code / extensions.code are optional
now and the wrappers raise X's message through error_check instead of a
validation error. ExplorePage trends gained grouped_trends (related trends).

Verified: 267 stored responses (two of them error-only) and the strict live
test (93 calls) at match rate exactly 1.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@fa0311
fa0311 merged commit ec7d907 into main Oct 16, 2026
1 check passed
@fa0311
fa0311 deleted the fix/error-only-responses branch October 16, 2026 11:55
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.

1 participant