Skip to content

fix: move citations to sentence boundaries - #400

Merged
neuromechanist merged 2 commits into
developfrom
patch/citation-sentence-placement
Sep 18, 2026
Merged

neuromechanist merged 2 commits into
developfrom
patch/citation-sentence-placement

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Follow-up to #399.

What changed

Citation deltas can arrive between text chunks, which previously left markers inside words or sentences (for example ru[1]nica.m). Normalize known markers to the end of the sentence in backend final/persisted content and in the widget renderer, including older saved responses. The final SSE done event now carries the normalized content.

Tested

  • 87 focused Python tests passed
  • 14 citation-marker tests passed
  • 47 streaming tests passed
  • Ruff format/check, Bun streaming tests, Node syntax check, and git diff --check passed

Live evidence

Observed on merged develop after #399 deployed: ru[1]nica.m, postAmicaUt[1]ility, and set[1] of menus. This PR covers that exact stream shape.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://patch-citation-sentence-plac-demo.osc.earth
Branch patch/citation-sentence-placement
Commit 816e2d2

This preview will be updated automatically when you push new commits.

@neuromechanist
neuromechanist merged commit 3b80614 into develop Sep 18, 2026
7 of 8 checks passed
@neuromechanist
neuromechanist deleted the patch/citation-sentence-placement branch September 18, 2026 22:47
neuromechanist added a commit that referenced this pull request Sep 19, 2026
…usekeeping (#411)

* fix: cap get_full_docstring citable text like the FAQ citation path

Uncapped, a single call at the default limit=5 could put ~50K chars of
citable text on the wire (25x the FAQ cap). Adds
_MAX_CITABLE_DOCSTRING_CHARS and corrects the citable-payloads test
docstring, which had wrongly assumed this tool's snippets were already
truncated by search.py.

* test: cover the docker-build.yml concurrency-group fix for the :latest race

* docs: retitle Unreleased to 0.8.10 and add PR #399 to the changelog

PR #400's own body says it is a follow-up to #399, and #399 also
tightens conceptual code-document search relevance, which had no
changelog entry anywhere.

* test: convert TestFetchPageContentImpl from httpx.Client mocking to respx

Matches the respx-boundary pattern already used by
TestFetchPageReportsFailureStructurally in the same file and this
project's no-mocks-of-business-logic policy. Found and fixed a respx
route-shadowing gotcha along the way: a bare host URL with no path
matches any path on that host, so a more specific route registered
after it is silently shadowed.

* fix: address review suggestions on PR #411

Name DOCSTRING_SNIPPET_MAX_LENGTH explicitly instead of the ambiguous
'above' (the adjacent constant is the unrelated FAQ cap). Anchor the
remaining bare-host respx routes in TestFetchPageContentImpl with a
trailing slash for defense against the route-shadowing gotcha this
same PR found, even though each currently registers only one route.
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.

1 participant