PageIndex/pageindex
mountain 284ce005f5 fix(cloud): align cloud/local backend contracts and harden the HTTP layer
Fixes the cloud/local contract mismatches from the PR #272 review
(verified against the official API docs — the cloud API has no
folder/collection endpoints publicly, GET /docs supports limit<=100
with offset):

- query_stream: emit a terminal answer_done event with the full answer
  (same contract as the local backend); raise CloudAPIError instead of
  disguising HTTP errors as answer events; move the initial connect
  inside try so a connection failure can no longer strand the consumer
  awaiting a sentinel that never arrives
- _request: rewind file objects before retrying so a transient 5xx/429
  during upload no longer re-sends an empty multipart body; carry the
  HTTP status on CloudAPIError (status_code) and keep the last status
  in the max-retries error
- list_documents: paginate with limit/offset instead of a hard-coded
  limit=100, so >100-doc collections are no longer silently truncated
  (whole-collection queries rely on this list)
- folders: treat only 403/404 as "folders unavailable" (warned via
  warnings.warn instead of an invisible logger.warning, matched on
  status_code instead of a "403" substring); transient errors now
  propagate instead of being permanently cached as folder_id=None
- error taxonomy parity: cloud doc endpoints map HTTP 404 to
  DocumentNotFoundError; local get_document raises DocumentNotFoundError
  instead of returning {}; local delete_document raises on missing
  doc_id instead of silently deleting nothing
- cloud get_document warns that include_text is not supported instead
  of silently ignoring it

Adds regression tests for each fix (11 new tests).

Claude-Session: https://claude.ai/code/session_01Kx5DgKbhK1N8autqXH8SmS
2026-07-07 09:40:09 +08:00
..
backend fix(cloud): align cloud/local backend contracts and harden the HTTP layer 2026-07-07 09:40:09 +08:00
index fix(llm): configurable per-call litellm params instead of mutating the global 2026-06-25 17:09:43 +08:00
parser chore: remove unused ext local in PDF image block handling 2026-05-12 14:38:41 +08:00
storage feat(collection): scoped query mode and experimental multi-doc warning 2026-05-15 11:14:12 +08:00
__init__.py fix(llm): configurable per-call litellm params instead of mutating the global 2026-06-25 17:09:43 +08:00
agent.py feat(collection): doc_ids accepts str|list, design cleanups 2026-05-15 17:03:17 +08:00
client.py feat(collection): doc_ids accepts str|list, design cleanups 2026-05-15 17:03:17 +08:00
cloud_api.py feat:compatible with Pageindex SDK (#238) 2026-05-11 21:06:23 +08:00
collection.py feat(collection): doc_ids accepts str|list, design cleanups 2026-05-15 17:03:17 +08:00
config.py fix(llm): configurable per-call litellm params instead of mutating the global 2026-06-25 17:09:43 +08:00
errors.py fix(cloud): align cloud/local backend contracts and harden the HTTP layer 2026-07-07 09:40:09 +08:00
events.py feat: add PageIndex SDK with local/cloud dual-mode support (#207) 2026-04-08 20:21:58 +08:00
page_index.py feat: add PageIndex SDK with local/cloud dual-mode support (#207) 2026-04-08 20:21:58 +08:00
page_index_md.py Restructure examples directory and improve document storage (#189) 2026-03-28 04:28:59 +08:00
retrieve.py Restructure examples directory and improve document storage (#189) 2026-03-28 04:28:59 +08:00
utils.py fix: use .get() in get_leaf_nodes to avoid KeyError on leaf nodes (#331) 2026-07-03 15:48:29 +08:00