andreagrandi / andreagrandi/draftomen

Surface OpenRouter API errors as bounded enrich-set failure messages

Đang mở
#528 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
draftomen enhancement size: S
Ngôn ngữ chính
Python
Star
0
Fork
0
Merge trung bình
1 giờ 21 phút
Pull request đã merge (30 ngày)
188

Mô tả

## Problem

When OpenRouter rejects a request (e.g. HTTP 403 key monthly limit exceeded), enrich-set fails with the generic 'Set-enrichment analysis failed.' The client maps every non-200 to a generic api code and discards the response body, so the operator cannot distinguish an exhausted key from a data bug. Reproduced during the HOB run of 2026-09-14: the run died at card 116 with no actionable message.

## Proposed change

Map bounded, path-free API error classes (403 key limit, 401 auth, 429 rate limit) to explicit client error codes and include the code in the workflow error message. Keep the bounded-and-path-free CLI error contract (tests/test_cli.py pins that private causes are never printed).

## Acceptance Criteria

- [ ] AC1: A 403 key-limit response surfaces as an explicit bounded message naming the key limit, with no paths or private content
- [ ] AC2: A 401/429 response surfaces their bounded classes distinctly
- [ ] AC3: The bounded-error CLI contract test remains green and unmodified
- [ ] AC4: A failed acquisition stays resumable; the failed work item keeps its durable attempt record

## Dependencies

None

## Implementation classification

- **Estimated size:** S
- **Orchestration risk:** Normal
- **Reason:** Isolated error-mapping change in one client plus message threading.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.