Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/api/tests/contract/test_demo_documents_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async def test_should_materialize_demo_source_without_parse_or_credit_charge(
)
document_chunks_response = await api_client.get(
f"/api/v1/documents/{first_response.json()['sources'][0]['document_id']}"
"/chunks?include_asset_urls=true&page_size=200"
"/chunks?page_size=200"
)

assert empty_cached_response.status_code == 200
Expand Down Expand Up @@ -261,7 +261,7 @@ async def test_should_materialize_demo_source_without_parse_or_credit_charge(
assert retrieval_results[0]["source"]["document_id"] == document_id
assert retrieval_results[0]["source"]["section_path"] != "Root"
assert media_chunks
assert media_chunks[0]["asset_url"]
assert media_chunks[0]["file_path"]
uploaded_files = fake_result_storage.raw_files_by_job_id[str(job_row["job_id"])]
assert any(file_path.startswith("images/") for file_path in uploaded_files)
assert any(file_path.startswith("tables/") for file_path in uploaded_files)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@ async def _load_child_sections(
continue

# Category 2: Descendants of scope_path (children to explore)
is_descendant = parts[:scope_depth] == scope_parts and depth > scope_depth
# depth > scope_depth is guaranteed by the continue at line above
is_descendant = parts[:scope_depth] == scope_parts
if is_descendant:
# Skip excluded paths
is_excluded = _excl and any(
Expand All @@ -630,11 +631,10 @@ async def _load_child_sections(
}
continue
else:
if depth > scope_depth:
logger.debug(
f' _load_child_sections: NOT descendant path={path!r} '
f'parts[:scope_depth]={parts[:scope_depth]} != scope_parts={scope_parts}'
)
logger.debug(
f' _load_child_sections: NOT descendant path={path!r} '
f'parts[:scope_depth]={parts[:scope_depth]} != scope_parts={scope_parts}'
)

# Category 3: Everything else → pruned (not added)

Expand Down
1 change: 1 addition & 0 deletions packages/shared-python/shared/utils/token_estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def _get_tiktoken_encoding(model_hint: str | None):
if model_hint:
return tiktoken.encoding_for_model(model_hint)
except Exception:
# Model hint lookup failed; fall through to cl100k_base default
pass

try:
Expand Down
Loading