You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: surface parser errors on CompassDocument in sync client (#222)
## Summary
- Sync `CompassParserClient` previously logged parser errors and
**skipped** returning those docs, so callers (e.g. North sync
`process_file` → `put_documents`) got an empty list and raised a generic
`CompassNoContentParsedError` with no details.
- Align with [async
parser](https://github.com/cohere-ai/cohere-compass-sdk/blob/f8c46703465fc888c95c00c55337df75d125a3f6/cohere_compass/clients/parser_async.py#L372),
which already adapts and returns `CompassDocument`s that carry `errors`.
- Safe for current North callers: [North already filters out docs with
`errors`](https://github.com/cohere-ai/north/blob/main/src/backend/services/compass.py#L495-L504)
before inserting, so returning errored docs does not change what lands
in their list today — it only makes the error message available for them
to surface.
- Related to
[CMPS-941](https://linear.app/cohereai/issue/CMPS-941/show-a-useful-error-for-password-protected-files-in-compass)
(one of several PRs; does not fully address the issue).
- Context: [Password protected file parsing error handling
investigation](https://app.notion.com/p/cohereai/Password-protected-file-parsing-error-handling-investigation-3a34398375db80478db6e061457df437)
## Test plan
(I pointed a local North to local compass SDK and made sure this work
with it)
- [x] Process a password-protected PDF via sync `process_file` /
`process_file_bytes` and confirm the returned `CompassDocument` includes
the parsing error (not an empty list).
- [x] Confirm successful parses still return docs unchanged.
- [x] Smoke-check North sync upload path can read `doc.errors` instead
of treating the result as “no content.”
---------
Co-authored-by: Cursor <cursoragent@cursor.com>