Skip to content

ci: run the OpenRouter live tests with the testing key only - #605

Merged
neuromechanist merged 2 commits into
developfrom
claude/serene-fermat-1obt9f
Oct 8, 2026
Merged

neuromechanist merged 2 commits into
developfrom
claude/serene-fermat-1obt9f

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The manual live-model job passes OPENROUTER_API_KEY_FOR_TESTING instead of the production OPENROUTER_API_KEY. A manual run can no longer spend the production OpenRouter credit.
  • tests/test_integration/test_llm.py reads only OPENROUTER_API_KEY_FOR_TESTING. It used to accept the production key too.
  • The job starts with a presence check. It names each live key that is missing, because a missing key makes its tests skip and a green run hides that. It also fails when ANTHROPIC_BASE_URL is set without ANTHROPIC_WORKSPACE_ID, which would otherwise stop the whole run at startup.
  • The model input now accepts any part of a test or model name. Entering openrouter runs only the OpenRouter-route tests.
  • The two live caching tests in tests/test_core/test_litellm_llm.py read the answer text with extract_text. On this route the reply arrives as a list of content blocks, which made the old .lower() assertion fail.

Testing

  • The workflow YAML parses. The presence-check step was run in three cases: nothing set (three warnings, exit 0), a base URL without a workspace ID (error, exit 1), and every key set to a placeholder (exit 0).
  • ruff check and ruff format --check pass on the changed test files.
  • With no key set, the OpenRouter live tests collect and skip (22 skipped).
  • Live job: run 37834516978 with openrouter as the model input. The live model step reports 16 passed, 0 failed.

Before merging

  • The repository secret OPENROUTER_API_KEY_FOR_TESTING must exist under that exact name. The presence check in run 37834516978 printed it as set.

The manual live-model job passed the production OpenRouter key. It now passes
OPENROUTER_API_KEY_FOR_TESTING, and test_llm.py reads only that key, so no live
test can spend the production credit.

The job starts with a presence check. It names each live key that is missing,
and it fails when ANTHROPIC_BASE_URL is set without ANTHROPIC_WORKSPACE_ID.
Entering openrouter as the model input limits a manual run to the OpenRouter
route.

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

Copy link
Copy Markdown
Member Author

Integration Tests failed on the manual run (run 37832679262, model=openrouter, head 39437c7).

  • The OpenRouter testing key works. 14 of the 16 selected tests passed. They cover the citation, tool-loop, streaming and usage tests on the OpenRouter route.
  • Two tests failed in tests/test_core/test_litellm_llm.py::TestOpenRouterLive: test_caching_wrapper_with_anthropic_model and test_async_invoke_with_caching. Both fail on response.content.lower() with 'list' object has no attribute 'lower'. The reply came back as a list of content blocks, and the assertion expects a string.

Why this is not this PR's failure: this PR does not touch test_litellm_llm.py or the reply path. Both tests use a legacy Anthropic slug that openrouter_model_id does not resolve, so the new temperature guard does not apply to them. The tool-binding and streaming tests in the same class pass on the same route.

Base status: on main these two tests were skipped. That job passed OPENROUTER_API_KEY and never OPENROUTER_API_KEY_FOR_TESTING, which these tests read. This run is the first time they executed. The main run from October 7 failed on nine image tests in test_anthropic_platform.py, a different failure.

No fix exists yet. Proposed patch, not included in this PR: add a helper that returns the reply text whether content is a string or a list of blocks, and use it in the two assertions. I would check it with one live call on the testing key before pushing.


Generated by Claude Code

The two live caching tests read response.content as a string. On the
OpenRouter route the reply arrived as a block list in CI, so the assertion
raised AttributeError. extract_text returns the answer text and drops
reasoning blocks, so the tests still check what the model said.

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

Copy link
Copy Markdown
Member Author

Fixed in 127a641. On this route the reply arrives as a list of content blocks, so the two live caching tests now read the answer text with extract_text.

The manual OpenRouter run is 37834516978. Its live model step passes: 16 passed, 0 failed.

The same job's network step reports two failures in tests/test_knowledge/test_bep_sync.py. Both are HTTP 404s from an upstream BIDS data URL, and this change does not touch that code.


Generated by Claude Code

@neuromechanist
neuromechanist merged commit cac1f0c into develop Oct 8, 2026
14 checks passed
@neuromechanist
neuromechanist deleted the claude/serene-fermat-1obt9f branch October 8, 2026 20:06
neuromechanist pushed a commit that referenced this pull request Oct 10, 2026
The integration-tests job runs by hand only since #605. Its credential step
warned about a missing key but passed, and each test module skips itself
without its key, so a run with no key set was green with every live test
skipped. It now fails in that case.

The rules files and the notebook-site-check comment still described the job
as running after a merge and skipping gracefully; they now say it is started
by hand and fails without a credential.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019MtQNfPzMpGxEJFUciXbTN
neuromechanist pushed a commit that referenced this pull request Oct 10, 2026
Retitles [Unreleased] to [0.8.18], as for earlier releases. Adds the entries
that were missing for #599 (hed-suggest in the image), #600 (HED prompt),
#601 (widget host styles) and #605 (live tests by hand), and one for the
DEFAULT_MODEL check at startup. Names the three classes that are accepted
(the other five are refused), and fixes a reference that pointed the wrong way.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019MtQNfPzMpGxEJFUciXbTN
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