Skip to content

chore: remove dead OLLAMA_NUM_CTX / args.ollama_num_ctx assignment#2888

Merged
danielaskdd merged 1 commit intoHKUDS:mainfrom
jwchmodx:chore/remove-dead-ollama-num-ctx-arg
Apr 3, 2026
Merged

chore: remove dead OLLAMA_NUM_CTX / args.ollama_num_ctx assignment#2888
danielaskdd merged 1 commit intoHKUDS:mainfrom
jwchmodx:chore/remove-dead-ollama-num-ctx-arg

Conversation

@jwchmodx
Copy link
Copy Markdown
Contributor

@jwchmodx jwchmodx commented Apr 3, 2026

Summary

config.py line 360 reads the OLLAMA_NUM_CTX environment variable and stores it in args.ollama_num_ctx, but that attribute is never read anywhere else in the codebase:

# Ollama ctx_num
args.ollama_num_ctx = get_env_value("OLLAMA_NUM_CTX", 32768, int)

The actual Ollama context-window size is handled entirely by the typed BindingOptions system:

Option class Env var CLI arg
OllamaLLMOptions OLLAMA_LLM_NUM_CTX --ollama-llm-num_ctx
OllamaEmbeddingOptions OLLAMA_EMBEDDING_NUM_CTX --ollama-embedding-num_ctx

env.example and the API READMEs already document the correct names (OLLAMA_LLM_NUM_CTX / OLLAMA_EMBEDDING_NUM_CTX). The dead OLLAMA_NUM_CTX assignment just creates confusion for anyone tracing why that variable has no effect.

Tests

317 passed, 34 skipped

`args.ollama_num_ctx` is written from the `OLLAMA_NUM_CTX` environment
variable but is never read anywhere in the codebase.  The actual Ollama
context-window size is controlled via the typed binding-options system:
`OllamaLLMOptions` reads `OLLAMA_LLM_NUM_CTX` and `OllamaEmbeddingOptions`
reads `OLLAMA_EMBEDDING_NUM_CTX`, both via their `add_args()` / `options_dict()`
methods.

Removing the two dead lines prevents confusion for anyone who traces the
`OLLAMA_NUM_CTX` name and wonders why it has no effect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@danielaskdd
Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielaskdd danielaskdd merged commit 981de3d into HKUDS:main Apr 3, 2026
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.

2 participants