Fix: agent py3.10 startup crash + submit-path retry + pin agent ruff to py310 #169

Merged
bvandeusen merged 1 commits from dev into main 2026-06-30 22:03:57 -04:00
Owner

Urgent: the agent container crashed on startup (NameError: name 'Config' is not defined) — an earlier ruff --fix unquoted a self-referential annotation, safe on CI's Python 3.14 (PEP 649) but evaluated at class-def time on the agent's Python 3.10.

  • config.py: from __future__ import annotations — the fix, version-agnostic.
  • agent/ruff.toml: pin the agent to target-version = "py310" (its real runtime) inheriting root rules. Ruff now flags this class as F821, so the CI lint lane catches it instead of shipping a broken image (CI otherwise lints on 3.14, masking 3.10 issues).
  • client.py: submit-path retry (requested) — a dedicated session with a urllib3 Retry (connect/read/status, 0.5s backoff, 500/502/503/504, POST) so a blip after the GPU work is done doesn't discard it and force a re-download+recompute; a duplicate submit is a harmless 409 no-op. Lease/fetch keep the plain session + loop-level backoff.

Full CI green on dev incl. integration.

🤖 Generated with Claude Code

**Urgent:** the agent container crashed on startup (`NameError: name 'Config' is not defined`) — an earlier `ruff --fix` unquoted a self-referential annotation, safe on CI's Python 3.14 (PEP 649) but evaluated at class-def time on the agent's Python 3.10. - `config.py`: `from __future__ import annotations` — the fix, version-agnostic. - `agent/ruff.toml`: pin the agent to `target-version = "py310"` (its real runtime) inheriting root rules. Ruff now flags this class as **F821**, so the CI lint lane catches it instead of shipping a broken image (CI otherwise lints on 3.14, masking 3.10 issues). - `client.py`: **submit-path retry** (requested) — a dedicated session with a urllib3 Retry (connect/read/status, 0.5s backoff, 500/502/503/504, POST) so a blip after the GPU work is done doesn't discard it and force a re-download+recompute; a duplicate submit is a harmless 409 no-op. Lease/fetch keep the plain session + loop-level backoff. Full CI green on dev incl. integration. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-06-30 22:03:53 -04:00
fix(agent): py3.10 startup crash + submit-path retry; pin agent ruff to py310
CI / lint (push) Successful in 2s
CI / frontend-build (push) Successful in 17s
CI / backend-lint-and-test (push) Successful in 27s
CI / integration (push) Successful in 3m24s
f01b59f390
The agent container (CUDA base, Python 3.10) crashed on startup with
`NameError: name 'Config' is not defined` — an earlier `ruff --fix` unquoted the
`from_env(cls) -> Config` self-reference, which is safe on CI's Python 3.14
(PEP 649 lazy annotations) but is evaluated at class-definition time on 3.10.
CI lint/compile run on 3.14, so it slipped through.

- config.py: `from __future__ import annotations` so the self-referential
  annotation is a string, never evaluated — works on 3.10 and every version.
- agent/ruff.toml: pin the agent to `target-version = "py310"` (its real runtime)
  and inherit the root rules. Ruff now flags exactly this class as F821, so CI's
  lint lane catches it instead of shipping a broken image. (CI otherwise lints on
  3.14, masking 3.10 issues.)
- client.py: submit path now retries in-place. A dedicated session with a
  urllib3 Retry (connect/read/status, 0.5s backoff, 500/502/503/504, POST) so a
  momentary blip after the GPU work is done doesn't discard it and force a full
  re-download + recompute elsewhere. A duplicate submit after a lost response is
  a harmless 409 no-op. Lease/fetch keep the plain session + loop-level backoff.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
bvandeusen merged commit 88ff4147e1 into main 2026-06-30 22:03:57 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#169