Skip to content

switchyard_route: avoid Strong/Weak thrashing when Switchyard dies mid-session #19

Description

@yehuditkerido

Context

Parent: #2 · POC: #16

The POC in #16 classifies per request (Context::default() each time). If the judge fails mid-chat, on_failure: open continues without a sticky tier and may leave the request unrouted. That can flap Weak ↔ Strong across turns, or change behavior quietly when the judge is flaky.

Epic #2 already calls out thinking through classifier reachability and avoiding turn-by-turn thrashing.

Goal

Define and demonstrate a mid-session failure policy that does not thrash tiers.

Proposed work

  • Document current behavior (judge timeout / 5xx / unreachable mid-chat).
  • Add a demo scenario (and/or tests) that kills or breaks the judge mid-conversation and shows resulting tiers.
  • Implement a sticky policy, e.g.:
    • keep last successful tier for the session key when the judge fails, or
    • fail-closed / reject instead of re-deciding, or
    • another explicit operator-chosen fallback (must be documented).
  • Make the chosen policy observable via filter metadata/logs.

Out of scope (unless we decide otherwise)

Acceptance criteria

  • Written behavior for “Switchyard unreachable mid-session” under on_failure: open and closed.
  • Demo or automated test proves we do not thrash Weak ↔ Strong across turns when the judge dies after a successful Strong (or Weak) decision.
  • Metadata/logs make the sticky/fallback path obvious.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions