xai-org/x-algorithm · warning · anyhow::Error
Strato error code {}: {}
Error message
Strato error code {}: {} What it means
Raised in VF get_result when the decoded Strato result for an individual tweet is StratoResult::Err — the visibility-filtering Strato backend returned a per-item error (code + message) inside an otherwise successful batch response. The result map stores this as Err for that tweet_id while other tweets may be Ok.
Source
Thrown at visibility-filtering-client/vf_client.rs:183
.map(|tweet_id| {
let args = vec![encode(&(*tweet_id, view.clone()))];
(
"visibility/service/homeMixerFilteredReason.Tweet".to_string(),
"fetch".to_string(),
args,
)
})
.collect::<Vec<(String, String, Vec<Vec<u8>>)>>();
let result_batch = client.batch_call(calls, context.as_ref()).await;
let mut result_map: HashMap<u64, Result<Option<FilteredReason>>> = HashMap::new();
for (tweet_id, bytes_result) in tweet_ids.iter().zip(result_batch) {
let item_result = match bytes_result {
Ok(bytes) => {
let decoded: StratoResult<StratoValue<FilteredReason>> = decode(&bytes);
match decoded {
StratoResult::Ok(strato_value) => Ok(strato_value.v),
StratoResult::Err(err) => {
Err(anyhow!("Strato error code {}: {}", err.code, err.message))
}
}
}
Err(err) => Err(err),
};
result_map.insert(*tweet_id, item_result);
}
result_map
}
}
const XAI_VF_DEFAULT_TIMEOUT_MS: u64 = 400;
const XAI_VF_MAX_BATCH_SIZE: usize = 50;
const XAI_VF_APERTURE_SIZE: usize = 16;
const VF_FILTER_TWEETS_DISCOVERY_ENV: &str = "VF_FILTER_TWEETS_DISCOVERY";
pub struct XaiVfClient {
client: FilterTweetsServiceClient,View on GitHub (pinned to 24c60942c5)
Solutions
- Inspect err.code/err.message: codes like throttle/transient warrant retrying just the failed tweet IDs
- Retry only the Err entries from the result_map rather than the whole batch
- If a specific code recurs, check VF service logs for that code's meaning; may indicate data-level issues
- Degrade gracefully: treat per-item Err as 'unknown' (e.g. allow or conservatively filter the tweet) per product policy
Example fix
// before
let results = vf_client.get_result(...).await;
// after
let results = vf_client.get_result(...).await;
let failed: Vec<u64> = results.iter().filter(|(_, r)| r.is_err()).map(|(id, _)| *id).collect();
let results = if !failed.is_empty() {
let mut merged = results;
for (id, r) in vf_client.get_result_for_ids(&failed).await { merged.insert(id, r); }
merged
} else { results }; Defensive patterns
Strategy: retry
Validate before calling
null
Try / catch
let failed: Vec<u64> = map.iter().filter(|(_, r)| r.is_err()).map(|(k, _)| *k).collect(); retry only failed ids once; then degrade per policy.
Prevention
- Handle per-item Err entries explicitly instead of failing the whole batch
- Track per-code metrics for Strato item errors
- Define product policy for 'unknown' filter state
When it happens
Trigger: Calling filter-style VF batch lookups where one or more tweet IDs produce backend item errors: internal VF Strato errors, invalid/unsupported reason codes, or per-item processing failures.
Common situations: VF backend partial failures during batch filtering; specific corrupt or unsupported tweet records; VF Strato rolling out a new error code that the client surfaces verbatim.
Related errors
- Not implemented: to_thrift for KeywordMatch
- Not implemented: to_thrift for SafetyResult
- Not implemented: to_thrift for Action
- Not implemented: to_thrift for DropReason
- Not implemented: to_thrift for FilteredReason
AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28).
Data as JSON: /api/errors/68a3aa4188338952.
Report an issue: GitHub.