unicity-aos/aos-ce · warning

hook-adapter-oracle: incomplete context fan-out on

Error message

hook-adapter-oracle: incomplete context fan-out on {reply_topic}; dropping all partial context

What it means

collect_additional_context fans out a context request on a reply topic and collects responses until a deadline. If the poll reports dropped != 0 or lagged != 0, the fan-out was incomplete — some context replies were lost — so the adapter drops ALL partial context (returns Ok(None)) rather than act on incomplete data. The warning documents why the context is being discarded.

Solutions

  1. Increase the reply-topic subscription buffer capacity so fan-out bursts fit.
  2. Raise the collect deadline (HOST_HOOK_COLLECT_DEADLINE_MS) or quiescence window to give slow replies time to arrive.
  3. Retry the context request once on a fresh reply topic when drops are detected.
  4. Reduce concurrent hook fan-out (batch or serialize context requests) to keep reply volume within buffer limits.

Example fix

// before: tight deadline causes drops under load
let remaining = HOOK_QUIESCENCE_MS.min(HOST_HOOK_COLLECT_DEADLINE_MS - elapsed_ms);
// after: larger deadline and one retry on incomplete fan-out
let remaining = HOOK_QUIESCENCE_MS.min(HOST_HOOK_COLLECT_DEADLINE_MS_MAX - elapsed_ms);
match collect(replies, remaining) {
    Err(IncompleteFanOut) => collect(replies, remaining * 2),
    other => other,
}
Defensive patterns

Strategy: fallback

Validate before calling

// treat dropped/lagged polls as incomplete and plan a retry
if poll.dropped != 0 || poll.lagged != 0 { request_context_again_with_fresh_topic(); }

Prevention

When it happens

Trigger: dispatch_oracle_hook -> collect_additional_context receives a subscription poll where poll.dropped or poll.lagged is non-zero, meaning the reply-topic buffer overflowed or the subscriber lagged behind during the quiescence/deadline window.

Common situations: Many hooks replying concurrently to the same reply topic faster than the adapter drains them; HOOK_QUIESCENCE_MS/deadline window too short for the reply volume; host under heavy load starving the subscriber.

Related errors


AI-assisted analysis of unicity-aos/aos-ce@f6f22024fb (2026-09-13). Data as JSON: /api/errors/fd4310193a15cb19. Report an issue: GitHub.

Appendix: source

Thrown at capsules/capsule-hook-adapter-oracle/src/lib.rs:271

    let mut contexts = Vec::new();
    let mut context_bytes = 0;
    let start = time::monotonic();
    loop {
        let elapsed_ms = u64::try_from((time::monotonic().saturating_sub(start)).as_millis())
            .unwrap_or(HOST_HOOK_COLLECT_DEADLINE_MS);
        if elapsed_ms >= HOST_HOOK_COLLECT_DEADLINE_MS {
            break;
        }
        let remaining = if contexts.is_empty() {
            HOST_HOOK_COLLECT_DEADLINE_MS - elapsed_ms
        } else {
            HOOK_QUIESCENCE_MS.min(HOST_HOOK_COLLECT_DEADLINE_MS - elapsed_ms)
        };
        match subscription.recv(remaining) {
            Ok(poll) if poll.messages.is_empty() => break,
            Ok(poll) => {
                if poll.dropped != 0 || poll.lagged != 0 {
                    log::warn(format!(
                        "hook-adapter-oracle: incomplete context fan-out on {reply_topic}; dropping all partial context"
                    ));
                    return Ok(None);
                }
                for message in poll.messages {
                    if message.topic != reply_topic
                        || message.principal.verified() != Some(principal)
                    {
                        log::warn(format!(
                            "hook-adapter-oracle: dropping mismatched context reply on {reply_topic}"
                        ));
                        continue;
                    }
                    match serde_json::from_str::<serde_json::Value>(&message.payload) {
                        Ok(value) => {
                            if let Some(context) = value
                                .get("additional_context")
                                .and_then(serde_json::Value::as_str)

View on GitHub (pinned to f6f22024fb)