Should opencode's context/output limits be generated from litellm-config.yaml, or hand-maintained? #28
Notifications
Due Date
No due date set.
Blocks
Depends on
#29 Point opencode's provider block at litellm.home with a virtual key
haylan/LLM-Server
Reference: haylan/LLM-Server#28
Reference in New Issue
Block a user
Part of #26
Question
opencode's `limit.context`/`limit.output` (in the `qwen3.8-27b-local`
provider block of `opencode.json`) are bookkeeping-only hints with no
server-side enforcement or runtime auto-discovery (confirmed in
`docs/research/opencode-cli-setup.md` §5). They need to track this repo's
own `LLAMA_CTX_SIZE` (`.env.example`, currently 65536) and litellm's
`max_tokens` (`litellm-config.yaml`, currently 16384) or they'll silently
drift whenever those change.
Decide: does this repo close that gap with its own tooling, and if so how?
Options to weigh (not exhaustive):
that reads `.env`/`litellm-config.yaml` and writes/patches the relevant
block of `opencode.json`, run manually or folded into `scripts/update.sh`.
the other, checked by eye) — no new tooling.
Depends on: what #27 (How does opencode's auto-compact actually work) finds
about the actual config surface — if compaction has its own separate knob
beyond `limit.context`/`limit.output`, that knob needs the same treatment.
If a generator script is chosen, this ticket's resolution should also
settle: where opencode.json lives that gets written (this session's
`~/.config/opencode/opencode.json` has no provider block yet — is the
target the project-local `opencode.json` instead, checked into this repo?)
and the exact source-of-truth values to pull (env var vs. parsed YAML).
Decided in practice, not via a generator script: opencode's
limit.context/limit.outputare hand-set in~/.config/opencode/opencode.json(65536/16384, matching what's currently live), with an inline comment flagging that they must be bumped by hand whenLLAMA_CTX_SIZE/litellm'smax_tokenschange — no automated sync built. Rationale: this stack's config changes are infrequent and already require a manualupdate.shrun on the server, so a generator script would be new code tracking a low-frequency drift risk; a comment pointing at the source of truth is enough.