open-notebook/open_notebook
GF-2025 90c6fed383
Some checks are pending
Development Build / build-regular (push) Blocked by required conditions
Development Build / extract-version (push) Waiting to run
Development Build / changes (push) Waiting to run
Development Build / build-single (push) Blocked by required conditions
Development Build / summary (push) Blocked by required conditions
Tests / Backend Typecheck (push) Waiting to run
Tests / Frontend Tests (push) Waiting to run
Tests / Frontend Lint (push) Waiting to run
Tests / Frontend Build (push) Waiting to run
Tests / Backend Tests (push) Waiting to run
Tests / Backend Lint (push) Waiting to run
fix(worker): a source deleted before processing must fail permanently, not starve the queue (#1364)
* fix(worker): fail permanently when the source was deleted before processing

Source.get() raises NotFoundError instead of returning None, so the
'if not source: raise ValueError' guard in process_source_command was
unreachable. NotFoundError is not in the command's stop_on list, so the job
was retried as transient (max_attempts=15, exponential_jitter, wait_max=120)
and every job behind it starved until the worker process was restarted.

Catch NotFoundError around that call and re-raise as ValueError, which is
already this command's permanent-failure channel.

Fixes #1363

* chore(worker): rebase on main, cover deleted transformations, changelog

- Rebased onto main (import conflict with #1425).
- A transformation deleted before the job runs hits the same NotFoundError
  path in process_source_command; it now fails permanently too (test added).
- ruff format on the new test (CI gates formatting since #1429).
- CHANGELOG entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

* fix(domain): only a missing record is NotFoundError in ObjectModel.get

ObjectModel.get wrapped every exception from repo_query, including the
RuntimeError it re-raises for retriable SurrealDB transaction conflicts, as
NotFoundError. With process_source now treating NotFoundError as permanent,
a transient conflict would have failed the job for good. get() now lets
NotFoundError / InvalidInputError through and raises DatabaseOperationError
(chained) for anything else.

The permanent-failure messages are static; the underlying error stays as the
exception's cause for the worker log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

* fix(worker): run_transformation fails permanently on a deleted source too

NotFoundError (now only raised for a genuinely missing record) joins
run_transformation's stop_on and permanent-failure arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

* docs(changelog): rebase entry onto the consolidated Unreleased section

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

* fix(worker): a source deleted mid-processing also fails permanently

save_source re-reads the source after extraction; a deletion in that window
raised NotFoundError from inside the graph, which process_source retried as
transient. NotFoundError (now only a genuinely missing record) joins its
stop_on and gets a permanent-failure arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

* docs(adr): ADR-013 for the ObjectModel.get error contract

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

* fix(embeddings): a record deleted before embedding is a permanent failure

Completes the review on #1364: embed_* commands treat NotFoundError (now only
a genuinely missing record) like their other permanent failures instead of
retrying it; a DatabaseOperationError still retries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

* docs(embeddings): NotFoundError is a permanent failure too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBYpxzSS62Y3TZkgB9NUZy

---------

Co-authored-by: Luis Novo <lfnovo@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 05:59:34 -03:00
..
ai feat(providers): MiniMax text-to-speech and MiniMax-M3 (#1444) 2026-10-03 23:19:28 -03:00
database style: ruff format the Python codebase and gate it in CI (#1429) 2026-10-03 07:12:25 -03:00
domain fix(worker): a source deleted before processing must fail permanently, not starve the queue (#1364) 2026-10-04 05:59:34 -03:00
graphs fix(sources): map content-core's typed extraction errors (#1442) 2026-10-03 22:46:40 -03:00
podcasts style: ruff format the Python codebase and gate it in CI (#1429) 2026-10-03 07:12:25 -03:00
utils style: ruff format the Python codebase and gate it in CI (#1429) 2026-10-03 07:12:25 -03:00
__init__.py refactor: move environment variables loading to application entry point (#283) 2025-12-01 14:59:50 -03:00
AGENTS.md style: ruff format the Python codebase and gate it in CI (#1429) 2026-10-03 07:12:25 -03:00
CLAUDE.md docs: restructure documentation around AGENTS.md, VISION.md and decision records (#1032) 2026-07-10 15:33:19 -03:00
config.py fix(ai): default ESPERANTO_LLM_TIMEOUT to 180 seconds (#1441) 2026-10-03 22:33:56 -03:00
exceptions.py fix(transformations): reject truncated and empty model output (#1385) 2026-09-30 23:05:16 -03:00