Skip to content

feat: model classes, Haiku 5.5 and Haiku for NWB, EEGLAB, BIDS, NEMAR - #604

Merged
neuromechanist merged 8 commits into
developfrom
feature/model-classes
Oct 8, 2026
Merged

neuromechanist merged 8 commits into
developfrom
feature/model-classes

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Model classes (ADR 0016), and the first move under them: Claude Haiku 4.5 becomes Claude Haiku 5.5, and communities name a class instead of a version.

  • MODEL_CLASSES in src/core/services/anthropic_models.py names each tier (haiku, sonnet, opus, fable for Anthropic; luna, terra, sol, astra for OpenAI) and the model it is today. A class is accepted wherever a model is named: a community's default_model, an agent's model, a request, the CLI and DEFAULT_MODEL.
  • NWB, EEGLAB and BIDS now default to the haiku class. They were GPT-6 Luna on Amazon Bedrock. NEMAR now defaults to haiku; it was Claude Sonnet 5.5.
  • HED, MNE, FieldTrip, OpenNeuroPET and MetaBCI already named Haiku. MetaBCI is unchanged in this PR.
  • The live-model tests run only from a manual workflow run. The integration job in test.yml now runs on workflow_dispatch only, with a model input (all, haiku, sonnet, luna) and the Bedrock key. It no longer runs on push to main. The PR test job in tests.yml also excludes llm-marked tests.

Review

Three review lenses ran on 61cac45: code correctness, silent failures and test coverage. Fixed in e8e2e05 and 36b4884:

  • A request that names the community's default another way (a class, an offered id or a legacy alias) is the default, not a custom model. On OpenRouter it no longer needs a key of the caller's own.
  • A retired Claude slug default, such as anthropic/claude-haiku-4.5, runs the current model, as the config endpoint reports it.
  • OpenRouter no longer sends temperature to a model that refuses it (Haiku 5.5, Sonnet 5.5, Luna). The sampling models keep it. The FAQ fallback agents no longer set 0.0 and 0.1 on Haiku 5.5, and their comments no longer claim the scoring is deterministic.
  • An unoffered DEFAULT_MODEL now stops startup. Before, a typo changed the model family of the Bedrock fallback without a word.
  • A retired variable named only in .env is reported, as one in the environment already was.
  • A saved settings value that is not an object is treated as corrupt, not as a storage failure (widget).

Declined, with reasons:

  • The config endpoint keeps contextlib.suppress(ValueError). It is there for OpenRouter slugs, and config load already warns about an id that is neither offered nor a slug.
  • The config endpoint's OpenRouter probe stays silent by design (log=False). The request path logs the same fallback at ERROR.
  • Config-time warnings stay warnings.warn, because existing tests assert pytest.warns.
  • Variant slugs in the cost table and the coarse FAQ failure reason are follow-ups.

Testing

  • Full CI unit selection (-m "not integration and not llm and not network"): 5190 passed, 10 skipped, 0 failed.
  • Widget settings suite (frontend/test-widget-settings.js): 184 passed. The new case for a non-object saved value fails on the previous widget.
  • ruff check . and ruff format --check . are clean.
  • Not run here: the live model tests, which make paid calls. They run from the new manual workflow.

Before merging

  • The manual live-model run needs the repository secret AWS_BEARER_TOKEN_BEDROCK. The Anthropic and OpenRouter secrets are needed too, if those cases should run.
  • A DEFAULT_MODEL that is not an offered model now stops startup. Check the value before deploying.
  • NEMAR's figures come through nemar_render_overview as image blocks, which GPT-6 Luna cannot take, so NEMAR cannot move to Luna. Haiku 5.5's image handling is not verified against the live API here. Check NEMAR's figures after the deploy.

neuromechanist and others added 8 commits October 8, 2026 00:02
MODEL_CLASSES in anthropic_models.py is the one place a model generation is chosen.
A class name works wherever a model is named; the ids a class used to be still
resolve. Registry, levels, thinking, pricing, slugs, the FAQ models, the widget's
copies and the tests key off the class's id, not a literal.

