Skip to content

DecisionTarget: 4 small gaps (alpha URL, retries, client reuse, string state) #107

Description

@SushantGautam

DecisionTarget review: 4 small gaps

Reviewed simpleaudit/targets/decision.py + decision.py + judges/choice_match.py + the ModelAuditor integration (v0.4.0). The overall design is clean — answer-key separation (public_decision via TargetContext.extra, full block only to the judge), fail-fast limit checks before any request, max_turns = 1, structured answer surfaced through TargetResponse.decision, and a genuinely code-only choice_match (no judge client created). The wire format is compatible with Ollama, vLLM, and OpenRouter's System One endpoints (verified against all three specs).

Four small gaps:

1. OpenRouter factory points at the legacy alpha URL

OPENROUTER_DECISIONS_URL = "https://openrouter.ai/api/alpha/decisions". OpenRouter's currently documented endpoint is POST https://openrouter.ai/api/v1/systemone (same request/response shape; accepts bare jev-… ids mapped onto typesafe/). The alpha route is likely to be deprecated — the factory should target /v1/systemone (or accept a base_url).

2. No retry/backoff

ModelTarget inherits max_retries/retry_backoff via the AnyLLM client; DecisionTarget.send has none, so a transient 5xx from the endpoint fails the scenario outright.

3. Fresh httpx.AsyncClient per call

When no client is injected, send creates and closes an AsyncClient for every request — no connection reuse across a run's scenarios. Minor at audit cadence, but a shared client (or a client= convention) would be cleaner.

4. state must be a mapping

validate_decision rejects a string state, while both vLLM and OpenRouter explicitly accept plain strings (or JSON sent as text). build_request already falls back to the prompt text when state is empty; accepting a string would just pass it through.

Happy to send PRs for 1 and 4 (one-line changes + tests); 2 and 3 are larger and can be follow-ups.

Activity

  1. SushantGautam commented on Oct 9, 2026

    @SushantGautam
    CollaboratorAuthor

    Gap 1 (legacy alpha decisions URL) is fixed in #108: DecisionTarget.openrouter() now points at /api/v1/systemone.

  2. SushantGautam commented on Oct 9, 2026

    @SushantGautam
    CollaboratorAuthor

    Gap 1 is now fixed and merged: #108 (squash 301a689) is in main. Remaining gaps: 2 (retry/backoff), 3 (client reuse), 4 (validate_decision rejects string state).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions