File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- """Configuration defaults for python-agent-harness.
2-
3- Mirrors the defcustom defaults of the Emacs gptel-agent-harness.
4- """
1+ """Configuration defaults for python-agent-harness."""
52
63from __future__ import annotations
74
131128API_RETRY_BASE_DELAY = 1.0 # base backoff (seconds), doubled per attempt
132129API_RETRY_MAX_DELAY = 30.0 # per-attempt backoff cap (seconds)
133130
131+ # HTTP status codes that should trigger auth-refresh (key re-read from
132+ # config/env) instead of being treated as transient retryable errors.
133+ # 401 is always included (standard "Unauthorized"). Some API gateways
134+ # return 502 or other 5xx codes when the backend auth token has expired
135+ # rather than a proper 401 — add those here so the client refreshes the
136+ # key instead of pointlessly retrying the same expired credential.
137+ AUTH_REFRESH_STATUS_CODES : list [int ] = [401 , 502 ]
138+
134139# ---- tool execution ----------------------------------------------------------
135140SUBAGENT_MAX_ROUNDS = 60
136141# Tool execution mirrors gptel's `gptel--handle-tool-use': synchronous
You can’t perform that action at this time.
0 commit comments