Claude Haiku 5.5 thinks adaptively at an effort level (no token budget), turns
thinking off with disabled, rejects temperature, and is priced by prompt length
($0.10/$0.50 to 100k tokens, $0.50/$2.50 above). The budget-thinking path is
removed. The config endpoint reports the id a class resolves to. Communities name
haiku, sonnet or luna; EEGLAB's FAQ agents lose their temperature lines.

Tested: full suite (5172 passed; the 19 known test_chat_resume_endpoint failures
are unchanged from develop), ruff, all widget tests with bun. Not run against the
live Claude Platform.
Records the decision, the Haiku 5.5 behavior changes and what was not measured. Documentation only.
NWB, EEGLAB and BIDS named GPT-6 Luna on Amazon Bedrock, and NEMAR named
Claude Sonnet 5.5. All four now name the haiku class, which is Claude Haiku
5.5 today. metabci is unchanged.

The comments that described the old defaults are updated in the community
configs, .env.example, the Dockerfile, the model pricing comment and the
CHANGELOG. The Bedrock key is no longer needed for any shipped community's
default, only for a reader who picks a Bedrock model from the menu.

Tests: no shipped community defaults to Luna now, so the Luna routing test
gives Luna to each community that sets high. The shipped-default
parametrization names the new classes.

Claude-Session: https://claude.ai/code/session_01QGLYRKyTuTjzGbVydofSCC
Co-Authored-By: Claude <[email protected]>
The integration job ran on every push to main, and its only gate was
ANTHROPIC_API_KEY. It never received the Bedrock key. It now runs only on
workflow_dispatch, so the paid calls to the Claude Platform, OpenRouter and
Amazon Bedrock stay out of regular CI. The network tests in the same job
also run only when triggered by hand.

The new model input takes "all" (the default) or a part of a model id such
as haiku, sonnet or luna. It is passed to pytest -k. AWS_BEARER_TOKEN_BEDROCK
is passed to the job, and each test module skips itself when its own
credential is missing.

Claude-Session: https://claude.ai/code/session_01QGLYRKyTuTjzGbVydofSCC
Co-Authored-By: Claude <[email protected]>
No shipped community defaults to a Bedrock model now, so the tests of the
Bedrock default give NWB GPT-6 Luna for their own run, through
name_luna_as_the_default in tests/helpers/deployment.py. monkeypatch undoes
it. The startup-check test names it before the app starts, and the NEMAR
routing test pins a Claude model at high rather than the Sonnet id, since
NEMAR now runs Haiku.

Claude-Session: https://claude.ai/code/session_01QGLYRKyTuTjzGbVydofSCC
Co-Authored-By: Claude <[email protected]>
The pull-request job ran every test that is not marked network, which
included the llm-marked live OpenRouter test. It skips without its key today,
but live model calls belong only to the manual live-model workflow.

Claude-Session: https://claude.ai/code/session_01QGLYRKyTuTjzGbVydofSCC
Co-Authored-By: Claude <[email protected]>
Routing: a request that names the community's default another way (a class,
an offered id or a legacy alias) is the default, not a custom model, so it
needs no key of the caller's own. A retired Claude slug default such as
anthropic/claude-haiku-4.5 runs the model its class is today, as the config
endpoint reports it, rather than the retired slug.

Temperature: a model that refuses one (Haiku 5.5, Sonnet 5.5, Luna) is sent
none on OpenRouter, as the Anthropic path already did. The FAQ fallback agents
no longer set 0.0 and 0.1 on a model that refuses them, and their comments no
longer claim a determinism that is not there. The sampling models keep it.

Config: an unoffered DEFAULT_MODEL refuses startup, instead of silently
changing the model family of the Bedrock fallback. A retired variable named
only in .env is reported, as one in the environment already was.

Tests: class names in a BYOK OpenRouter request, the same-model comparison,
a retired slug default, a slug default reported as written, the shipped
community defaults pinned by name, and the settings checks above.

Claude-Session: https://claude.ai/code/session_01QGLYRKyTuTjzGbVydofSCC
Co-Authored-By: Claude <[email protected]>
…torage failure

loadUserSettings read fields of the parsed value, so a saved null threw a
TypeError. The outer catch then reported "Cannot access browser storage", and
the bad value stayed in storage to repeat on every load. A value that parses
to a non-object is now removed and reported as corrupt, as unparseable JSON
already was. The widget settings suite has a case for it, which fails on the
previous widget.

Claude-Session: https://claude.ai/code/session_01QGLYRKyTuTjzGbVydofSCC
Co-Authored-By: Claude <[email protected]>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://feature-model-classes-demo.osc.earth
Branch feature/model-classes
Commit f9956ea

This preview will be updated automatically when you push new commits.

neuromechanist commented Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

PR review summary (commit 61cac45)

Review of commit 61cac45 across three lenses: code correctness, silent failures and test coverage. Every finding was checked against the code before any change. Fixes are in e8e2e05 (Python) and 36b4884 (widget).

Code correctness

Finding Confidence Disposition
OpenRouter forwards temperature to models that refuse it (ADR 0016) 88 Fixed in e8e2e05. Offered models that refuse a temperature get none; the sampling models keep it.
The requested model is compared with the default as raw strings, so a class or alias request got a 403 on OpenRouter 85 Fixed in e8e2e05. The two are compared by the model each name resolves to.

Also checked and clean: the model normalization and retired-id tables, the 100,000-token cost boundary, the thinking and effort paths on the Anthropic route, no mocks added, and CHANGELOG entries present. The import-order errors (ruff I001) one lens reported did not reproduce: ruff check . passes.

Silent failures

Severity Finding Disposition
Critical A bad DEFAULT_MODEL fell back silently on the Bedrock path Fixed in e8e2e05. An unoffered value now stops startup.
Critical The config endpoint suppresses the error for an unknown default_model Declined. It is intentional for OpenRouter slugs, and config load already warns about an id that is neither offered nor a slug.
Critical The FAQ fallback sent 0.0 and 0.1 to a model that refuses them. The drop was silent, and the comment claimed determinism Fixed in e8e2e05. The fallback sends no temperature, and the comment is corrected.
High The OpenRouter path never applied the temperature rule Fixed in e8e2e05, with the first code finding.
High The widget reported a corrupt saved setting as a storage failure Fixed in 36b4884. A regression case in the widget suite fails on the previous widget.
High The config probe's fallback to the OpenRouter default is silent Declined. The probe is a dry run (log=False), and the request path logs the fallback at ERROR. Follow-up: surface it in the config endpoint.
Medium Retired variables were checked only in the process environment, not in .env Fixed in e8e2e05, with a test.
Medium The cost fallback for variant slugs, and a warning without request IDs Follow-up. The warning already includes the model ID.
Medium The FAQ scoring failure reason is generic Declined. The error is logged with its traceback.
Medium max is silently clamped to high for non-default models Unchanged. This is by design (ADR 0015).
Medium Config-time problems use warnings.warn, not the logger Declined. Existing tests assert pytest.warns.

Also checked: no silent except blocks in the new Anthropic, model-table or base code. The widget's model tables match the backend.

Tests

Rating Gap Disposition
8 A retired slug default ran the retired model on OpenRouter, and the tests pinned it Fixed in e8e2e05. Retired slugs map to the current class's slug, and the two pins are updated.
6 No test named a class in a request Fixed in e8e2e05.
6 Only three of nine shipped defaults were pinned Fixed in e8e2e05. All nine are pinned by name.
5 The config endpoint's slug-default branch was untested Fixed in e8e2e05.
4 The temperature branch in create_anthropic_llm is unreachable for offered models, and untested Follow-up.
3 Some tests check constants against themselves, or re-derive labels Partly fixed: a no-op self-assignment is removed. The rest is follow-up.

No new mocks or patches were added. The new monkeypatch overrides change real configuration rather than replacing components.

Result

Full CI unit selection: 5190 passed, 0 failed. Widget settings suite: 184 passed. ruff check . and ruff format --check . are clean. The live model tests were not run here, since they make paid calls.

@neuromechanist
neuromechanist merged commit 6dc45e6 into develop Oct 8, 2026
11 checks passed
@neuromechanist
neuromechanist deleted the feature/model-classes branch October 8, 2026 19:01
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