Skip to content

Fail pinned model calls that return a refusal-of-service notice - #84

Merged
wilke merged 1 commit into
chian:mainfrom
wilke:fix/shared-transport-provider-notice
Oct 9, 2026
Merged

wilke merged 1 commit into
chian:mainfrom
wilke:fix/shared-transport-provider-notice

Conversation

@wilke

@wilke wilke commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #79.

Problem

With the user's Argo monthly quota exhausted (2026-10-09), a /build on a session still pinned to Argo produced a run of refiner calls that each "succeeded" in about 1 s: launch → physical_attempt_succeeded. Each reply was Argo's notice:

⚠️ IMPORTANT USAGE NOTICE FROM ARGO … 🚫 ACCESS REVOKED … Your Argo usage limit has been exceeded. Reason: Monthly limit exceeded. Please contact your Directorate Operations Officer …

That text was returned with HTTP 200 as the assistant message and fed into the refiner's working context. #79 only detected such notices inside the chat coding adapter.

Change

  • New agent/provider_notices.py: provider_notice(text) recognizes a refusal when a short reply (≤ 4000 characters) contains at least two distinct markers:

    • "notice from Argo";
    • "access revoked";
    • "usage limit (has been) exceeded";
    • "monthly limit exceeded";
    • "quota exceeded";
    • "contact your Directorate Operations Officer".

    A genuine answer that merely mentions a quota has one marker at most and isn't flagged.

  • agent/episode_launch_transport._invoke raises ProviderRefusedService("Provider refused service: …") for such a reply. This covers every pinned call: the Designer and refiner roles, the Materialization Implementer, Builder planning and emission, and Target Workflow model calls. The failure is recorded through the normal physical_attempt_failed path. It's not a dropped connection, so the Replace a model attempt whose connection dropped mid-response (ADR 0008 amendment) #76 supervisor does not replace it.

  • The chat coding adapter now uses the same detector; its duplicated markers are removed.

Tests

tests/agent/test_provider_notices.py, 8 tests:

  • the Argo notice is recognized;
  • ordinary answers are not: a single marker, short text, empty or None, and long text;
  • a local fake gateway returning the notice (streamed or plain) makes invoke_pinned_route raise ProviderRefusedService after one call;
  • an ordinary answer passes through.

Unchanged and passing: test_refinement_chat_coding (18), test_episode_model_failure_reporting (5), test_launch_transport_streams (4), test_model_call_failed_attempt_replacement (7), test_model_call_liveness (8).

🤖 Generated with Claude Code

With the Argo monthly quota exhausted (2026-10-09), every refiner call through
the shared pinned transport "succeeded" in about one second with Argo's
"IMPORTANT USAGE NOTICE FROM ARGO … ACCESS REVOKED … Monthly limit exceeded"
text as the reply, and that text became refiner input. chian#79 detected such
notices only in the chat coding adapter.

- agent/provider_notices.py: provider_notice() recognizes a refusal when a
  short reply (<= 4000 chars) carries at least two distinct markers (notice
  from Argo, access revoked, usage/monthly limit exceeded, quota exceeded,
  contact your Directorate Operations Officer); one marker alone, as in a
  genuine answer discussing quotas, is not enough.
- episode_launch_transport._invoke raises ProviderRefusedService for such a
  reply, so the pinned call fails visibly (Designer, Materialization
  Implementer, Builder, Target Workflow calls). It is not a dropped
  connection, so the supervisor does not replace it.
- The chat coding adapter uses the same detector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wilke
wilke merged commit 0d5e745 into chian:main Oct 9, 2026
33 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant