Repository navigation
Chat coding adapter guardrails: session sentinel, provider notices, token and progress budgets - #79
Merged
Conversation
…oken and progress budgets Fourth live refiner build on Argo (2026-10-09): the coder ran 257 steps (230 container commands studying OpenChia's sources, no edit despite six nudges), sending ~7.8M input tokens in one turn — chat completions on Argo carry no prompt cache — and exhausted the user's monthly Argo quota. Argo then answered with "ACCESS REVOKED … Monthly limit exceeded" as an ordinary assistant message, which ended the turn as if it were the coder's summary. The next turn of the same invocation failed: "Previous coding agent is live or unverifiable", because process_identity() reported the host's own PID. - process_identity() reports a per-session sentinel process (python -I -S reading stdin) that exits on close() or when the host dies; the refiner's liveness check can now resume the invocation's workspace. - A reply containing a gateway refusal (access revoked, usage/monthly/quota limit, "notice from Argo") fails the turn as "Provider refused service: …" instead of becoming a result. - Per-turn input-token budget, 1.5M by default (OPENCHIA_CODING_MAX_INPUT_TOKENS), counted from provider-reported prompt_tokens or ~4 chars/token. - Default step budget 60 (was 300); nudge after 20 steps without an edit, end the turn (no error, finish=no_progress) after 40. Budget and no-progress endings are not errors: edits stand for admission and the Episode's controller decides what follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 9, 2026
wilke
added a commit
that referenced
this pull request
Oct 9, 2026
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. #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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happened (2026-10-09, fourth live refiner build on Argo)
The Code Implementer ran 257 steps. It issued 230 container commands studying OpenChia's own sources under
/ctx/openchia(admission.py,emitter.py, constructor signatures), and made no edit despite six nudges.One turn sent ~7.8M input tokens. Each step resends the conversation (up to 240k characters), and chat completions on Argo get no prompt cache.
That exhausted the user's monthly Argo quota. Argo then replied with an ordinary assistant message:
The adapter treated it as the coder's final summary.
The next turn of the same invocation failed:
Previous coding agent is live or unverifiable; its workspace cannot be resumed. The adapter'sprocess_identity()reported the host's own PID, which is always alive (iterative_episode_refiner/coding.py:197-200).Changes (
agent/transports/refinement_chat.py)process_identity()now reports a small per-session process (python -I -S -c "import sys; sys.stdin.read()"). It exits onclose(), or when the host dies and its stdin pipe closes, so the refiner can resume the invocation's workspace.Provider refused service: …with anapi_errorevent, instead of becoming a result.OPENCHIA_CODING_MAX_INPUT_TOKENS). It counts provider-reportedprompt_tokens, or ~4 characters per token when the provider reports none.finish=no_progress), asking for the blocker to be recorded.Budget and no-progress endings are not errors: edits made so far stand for host admission, and the Episode's controller decides what comes next. Only provider refusals and non-transient provider errors fail the turn.
Tests
tests/agent/test_refinement_chat_coding.py: 18 pass, 4 new:close();test_coding_container_shell.py: 6 pass.Not in this PR
🤖 Generated with Claude Code