Skip to content

feat: make fetch timeout for chunks configurable - #1031

Merged
cybermaggedon merged 3 commits into
trustgraph-ai:release/v2.7from
kworathur:feat/configurable-librarian-fetch-timeout
Jul 7, 2026
Merged

feat: make fetch timeout for chunks configurable#1031
cybermaggedon merged 3 commits into
trustgraph-ai:release/v2.7from
kworathur:feat/configurable-librarian-fetch-timeout

Conversation

@kworathur

@kworathur kworathur commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses part of #874. The timeout for fetching chunks from the librarian is currently hardcoded. This PR makes the fetch timeout configurable through a new parameter called fetch_chunk_timeout.

Changes

All changes are in the constructor of the Processor class in trustgraph-flow/trustgraph/retrieval/document_rag/rag.py. The parameter fetch_chunk_timeout is threaded through the constructor's existing params argument, which mirrors how fetch_limit and other parameters for document RAG are passed. The default value of 120 seconds has been preserved from before.

Configuring the parameter: An operator can configure fetch_chunk_timeout by setting its value in dev-tools/proc-group/groups/rag.yaml:

processors:
  - class: trustgraph.retrieval.document_rag.Processor
    params:
      <<: *defaults
      id: document-rag
      doc_limit: 20
      fetch_chunk_timeout: 180

Tests

Three unit tests have been added to tests/unit/test_retrieval/test_document_rag_service.py:

  • processor picks up default of 120 seconds when fetch_chunk_timeout is not in params
  • processor picks up override value when fetch_chunk_timeout is overridden.
  • the configured value of fetch_chunk_timeout is passed as a parameter to librarian.fetch_document_text()

Notes

  • No validation has been added for the new fetch_chunk_timeout, similar to the remaining parameters initialized in the same constructor.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Contributor License Agreement ✅

All contributors have signed the CLA. Thank you!

@kworathur

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@cybermaggedon
cybermaggedon self-requested a review July 7, 2026 09:36
@cybermaggedon cybermaggedon self-assigned this Jul 7, 2026

@cybermaggedon cybermaggedon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, small change. Two commits: tests first, then the feature — Ninja 🥷

@cybermaggedon

Copy link
Copy Markdown
Contributor

@kworathur this is in draft state, is it ready to merge?

@kworathur
kworathur marked this pull request as ready for review July 7, 2026 13:59
@kworathur

Copy link
Copy Markdown
Contributor Author

@cybermaggedon all good to merge!

@cybermaggedon
cybermaggedon merged commit f76f2ab into trustgraph-ai:release/v2.7 Jul 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants