Skip to content

fix: report unsupported source-only RAG text scope - #2379

Merged
pancacake merged 2 commits into
HKUDS:devfrom
remote-controlled-man:codex/prflow-c7e7334e4ed2
Nov 5, 2026
Merged

pancacake merged 2 commits into
HKUDS:devfrom
remote-controlled-man:codex/prflow-c7e7334e4ed2

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Description

A RAG call with only source_path enters visual inspection and reports reference_required, even for a plain text question. Return source_scope_unsupported after the existing KB access check and run no retrieval, so the requested source boundary is never dropped.

This implements the explicit unsupported-scope option in #2374. Strict document-scoped semantic retrieval remains unavailable through this tool. Explicit visual selectors, figure references and inferred English/Chinese page references retain their existing behavior. Update the parameter description and both language hints to explain this contract.

Related Issues

Fixes #2374.

Module(s) Affected

  • tools
  • services
  • tests

Validation

On macOS arm64 with standalone CPython 3.12.14 and Redis 7.4:

  • Full Python suite: 12,252 passed, 43 skipped, 31 subtests passed.
  • RAG suite: 968 passed, 1 skipped.
  • All-file pre-commit, Ruff lint/format, import boundaries, architecture and repository/workspace hygiene: passed.
  • Dependency check: all 281 installed packages compatible.

The full suite exited successfully but emitted a pending-task shutdown diagnostic for TurnLifecycle._flush_live_prefix; its baseline status was not checked.

Regression tests cover unsupported text scope, null/empty selectors, source hashes, access denial, inferred pages and ordinary unscoped queries. The original scope error and the page-inference regression were each observed failing before their respective fixes. The upstream Python/OS CI matrix remains to run.

Checklist

  • This PR targets dev.
  • Contribution guidelines followed.
  • All-file pre-commit passed.
  • Relevant regression tests added.
  • English and Chinese tool hints updated.
  • Existing KB authorization checks retained.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 14:45

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@pancacake
pancacake merged commit d731546 into HKUDS:dev Nov 5, 2026
23 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.

3 participants