Skip to content

Classify borderline channel messages with ClassifySalience #8152

Open

Description

@senamakel

Parent: #8147

Summary

Wire the ClassifySalience host callback (cheap-model triage) for channel traffic, so borderline channel messages are classified noise / fyi / actionable / urgent rather than all becoming turns.

Problem

#8136 implements ClassifySalience with run_triage, but the module only calls it for items whose rule-based score falls in the borderline range, and Composio triggers and webhooks almost never land there. Once channels go through the queues (hosted and native channel issues), channel messages will be the main borderline traffic, and the callback needs tuning for them.

Solution

  • Tune the salience thresholds and features (addressed?, DM?, known contact, source weight) in pipeline.json for channel sources.
  • Give the callback a per-tick model budget; past the budget, fall back to the rule score.
  • Record the classification in the delivered envelope so the turn can see why it was woken.

Acceptance criteria

  • Borderline channel messages are classified — a test with a fake classifier shows noise is not delivered as a turn and urgent is promoted.
  • Budgeted — beyond the budget no classifier calls are made and the rule score decides.
  • Observable — classification outcomes are counted in inbound.stats.
  • Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by .github/workflows/ci-fast.yml).

Related

Part of #8147. Builds on #8136 (inbound domain, tinyeventqueues v0.1.2) and tinyhumansai/tinyeventqueues#6. Depends on #8148 and #8149.

Audit findings (2026-10-20)

  • When the module asks: ClassifySalience is consulted once per flushed batch, for its top-scoring event only (pipeline/pass.rs:174), when the rule score falls in the half-open band [30, 45) (pass.rs:504). It is budgeted at 120 calls/hour by token bucket (gate/mod.rs:74-80, salience.borderline in pipeline.json). A host error falls back to the rule score.
  • Host side: inbound/deliver.rs:54-57 caches classifications (256 entries, 10 min TTL) and wraps run_triage via RemoteTriage (triage/runner.rs:60-66).
  • What [inbound-queues] salience: let an Urgent verdict skip a cadence; ship channel and notification policies senamakel/tinyeventqueues#4 adds: an Urgent verdict that skips a cadence, and the class on Turn. This leaf tunes thresholds and features for channel sources and uses the class in the turn.

Agent brief

Depends on: senamakel/tinyeventqueues#4, #8148, #8149 · Blocks: none · Parallel with: #8153, senamakel#515

Research first

  • Real score distributions. Run a captured channel sample through the module's salience stage (Drain with a fake clock) to place the band before changing thresholds.
  • Whether triage's prompt (crates/openhuman-core/src/agent/prompts/) suits one chat message rather than a trigger payload.

Files to consider

  • Read: crates/openhuman-core/src/inbound/deliver.rs:54-123,250-330, triage/runner.rs, the module's pipeline.json salience block
  • Change: the host's pipeline.json override (via [inbound] pipeline_path or the shipped defaults upstream), inbound/deliver/ classification handler
  • Tests: inbound/deliver_tests.rs, triage/*_tests.rs

Workflow: implementing-an-epic step.

Subagents: tdd-implementer (Sonnet), then code-reviewer.

Gates: cargo check --manifest-path Cargo.toml · pnpm rust:clippy · cargo test -p openhuman inbound triage

Activity

  1. added
    subtask
    feature
    rust-core
    channels
    on Oct 20, 2026
  2. M3gA-Mind commented on Nov 16, 2026

    @M3gA-Mind
    Collaborator

    Re-checked on current main: not started. ClassifySalience is still the generic callback, and the pipeline config gives channel:* sources zero weight. It needs #8148 and #8149 first, since channel messages don't reach the queues yet. Keeping it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    channelsfeaturerust-coresubtask

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions