Skip to content

[tests] Cover OKP RAG retrieval through /v1/responses - #23

Draft
malingatembo wants to merge 1 commit into
openstack-k8s-operators:mainfrom
malingatembo:fix/OSPRH-33344-document-references
Draft

malingatembo wants to merge 1 commit into
openstack-k8s-operators:mainfrom
malingatembo:fix/OSPRH-33344-document-references

Conversation

@malingatembo

@malingatembo malingatembo commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Fix the OKP filter test to read URLs from referenced_documents instead of chunk attributes, and validate decoded document paths.

  1. Update the existing RAG test to run both VM questions through /v1/responses, matching the end-point used by openstack lightspeed.
  2. Preserve checks for nonmpty retrieval, openstack documentation and exclusion of the openshift virtualization.

Related-Issue: OSPRH-40177

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@malingatembo malingatembo changed the title [tests] Read document URLs from query references [tests] Cover OKP RAG retrieval through /v1/responses Nov 13, 2026
Run the two vm questions throught the /v1/responses API
and inspect the file-search results.
All earlier checks are kept

Related-Issue: OSPRH-40177
Signed-off-by: malingatembo <tembomalinga@gmail.com>
@malingatembo
malingatembo force-pushed the fix/OSPRH-33344-document-references branch from 23ad2c5 to 1a1b2dd Compare November 13, 2026 14:12
@openshift-ci

openshift-ci Bot commented Nov 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: malingatembo
Once this PR has been reviewed and has the lgtm label, please assign umago for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Comment on lines +40 to +41
"tool_choice": {"type": "file_search"},
"include": ["file_search_call.results"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Issue (blocking): Since lightspeed-core/lightspeed-stack#3255 has been merged then after we merge openstack-k8s-operators/lightspeed-operator#163, this will no longer work. LCS now strips server-managed file_search_call items from the /v1/responses output whenever the request doesn't declare a file_search tool in tools ... tool_choice and include don't change that. You can force the presence by specifying file_search in tools.

Additionally, this is not how Goose queries lightspeed-stack via the /v1/responses API. The aim here is to emulate Goose request as closely as possible. Here's a thing we could explore:


🤖 Generated with the help of AI (not 100 % guaranteed to work but worth of exploring in this direction)

  1. Send the request with "store": true (no tools, no tool_choice, no include — the response body won't contain the file search results either way, since they're sanitized out).
  2. Query /v2/conversations/{conversation_id} (the ID comes back in the response's conversation field). The turn is persisted before sanitization, so it records what really happened in the background:
    • tool_calls — contains a file_search entry (name: "file_search", args.queries) iff the model actually performed retrieval;
    • referenced_documents on the assistant message — the deduplicated list of retrieved docs with full doc_urls (LCS builds these from source_path/reference_url chunk attributes), which is what the OpenStack-docs-present / no-virtualization-book assertions should run against.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants