Conversation
9ad4195 to
fbf7fb1
Compare
JAVA8_HOME was only for ad-hoc Java 8 downgrade checks and is not needed to build: the core targets Java 8 bytecode via the JDK 21 compiler's --release flag, and the dev mvn exec:exec fork cannot run on Java 8 anyway (--add-opens is Java 9+). Remove pkgs.jdk8 from both devShells and the justfile note.
- vite ^6.4.3 -> ^8.0.12 (resolves to 8.0.16; now Rolldown + Oxc + Lightning CSS) - @tailwindcss/vite ^4.2.1 -> ^4.2.2 (required: Vite 8 support landed in 4.2.2) - tailwindcss ^4.2.1 -> ^4.2.2 (lockstep with the vite plugin) - @vitejs/plugin-vue ^5.2.4 -> ^6.0.7 (current major; 5.x also declares vite ^8) No vite.config.ts / tsconfig / Node changes needed (Node already >=22.12 in the nix shell, CI, and Dockerfile). vue-tsc, vite build, and prettier all pass.
Bumps [pypdf](https://github.com/py-pdf/pypdf) from 6.12.2 to 6.13.3. - [Release notes](https://github.com/py-pdf/pypdf/releases) - [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md) - [Commits](py-pdf/pypdf@6.12.2...6.13.3) --- updated-dependencies: - dependency-name: pypdf dependency-version: 6.13.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
fiji/fiji 'master' (the Fiji-Stable line) currently parents to pom-scijava 40.0.0, so this keeps the plugin aligned with the stable distribution while staying on Java 8 (no nix/CI toolchain change). Moves off 38.0.1: imglib2 6.3.0 -> 7.1.5, imagej2 2.15.0 -> 2.17.0, jackson 2.16.1 -> 2.18.0. Supersedes Dependabot #115 (38.0.1 -> 44.0.0), which would raise the build's Java floor from 8 to 11.
syntax_error_counter in LeaderDriven.run() was never reset, so it tracked cumulative ReAct syntax errors across a whole dialog and could abort a task after 3 scattered, fully-recovered errors. Reset it to 0 at the recovery send_correction (the single choke point where the agent_resp-is-None branch routes), matching the existing tool_retry_counter reset idiom. A model that is genuinely stuck still aborts after max_syntax_errors consecutive errors. Adds a regression test (test_leader_syntax_reset.py) covering both the cumulative-with-recovery case (now completes) and the 3-consecutive case (still aborts). Assisted-by: Claude-Code:GLM-5.2
00JackLu
reviewed
Jun 30, 2026
Introduce CIJ_PROXY: a single env var that proxies all backend downloads
(HuggingFace weights, LiteLLM model DB, BioImage model zoo, Tavily/DDGS
web research, cellpose/stardist segmentation weights) and acts as the
fallback proxy for the LLM/VLM clients when COPILOTJ_LLM_PROXY /
COPILOTJ_VLM_PROXY are unset.
The proxy is passed explicitly to each download client — no global proxy
env vars are set, so localhost services (Ollama, bridge WS, plugin API)
are never proxied. cellpose/stardist, which only read HTTP_PROXY, are
wrapped in the existing scoped temporary_proxy context manager for the
weight download only. Also fixes a latent bug where new_vlm_model_client
ignored cfg.vlm_proxy.
The resulting download clients receive Config explicitly rather than via
load_config() lookups: ddg_search / cellpose_segmentation /
stardist_segmentation become make_*(cfg) factories (cellpose/stardist via
functools.partial, which FunctionTool already supports), the model DB
download path threads an optional cfg from the server, and the HuggingFace
proxy is configured once at process startup.
Adds proxy unit tests (copilotj/test/{core,util}/test_proxy.py) and a
proxy_dict doctest, and documents CIJ_PROXY in .env.template, AGENTS.md,
and DEVELOPMENT.md.
functools.partial breaks FunctionTool's parameter introspection, so the LLM-visible schema for these tools was wrong. Use the same nested-def closure pattern as make_tavily_search / make_ddg_search: make_*(cfg) defines the inner tool function (closing over cfg) and returns it. The inner Annotated signatures are unchanged.
new_vlm_model_client now passes proxy=cfg.vlm_proxy or cfg.cij_proxy, so VLM prefers cij_proxy over llm_proxy. Update the test to assert the effective chain (vlm_proxy > cij_proxy > llm_proxy; llm_proxy remains a last-resort fallback via _new_model_client).
new_vlm_model_client passes allow_llm_proxy_fallback=False so _new_model_client does not fall back to cfg.llm_proxy on the VLM path. Effective VLM chain: vlm_proxy > cij_proxy. Update the test and the DEVELOPMENT.md config table to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a single
CIJ_PROXYenvironment variable that proxies all backend downloads and serves as the fallback proxy for the LLM/VLM clients.Before this, only the LLM/VLM API clients honored a proxy (
COPILOTJ_LLM_PROXY); every download path — HuggingFace weights, the LiteLLM model DB, the BioImage model zoo, Tavily/DuckDuckGo research, and cellpose/stardist segmentation weights — had no proxy support, so none worked behind a restricted network.What it covers
The proxy is passed explicitly to each download client — no global proxy env vars are set, so localhost services (Ollama at
127.0.0.1:11434, the bridge WebSocket, the plugin API) are never proxied:proxy = cfg.llm_proxy or cfg.cij_proxyhuggingface_hub.set_client_factory(...)(proxiedhttpx.Client), set once at startupaiohttpproxy=/urllibProxyHandlerTavilyClient(proxies=…)DDGS(proxy=…)requestssession.proxiestemporary_proxy(cfg)— these libs only readHTTP_PROXYcellpose/stardist have no explicit proxy parameter (raw
urlopen/urlretrieve), so they're wrapped in the existingtemporary_proxycontext manager for the duration of the weight download only, then restored. This is the single place env vars are touched, and it's scoped + reverted.Also fixes a latent bug where
new_vlm_model_clientignoredcfg.vlm_proxy.Explicit config injection (no
load_config()lookups)Following the "explicit over global" preference, the download clients receive
Configexplicitly rather than callingload_config():ddg_search,cellpose_segmentation,stardist_segmentation→make_*(cfg)factories (TOMLfunction→factory). cellpose/stardist usefunctools.partial(whichFunctionToolalready supports) to avoid re-indenting large functions; tool schemas are unchanged.download_db,get_model_capabilities,list_catalog_models,ensure_model_db_async) threads an optionalcfgfrom the server /resolve_vision_config/model_listing.server._ensure_kb,appose_worker.start_server,scripts/rag_builder.py), so theget_embeddingssingleton needs no cfg.load_config()now remains only at genuine process boundaries (__main__, the CLI/startup entry) and as a defensive(cfg or load_config())fallback in the rarely-hit model-DB cache-miss path.Verification
just test→ 166 passed (incl.test_agent_loaderconfirming thefactory =tools resolve with correct schemas,test_model_info/test_model_listingfor the cfg threading, and newtest_proxysuites).ruff check+formatclean across the package.copilotj/test/core/test_proxy.py,copilotj/test/util/test_proxy.py, plus aproxy_dictdoctest.Docs
CIJ_PROXYdocumented in.env.template,AGENTS.md(theCLAUDE.mdtarget), andDEVELOPMENT.md(config table +.env.localtemplate).