Skip to content

bug: chat_with_agent reports a usage-limit 429 as agent_busy although the turn already ran, so a retry repeats its side effects #3244

Closed

Description

@webmixgamer

Summary

TrinityClient.chat() turns every HTTP 429 from POST /api/agents/{name}/chat that the gate parser does not claim into {queue_status: "queue_full", retry_after}, and runAgentChat answers it as agent_busy — "Please wait N seconds before retrying". Two different 429s reach that branch. The admission refusal (CapacityFull, X-Trinity-Error-Code: capacity, queue_length in the detail) dispatched nothing, so a retry is right. The usage / rate-limit 429 from _apply_sub003_autoswitch comes after the agent already ran the turn: the execution row is written failed with its salvaged cost, then a 429 is raised with the classified error code (sometimes "Subscription auto-switched … Please retry."). Reported as agent_busy, the caller retries the whole message and repeats whatever the partial run already did.

Context

Acceptance Criteria

  • agent_busy is answered only for an admission refusal (X-Trinity-Error-Code: capacity), never for a 429 raised after the agent ran
  • The post-run 429 surfaces as its own result that names the failed execution, so the caller can read it with get_execution_result, and does not tell the caller to retry
  • A test drives both 429 shapes through the real chat() and runAgentChat and asserts the two answers differ

Technical Notes

  • client.task() throws API error (429) for the /task route's 429s; worth checking for the same split while there.

Activity

  1. added
    complexity-lowComplexity: low (board points 1-3)
    status-readyGreenlit and ready for development (vetted; counterpart to status-incubating)
    on Oct 5, 2026
  2. added and removed
    status-readyGreenlit and ready for development (vetted; counterpart to status-incubating)
    on Oct 9, 2026
  3. added
    status-in-devMerged to dev, awaiting release cut to main
    and removed on Oct 10, 2026
  4. added a commit that references this issue on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions