Skip to content

feat: per-request GitHubConfig repo + cookbook examples#7536

Draft
Mustafa-Esoofally wants to merge 4 commits intomainfrom
cookbook/github-dynamic-repo-multi-source
Draft

feat: per-request GitHubConfig repo + cookbook examples#7536
Mustafa-Esoofally wants to merge 4 commits intomainfrom
cookbook/github-dynamic-repo-multi-source

Conversation

@Mustafa-Esoofally
Copy link
Copy Markdown
Contributor

Summary

Adds two GitHub-related cookbook examples and exposes GitHubConfig.repo as a per-request parameter:

  • feat: allow GitHubConfig repo to be specified per request — lets callers pick the repo per tool invocation instead of being hard-coded.
  • cookbook: add GitHub dynamic repo and multi-source integration examples — demonstrates the new parameter plus multi-source knowledge integration.

Why

The previous API required the repo to be pinned at config time, which prevented agents from working across multiple GitHub repos within a single session.

Status: needs rebase

This branch was cut before several test files landed on main (resolve_db_from_config, citation_suppression, components_router, workflow_custom_table_names, etc.). A direct diff against main currently appears to delete ~1100 lines of tests — those tests actually exist on main and are missing from this branch's base. Rebase onto current main before merging to get a clean diff.

Test plan

  • Rebase onto current main
  • Verify the two cookbook files run end-to-end
  • Verify unit tests for GitHubConfig per-request repo still pass

ysolanky and others added 4 commits April 14, 2026 00:25
Make `repo` optional on `GitHubConfig` and accept it at request time on
`/knowledge/remote-content`, so a single configured GitHub source (and its
auth credentials) can serve multiple repositories without registering a new
config per repo.

- `GitHubConfig.repo` is now `Optional[str]`; `file()` and `folder()` accept
  a `repo` override that flows through to `GitHubContent`.
- `GitHubContent` carries a new `repo` field; the loader resolves the
  effective repo as `content.repo or gh_config.repo` and errors clearly if
  neither is set. All API URLs, virtual paths, and metadata use the
  resolved repo.
- `/knowledge/remote-content` accepts an optional `repo` form field. It is
  rejected for non-GitHub sources, and required when the GitHub config has
  no default repo.
- Tests cover the optional field, the per-request override on file/folder,
  the endpoint override path, and the non-GitHub rejection.
- 05_github_dynamic_repo.py: demonstrates GitHubConfig without a default
  repo using per-request repo overrides to load files from multiple
  repositories through one stateless config
- 06_multi_source.py: demonstrates multiple remote sources in a single
  Knowledge instance with two GitHub configs (public + authenticated)
  plus optional S3/GCS/SharePoint/Azure Blob scaffolding gated by
  environment variables
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