ReMe/reme
BeiMu-new 5e70ec0476 fix(embedding): classify every provider status shape and split only input errors
The per-item fallback still multiplied service failures into one request per item.
Both gaps come from the fallback this PR adds, so they are fixed here.

Status extraction
- `_http_status()` reads the status from `status_code`, an integer `code` (Google GenAI
  exposes the HTTP status there), `response.status_code` (httpx-style wrappers), and the
  structured `status_code` embedded in the message (AgentScope's DashScope embedding turns
  every non-200 response into a plain `RuntimeError`).
- Only integers are read from `code`. A string `code` names an error
  (`insufficient_quota`, `rate_limit_exceeded`, `InvalidApiKey`); reading it as a status
  would misclassify quota and rate-limit errors.
- `_is_provider_wide_failure`, `_is_transient_provider_failure`, `_is_rate_limited` and
  `_is_input_dependent_failure` all classify through it.

Splitting
- The generic fallback splits only when `_is_input_dependent_failure()` matches: a
  context-length rejection, the one error a single over-long item explains by itself.
  Anything unrecognized is provider-wide and is never answered with one request per item.
- This narrows the isolation this PR adds. An input-dependent error that carries neither a
  status nor an input-length signal is no longer split, so it costs its batch instead of
  multiplying the requests. Erring towards the batch keeps one provider failure from
  becoming N failures and losing the healthy vectors anyway.
- `_embed_individually()` drops the redundant `len(single) == 1` check: the
  `_call_with_retry([text])` contract only returns a result of the expected length.

Verified against the real exception classes: `google.genai.errors.APIError.code` is an
`int`, and a real DashScope response yields a `RuntimeError` whose message carries
`"status_code"`. Regression coverage uses the real classes when available and mirrors
their shape otherwise.
2026-10-16 21:10:39 +08:00
..
components fix(embedding): classify every provider status shape and split only input errors 2026-10-16 21:10:39 +08:00
config fix(search): accept CLI queries that look like numbers (#612) 2026-10-16 10:36:05 +08:00
enumeration feat(classifier): add optional Jev component and service demo (#619) 2026-10-14 17:49:49 +08:00
schema feat(jobs): add a unified enabled switch for all job types (#580) 2026-09-30 18:30:36 +08:00
steps fix(auto-dream): checkpoint scanned source versions (#618) 2026-10-16 12:13:48 +08:00
utils feat(token counter): add Qwen token counting utility with fallback (#616) 2026-10-16 11:58:35 +08:00
__init__.py chore: release 0.4.2.0 and simplify publishing workflows (#631) 2026-10-16 16:53:52 +08:00
application.py feat(docker): add container deployment and multi-platform release workflow (#582) 2026-10-03 23:54:58 +08:00
constants.py feat(service): support explicit wildcard network binds (#547) 2026-09-15 14:26:33 +08:00
entry_point.py feat: simplify plugin setup and add management CLI (#485) 2026-08-23 17:58:20 +08:00
plugin.py feat: simplify plugin setup and add management CLI (#485) 2026-08-23 17:58:20 +08:00
plugin_cli.py feat: simplify plugin setup and add management CLI (#485) 2026-08-23 17:58:20 +08:00
plugin_manifest.py feat: simplify plugin setup and add management CLI (#485) 2026-08-23 17:58:20 +08:00
reme.py feat: simplify plugin setup and add management CLI (#485) 2026-08-23 17:58:20 +08:00