Skip to content

docs(openspec): fix plan #2559 cache key rule and gates - #3059

Merged
dan-petty merged 3 commits into
mainfrom
docs/2559-fix-plan
Nov 1, 2026
Merged

dan-petty merged 3 commits into
mainfrom
docs/2559-fix-plan

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

This change corrects the plan for #2559 in place.

An evaluation of the staging pull request #2997 found defects in the plan. The corrected plan does these things:

  • It orders the task groups by provider, so each group ends with a passing test suite.
  • It makes the cache key hash a per-call sampling value unless use_model_sampling is on. The old rule left a stale cache hit for Ollama and Claude with supports_reasoning.
  • It makes the seed rule read the same in the proposal, the design, the tasks and the spec.
  • It states the sampling gates in the spec, with scenarios for a reasoning model and for a Claude model without sampling support.

The change touches only the change folder of #2559. It changes no code and no test.

Plans #2559

Group the work by provider so every group ends green. Name the seed
gate, the cache-key rule and the fixed-signature test fakes. Record the
checks in Feasibility. Modify the two requirements that the change
alters and add three.
The cache key must hash a per-call value unless use_model_sampling is on.
Ollama and Claude still send sampling for a reasoning model.
The seed rule and the gate clause now read the same in all files.
@dan-petty dan-petty added type/docs Type docs: a change to the documents scope/openspec OpenSpec changes, specs and their checks labels Nov 1, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Changes to the plan

  • Task groups go provider by provider (commit e2ba6c1).
  • Cache key rule: a per-call temperature or top_p is hashed whenever use_model_sampling is off. Only the configured values keep the None for supports_reasoning. The design says why: the Ollama and Claude drivers still send sampling then. A driver that drops a value costs one extra miss and never a wrong hit.
  • Seed rule: proposal, design, tasks and spec now say the same. A caller seed joins the cache key unless use_model_sampling is on.
  • Task 2.1 adds a test: Ollama with supports_reasoning=True, temperature 0.1 then 0.9, sends two requests. Task 1.1 adds a test that a reasoning model sends none of the three.
  • The spec adds the requirement "Sampling gates win over per-call sampling" with two scenarios, and a cache scenario for Ollama with supports_reasoning. The proposal count of added requirements is now four.

Evaluation findings

Confirmed and fixed:

  • major: cache key nulls the per-call value for Ollama and Claude with supports_reasoning. Evidence: unified.py cache_opts nulls on supports_reasoning; ollama.py:297 gates only on use_model_sampling; claude.py:138 gates on capabilities, adaptive thinking and use_model_sampling.
  • minor: the seed cache rule differed between spec, design, tasks and proposal.
  • minor: the ADDED requirement had no gate clause.

Not confirmed: none. The first evaluation also found the group order; commit e2ba6c1 fixed it.

Verification

  • openspec validate 2559-llmclient-chat-takes-temperature-top-p --strict: valid.
  • uv run devops openspec check: passed.
  • uv run pytest tests/invariants/test_change_folders.py -n 0 -q: 17 passed.
  • Premise: a probe on origin/main 4fe2de2 shows chat(temperature=0.9, seed=7) sends temperature 0.1 and no seed, and chat(unknown_param=1) raises no error.
  • Not changed by this plan: the gen_ai.request.temperature span attribute reads the config, and the streamed paths take no per-call sampling.

@dan-petty
dan-petty marked this pull request as ready for review November 1, 2026 13:37
@dan-petty
dan-petty merged commit 3989b8d into main Nov 1, 2026
19 checks passed
@dan-petty
dan-petty deleted the docs/2559-fix-plan branch November 1, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/openspec OpenSpec changes, specs and their checks type/docs Type docs: a change to the documents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant