Skip to content

fix: use default retriever router#998

Open
mahoushoujyo-eee wants to merge 1 commit intocloudwego:mainfrom
mahoushoujyo-eee:fix/router-default-retriever
Open

fix: use default retriever router#998
mahoushoujyo-eee wants to merge 1 commit intocloudwego:mainfrom
mahoushoujyo-eee:fix/router-default-retriever

Conversation

@mahoushoujyo-eee
Copy link
Copy Markdown

Fixes #954

Summary

  • use the resolved default router when Config.Router is nil
  • add a regression test for the default all-retrievers routing behavior

Tests

  • go test ./flow/retriever/router
  • go test ./flow/retriever/...
  • golangci-lint run ./flow/retriever/router --timeout 5m

Note: go test ./... currently has unrelated Windows-local failures in ADK filesystem/plantask/reduction tests and a CRLF/path assertion. golangci-lint run ./... --timeout 5m reports unrelated existing gci issues in files not touched by this PR.

Copilot AI review requested due to automatic review settings April 24, 2026 15:46
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 24, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a nil-pointer panic in the retriever router by ensuring the resolved (default) router function is stored on the constructed routerRetriever when Config.Router is not provided.

Changes:

  • Store the resolved router (default or user-provided) in routerRetriever instead of config.Router.
  • Add a regression test verifying the default routing behavior calls all registered retrievers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
flow/retriever/router/router.go Fixes the nil router assignment by storing the resolved default router function.
flow/retriever/router/router_test.go Adds a regression test to ensure the default router queries all configured retrievers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

bug: nil pointer dereference in flow/retriever/router when Router config is not provided

3 participants