Syncing upstream
OmicsBase builds on two projects that keep moving: LibreChat and OpenHands. We call them upstream. Our forks carry our changes on top of upstream. Every so often we merge upstream’s new work into the forks.
How our changes are kept
- Our changes are ordinary Git commits on the fork’s working branch. There are no patch files.
- The omicsbase repository stores the exact fork commit it uses (the submodule pointer).
- We keep our features in our own files where we can (see Where our code sits inside the forks). Upstream files only get small hooks into them.
- Two things are changed while the Reports image is built, not in the fork:
- The Agent Canvas files come from upstream’s image,
ghcr.io/openhands/agent-canvas:<version>. - Upstream’s start script is adjusted by
docker/openhands/patch_entrypoint.py, and for Roihu bydeployment/roihu/roihu_entrypoint.py. Each change looks for an exact line of upstream’s script. If upstream moved that line, the build stops with an error instead of producing a broken script.
- The Agent Canvas files come from upstream’s image,
See what we changed
Inside a submodule, these commands show our side.
The history of the working branch, one line per merge or commit:
git log --oneline --first-parentYou should see lines such as Merge pull request #… from 0xMuluh/… for our changes and chore(upstream): merge … for upstream syncs.
Every file we changed since the last upstream merge, in LibreChat:
git diff --stat upstream/main...HEADThe same for OpenHands, against the release we merged last:
git diff --stat v1.41.0...HEADBefore you start
Each submodule needs a second remote, upstream, that points at the original project. A remote is a named address of another copy of the repository.
Go into the submodule:
cd librechatCheck the remotes:
git remote -vYou should see
origin(our fork) andupstream.If
upstreamis missing, add it. For LibreChat:git remote add upstream https://github.com/danny-avila/LibreChat.gitFor OpenHands, in
openhands/:git remote add upstream https://github.com/OpenHands/OpenHands.git
Sync LibreChat
We merge LibreChat’s main branch.
In
librechat/, fetch upstream:git fetch upstream --tagsStart a new branch from the fork’s working branch:
git switch -c chore/librechat-upstream-<yyyymmdd> origin/chore/librechat-upstream-20261021Merge upstream:
git merge upstream/main -m "chore(upstream): merge LibreChat main (<yyyy-mm-dd>)"Resolve the conflicts. These files are edited on both sides and conflict most often:
client/index.htmlclient/src/style.cssclient/src/locales/en/translation.jsonclient/src/components/Chat/Messages/Content/ToolCall.tsxpackages/client/src/theme/registry.tsandpackages/client/src/theme/themes/index.ts
Run the tests in Test LibreChat.
Push the branch to the fork and open a pull request against the working branch.
Sync OpenHands
We merge OpenHands release tags, such as v1.41.0.
In
openhands/, fetch upstream:git fetch upstream --tagsStart a branch named after the release, from the fork’s working branch:
git switch -c chore/openhands-v<version> origin/chore/openhands-v1.41.0Merge the release tag:
git merge v<version> -m "chore(upstream): merge OpenHands v<version>"Resolve the conflicts. Our changes are in
src/integrations/omicsbase/,src/routes/root-layout.tsx,src/components/features/browser/browser.tsxandsrc/utils/file-validation.ts.Push the branch to the fork and open a pull request against the working branch.
Then update the versions that the images name, in the omicsbase repository:
- In
docker/openhands/Dockerfile, set the Agent Canvas image tag in theCOPY --from=ghcr.io/openhands/agent-canvas:…line. - In the same file, set the versions of
openhands-agent-server,openhands-toolsandopenhands-automationto the ones that release uses. - In
deployment/roihu/Dockerfile, setCANVAS_IMAGEto the same Agent Canvas tag, andBASE_IMAGEto the matchingomicsbase-openhandstag. - Build the image (see Test OpenHands). If
patch_entrypoint.pyorroihu_entrypoint.pystops the build, find the moved line in upstream’sentrypoint.shand update the anchor in the script.
Move the submodule pointer
After the fork’s pull request is merged:
Inside the submodule, check out the merge commit:
git fetch origin git checkout <merge commit>Go back to the repository root:
cd ..Stage the new pointer, with any Dockerfile changes:
git add librechatCommit with a message that names the upstream version, for example
chore(openhands): update to v<version>.Open the omicsbase pull request.
What to test after a sync
Test LibreChat
Run these in librechat/:
npm cinpm run build:packagesnpm run test:packages:apinpm run test:clientnpm run lint
Then, from the repository root:
- Build the image with
python3 scripts/build_librechat.py --context default. - Start it, either in the full stack or in a local install. See Development loop.
- Check in the browser:
- You can sign in.
- A new note runs an R cell and shows a plot.
- A file uploads into a note.
- A public note opens without signing in, and continuing it makes your own copy.
- The Reports page opens.
- Check the server log for the line that lists the
notethreadstools. It ends inTools:followed by the tool names, such asexecute_r_cell. If it is missing, the notes have no tools.
Test OpenHands
Run the contract tests:
python3 scripts/build_openhands.py --verify-onlyBuild the Reports image. This also type-checks and builds the interface:
python3 scripts/build_openhands.py --context defaultRun it in a local install with your own images (see Run the local install with your own images) and check:
- Reports opens inside OmicsBase, with its sidebar.
- The agent answers.
- The editor and the report viewer open a report’s files.
Build the Roihu image from
deployment/roihu/Dockerfileand connect it as your own computer, or start a Roihu session.Through the session, send a request to the agent’s
/api/settingswithout the session key, and one with a wrong key. Both must be refused with401. Only then let users use the new image.
Python tests
Run python3 -m pytest tests from the repository root. It covers the gateway and the router, which depend on upstream’s behaviour.