Skip to content

fix: improve citation quality and streaming presentation - #399

Merged
neuromechanist merged 4 commits into
developfrom
feature/citation-thinking-ui
Sep 18, 2026
Merged

neuromechanist merged 4 commits into
developfrom
feature/citation-thinking-ui

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

  • Keep the thinking state in one visible assistant placeholder while the streaming response is empty; preserve the live staggered three-dot animation.
  • Buffer streaming citation deltas until the corresponding text block so citation markers render after the sentence they cite.
  • Tighten conceptual code-document searches to require meaningful terms and reserve exact identifier matching for function/symbol lookups, reducing unrelated citations.
  • Add regression coverage across content assembly, API responses/streams, frontend rendering, knowledge search, and the docstring workflow.

Test plan

  • DATA_DIR=/private/tmp/osa-test-data UV_CACHE_DIR=/private/tmp/osa-uv-cache uv run --extra dev pytest -q tests/test_agents/test_content.py tests/test_api/test_citation_response.py tests/test_api/test_citation_streaming.py tests/test_integration/test_docstring_workflow.py tests/test_frontend/test_widget_citations.py tests/test_knowledge/test_search.py
  • node --check frontend/osa-chat-widget.js
  • bun frontend/test-citation-markers.js
  • bun frontend/test-streaming.js
  • Ruff checks and pre-commit hooks pass.

Verification notes

  • The focused changed-module suite passes. The broader non-LLM suite still has pre-existing environment-dependent failures/errors involving external docs/services, MCP/NEMAR, HED schema access, and default SQLite fixture paths; those are not introduced by this branch.

Do not merge without review.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://feature-citation-thinking-ui-demo.osc.earth
Branch feature/citation-thinking-ui
Commit ee0bc94

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

@neuromechanist
neuromechanist merged commit 1cc16cd into develop Sep 18, 2026
7 of 8 checks passed
@neuromechanist
neuromechanist deleted the feature/citation-thinking-ui branch September 18, 2026 22:12
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