Skip to content

AI Assistant: work with Claude Haiku 5.5 (no temperature 0, eyes keep working) - #121

Merged
nvladimus merged 4 commits into
mesoSPIM:release/candidate-py312from
thomdehoog:agent/haiku-pr
Oct 9, 2026
Merged

nvladimus merged 4 commits into
mesoSPIM:release/candidate-py312from
thomdehoog:agent/haiku-pr

Conversation

@thomdehoog

Copy link
Copy Markdown

Two small fixes to the AI Assistant, found by running it with claude-haiku-5-5 as the model. Both are in mesoSPIM/src/ai_assistant/ (assistant.py, config.py) and change nothing else; they follow #120.

1. No temperature 0 for a model that refuses it. Haiku 5.5 answers a request with temperature: 0 with a 400, "temperature is deprecated for this model", so with Haiku chosen the very first message failed. The agent and the eyes now take their settings from model_settings(endpoint): temperature 0 as before, except for the models listed in config.MODELS_WITHOUT_TEMPERATURE (matched anywhere in the model name; Haiku 5.5 today), which get the model's own default.

2. The eyes drop an answer's thinking with its frame. The eyes keep their history short by removing an old frame's image from the turn that carried it (detach_old_frames). Anthropic signs a model's thinking block for the exact turn it saw, so once that turn had changed, every later eyes request was refused: "Invalid signature in thinking block ... bound to a different conversation". In a benchmark 42 of 69 looks lost their description this way. The answer that follows a stripped frame now loses its thinking block as well; its text stays.

Validation

  • Against the Anthropic API: Haiku 5.5 accepts a request with no temperature and one with temperature 1, and refuses temperature 0. After the second fix, look, ask, look all answer.
  • Each fix has an offline test on the fork's dev branch (agent/schedule-display, mesoSPIM/test/ai_assistant/test_assistant.py: test_a_model_that_refuses_temperature_zero_is_sent_none, test_an_answer_loses_its_thinking_with_its_frame), and each test fails without its fix.
  • On this branch: python -m py_compile on both files, and QT_QPA_PLATFORM=offscreen python mesoSPIM/test/remote_control/run.py pyqt passes (10 passed).

Please give it a check in demo mode, and on the microscope with Haiku 5.5 chosen as the model: one question, one look, a second question, a second look.

🤖 Generated with Claude Code

https://claude.ai/code/session_01J2m2maCdWtVBtqdqaQi5xV

claude added 4 commits October 9, 2026 13:49
Haiku 5.5 answers temperature 0 with a 400 ("`temperature` is deprecated
for this model"), so with it chosen the first message failed. The agent
and the eyes now take their settings from model_settings(endpoint):
temperature 0, except for the models in MODELS_WITHOUT_TEMPERATURE, which
get their own default. Checked against the API: Haiku 5.5 accepts no
temperature and temperature 1, and refuses 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RH8VsZbnUgYcVt3KuXjNFk
With Haiku 5.5 as the eyes, every request after the first look failed:
"Invalid `signature` in `thinking` block. The block is bound to a
different conversation". Anthropic signs a thinking block for the turn it
saw, and detach_old_frames takes the frame out of that turn. In the
benchmark 42 of 69 looks lost their description this way. Now the answer
after a stripped frame loses its thinking too; its text stays. Checked
against the API: look, ask, look all answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RH8VsZbnUgYcVt3KuXjNFk
Anthropic refuses a tool property name outside ^[a-zA-Z0-9_.-]{1,64}$. In
the Full tool set set_camera, set_etl, set_laser_timing and set_state's
settings carry Core's own names with a percent sign ("camera_delay_%"),
so with Haiku 5.5 every turn in the Full tool set failed with a 400
before the model answered. The assistant now offers those arguments as
"..._pct" and gives the call back to the command under its own name, at
any depth. Remote Control, its TCP and MCP clients and Core are
unchanged. The three Full-set cases that failed on Haiku now pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RH8VsZbnUgYcVt3KuXjNFk
Anthropic signs a thinking block for all that came before it and refuses
the request when any of that has changed ("Invalid `signature` in
`thinking` block. The block is bound to a different conversation"). The
memory changes as a turn starts: an older turn is compacted (its readout
shortened, a long tool result cut, an answered challenge removed) or
trimmed off. With Haiku 5.5 a session therefore died on its fourth
message. From the first changed message on, the replies now lose their
thinking and keep their text and calls; the turn in progress keeps the
thinking its tool calls need, since nothing changes within a turn.
Checked live: a seven-message session, and the two memory cases that
failed, run through.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RH8VsZbnUgYcVt3KuXjNFk
@nvladimus
nvladimus merged commit b152c91 into mesoSPIM:release/candidate-py312 Oct 9, 2026
1 check passed
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.

3 participants