Skip to content

fix: propagate configured temperature through reflect calls - #3828

Open
koriyoshi2041 wants to merge 1 commit into
vectorize-io:mainfrom
koriyoshi2041:fix/reflect-temperature
Open

fix: propagate configured temperature through reflect calls#3828
koriyoshi2041 wants to merge 1 commit into
vectorize-io:mainfrom
koriyoshi2041:fix/reflect-temperature

Conversation

@koriyoshi2041

Copy link
Copy Markdown
Contributor

Problem

HINDSIGHT_API_LLM_TEMPERATURE_REFLECT is resolved by configuration but reflect requests omit it, so providers apply their defaults. This affects tool turns, final synthesis, structured extraction, and over-budget rewrites.

Closes #3825.

Fix

Forward llm_temperature_reflect through every reflect LLM call path. Add deterministic coverage for the tool loop, rewrite, and structured-output paths.

Test

  • uv run pytest tests/test_reflect_agent.py::TestReflectStructuredOutput::test_structured_output_forwards_reflect_temperature tests/test_reflect_agent.py::TestReflectAgentMocked::test_done_tool_answer_respects_max_tokens -q (2 passed)
  • uv run ruff check hindsight_api/engine/reflect/agent.py tests/test_reflect_agent.py
  • uv run ruff format --check hindsight_api/engine/reflect/agent.py tests/test_reflect_agent.py
  • git diff --check

The full reflect-agent file also passed 45 tests; four environment-dependent tests could not start because the local checkout lacks pg0-embedded and provider credentials. The repository-wide lint wrapper reached unrelated TypeScript linting and stopped because workspace npm dependencies were not installed.

Risk

Low. The provider interfaces already accept optional temperature values, and the default remains None, preserving existing provider-default behavior when the setting is unset.

@strix-security

strix-security Bot commented Aug 27, 2026

Copy link
Copy Markdown

Strix Security Review

No security issues found.

Updated for 11128e2.


Reviewed by Strix
Re-run review · Configure security review settings

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.

Reflect ignores HINDSIGHT_API_LLM_TEMPERATURE_REFLECT: no temperature sent on reflect or mental-model refresh LLM calls

1 participant