Skip to content

Commit 586cadb

Browse files
authored
Update config.py
1 parent a767df6 commit 586cadb

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎python_agent_harness/config.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
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

63
from __future__ import annotations
74

@@ -131,6 +128,14 @@
131128
API_RETRY_BASE_DELAY = 1.0 # base backoff (seconds), doubled per attempt
132129
API_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 ----------------------------------------------------------
135140
SUBAGENT_MAX_ROUNDS = 60
136141
# Tool execution mirrors gptel's `gptel--handle-tool-use': synchronous

0 commit comments

Comments
 (0)