Skip to content

Release 0.8.17: Luna retry and a clear unavailable-model message; tokens and cost under each reply - #585

Merged
neuromechanist merged 42 commits into
mainfrom
develop
Oct 7, 2026
Merged

neuromechanist merged 42 commits into
mainfrom
develop

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Promotes develop to main: a GPT-6 Luna stream that Bedrock cuts short is tried once more, a failed model is called unavailable, each reply shows what it used and cost, and NEMAR and NWB get small updates.

What reaches production

CHANGELOG.md has the full list under ## [0.8.17].

Compatibility

  • The event and response additions are optional fields: a widget or CLI from before this release ignores usage, and the new widget and CLI show nothing against an older server.
  • The widget's bytes change (frontend/osa-chat-widget.js), so its integrity hash changes with them. A page that pins the widget by hash (nemar.org) keeps the old widget, which works, but does not get the usage line until it is re-pinned.
  • A retry is a second model request for a stream cut short mid-reply, so a provider that cuts streams sees up to twice the requests for those. Failures before the response began are not retried, so an outage does not stack this on the clients' own retries.
  • The cost is the dashboard's estimate, not an invoice: cache writes are priced at the five-minute rate whatever ANTHROPIC_CACHE_TTL says, and the tokens of a call that failed and was tried again are not counted.
  • A retry that works is visible in the logs (Retrying ... and The second try ... succeeded) and not in the request metrics.
  • A stalled Bedrock stream is still bounded only by 120 s limits: the widget's own 120 s request timeout fires first (its banner says "Request timed out. Please try again.", and a reply that already had text also ends with "Connection timeout"), so a widget reader does not see the new message; an API client that waits longer than 120 s does, and the CLI's own 120 s read timeout ends at about the same moment, so it may show its own connection error. The widget's 60 s stall timer still never fires (issue Widget: STREAM_TIMEOUT_MS never fires, so a stalled stream is bounded only by the 120 s request timeout #564).

Outside the repo

Bedrock model invocation logging was turned on for the production account in us-east-2 (CloudWatch Logs group /osa/bedrock-invocations, 14 days, text delivery on) while investigating #578.
It is account-wide and stores full prompts and answers; delete-model-invocation-logging-configuration turns it off.

Issues

Closed by this merge:

Closes #578, closes #582.

Left open on purpose:

Review

Three rounds, as asked, each by four reviewers (code, error handling, tests, comments) on the Sonnet model; every finding was fixed or answered.

Version

src/version.py carries the .devN suffix. ensure-stable-version.yml strips it on main; it is not hand-bumped.

After merge

  • ensure-stable-version.yml sets 0.8.17 and tag-release.yml tags it
  • The v0.8.17 GitHub release is published, docker-build.yml moves latest, and production pulls it hourly
  • https://api.osc.earth/osa/health reports 0.8.17 after the hourly pull, and both AWS_BEARER_TOKEN_BEDROCK and ANTHROPIC_API_KEY are set on the production container, so Luna is reachable for HED, EEGLAB, BIDS and NWB
  • A question to a Luna community (for example NWB) answers, and its done event carries usage
  • The sync-worker-cors.yml run on main deployed the worker, and an NWB documentation preview can use the widget
  • The widget on the sites that embed it (nemar.org pins the integrity hash) is re-pinned to v0.8.17 with the SRI hash in the release notes (or scripts/widget-sri.py v0.8.17)
  • NEMAR's plot ranges are checked against dataset xx099905 on the dev deployment (NEMAR: a clearer notebook welcome and a curated first plot #577 left that open)
  • Production: every GPT-6 Luna request fails, so NWB, HED and BIDS return errors #578 and Show tokens, cache use and estimated cost after each reply #582 are closed
  • The Bedrock invocation logging above is kept or turned off, deliberately
  • sync-develop.yml opens its PR into develop; if it fails, follow the recovery notes at the top of that workflow

github-actions Bot and others added 14 commits October 1, 2026 10:32
…p-after-v0.8.16

chore: sync develop with main after v0.8.16
* Shorten the NEMAR notebook welcome and say where the code runs

Retitle the starter as a Python playground, state that code, edits and results stay
on the reader's machine while data streams in, name what eegprep-lean does and does
not do yet, and note that MNE does not install in this Pyodide 0.29.5 runtime.
Tested: starter, notebook-lock and notebook-site tests pass.

* Give NEMAR's spectra and ERP images a curated first plot

Set the PSD y-limits and the ERP image color range before drawing, sort ERP image
rows (by response time, or by response amplitude) and then smooth them, say how rows
are ordered and offer one other sort, and describe the structure a plot shows rather
than calling the recording noise. The first figure is the one an expert would expect.
Tested: NEMAR prompt, config and runtime tests pass; the plots themselves are not yet
checked against a live recording.

* Address PR review: scope the MNE claim, tighten the plot guidance

Notebook: say the latest MNE does not install (an older release does), use the
package's own name for eegprep-lean, define ERP and ICLabel where first used and
once only, and restore the setup cell's Ready instruction.
Prompt: log y-axis and a top limit that keeps named peaks, response_time read from
columns_summary in seconds with paired-copy length assert, the first response within
the epoch, 'order' instead of 'sort' to avoid the pinned events rule, an amplitude
ordering described as imposed structure, and no blanket ban on the word noise.
Tested: 943 Python tests, notebook/test-open.js and frontend/test-data-lane.js pass.
…s unavailable (#581)

* fix: classify urllib3 errors from a Bedrock stream as model failures

A Bedrock stream that stalled past the read timeout surfaced as urllib3's
ReadTimeoutError, which botocore lets out raw while iterating the response.
classify_model_error only knew botocore's class, so the failure was logged as an
unexpected error with no retryable field (issue 578). urllib3 timeouts and
protocol errors are now the model call's when they came up through botocore.

Tested: new cases drive the real Bedrock client with a staged stream that raises
mid-body; they fail without the change. test_model_errors.py passes.

* feat: retry a model call once when it fails fast before any output

Bedrock can end a stream almost at once with no messageStop event (GPT-6 Luna
did, issue 578) or answer a throttle; botocore does not retry once the response
has begun, so each reached the reader as an error. The ask and chat streams now
run the graph once more when the failure can clear by itself and fails fast,
and only while the reader has seen no text, tool call or tool result and no
model call has finished. A read timeout is not retried, since it has already
spent the whole timeout.

Tested: real graph and real Bedrock client with staged streams, on both
endpoints; the retry tests and the no-retry guards fail when the change or the
guard is removed. test_stream_failures.py and test_model_errors.py pass.

* feat: tell the reader their model is unavailable and to choose another

When a model call fails in a way that can clear by itself (throttle, stream cut
short, stall, dropped connection) and the retry did not help, the reader got
"An error occurred while processing your request." The error event now says
the current model is not available and asks them to choose another. There is no
automatic switch, which would change what a community chose and what a request
costs. Failures that are not a model call's (a tool of ours) keep the generic
text, and a refused request or credential keeps its own.

Tested: the provider-failure cases in test_stream_failures.py now assert the new
text on both endpoints, the generic text is still asserted for non-model
failures; 149 pass across test_stream_failures.py and test_model_errors.py.

* fix: bound the retry, skip throttles, and report that it happened

Review findings on the retry:
- retry only a failure that arrives within 10 s, so a slow failure does not
  double the reader's wait; wait a jittered second, not a fixed one
- retry only unavailable and connection failures; a throttle is already
  retried with backoff by the clients, and a second try only adds load
- match urllib3 errors only when they came up through langchain-aws, and name
  urllib3 in the detail so it is not confused with botocore's class
- treat a chunk it does not recognize as output, close the inner stream
  deterministically, and log a cancel during the wait
- log the first failure's type, kind and text, the chat session, and when the
  second try worked; a failure that survived a retry is logged at ERROR and its
  metrics detail says so
- correct docstrings the review found stale or inaccurate

Tested: new cases for the window, the throttle exclusion, a dropped connection,
the ERROR record, cancellation during the wait, and what counts as output; the
window and throttle cases fail when their change is removed. 524 pass across
the affected test files.

* docs: add the issue 578 changes to the changelog

* refactor: simplify the retry helper and share test fixtures

- the retry outcome is a required argument and the single record of whether a
  second try was made; the failure detail's retried flag has no default
- one traceback-frame check serves both _raised_in and _passed_through
- the wording branch reads as one conditional; trim docstrings that repeated
  each other
- tests: typed staged answers (a misspelled key now fails), shared CUT_SHORT and
  dropped/stalled stream errors, one real-client helper for the classifier
  tests, one retry-log filter, and the unrecognized-wording constant renamed to
  match its field

Tested: 1706 pass across test_stream_failures.py and tests/test_core; ruff
clean.

* test: cover the retry end to end on the paths the review found open

- a service error inside a Bedrock stream, OpenRouter 503, and an Anthropic
  overloaded error are answered by the second try; a throttle (in-stream and
  OpenRouter) is left alone, as decided
- the resume path sends the same request twice, carrying the browser's result,
  and labels the retry with its own endpoint
- a provider failure nobody recognizes is called unavailable and claims nothing
  about retrying; one that survives a retry is logged at ERROR
- each kind of output (a tool call alone, reasoning alone, a tool after a model
  that does not stream) ends the chance to retry
- a disconnect during the wait releases the session's turn and starts no second
  call; a urllib3 error through botocore alone is not the model's
- the retry log is found by its own field, and the unbounded-retry case fails
  fast instead of hanging

Tested: 1727 pass (11 skipped) across tests/test_core and test_stream_failures.py;
the langchain-aws requirement and the earlier guards fail when removed.

* fix: make the retry report write-only and true for the failure it labels

Type design review findings on RetryOutcome:
- the helper read its caller's out-parameter as control state, so an instance
  that was reused skipped the retry and logged a success that never happened;
  it now keeps its own local state and only writes the report
- the flag was sticky, so a later, unrelated failure in a run that had been
  retried was logged at ERROR as "after one retry"; it is now set only when the
  failure raised came from the second try before that try produced any output
- renamed RetryOutcome to RetryState (outcome collides with the model_outcome
  and turn_outcome modules) and its field to failed_after_retry
- tests: the classifier's tables are walked to keep kind and retryable
  consistent, and every kind is covered by the retry-policy cases; the wire
  helper's defaults are defined once and its docstring says its answers are
  indexed by transport request
- docstrings: worth_retrying_now reflowed and tied to retryable;
  _FailureWording says it holds the two messages that differ by stream

Tested: 1737 pass (11 skipped) across tests/test_core and test_stream_failures.py;
the reuse and per-failure label tests fail when their change is removed.
* feat: report tokens, cache use and estimated cost with each reply

The streams and the request metrics already count every request's tokens and
price them; the reader never saw any of it. The done event of /ask and /chat,
the tool_request event that ends a browser-execution run, and the responses to
requests that are not streamed now carry a usage object: input, output, cache
read and cache write tokens, and an estimated cost in USD from the price table.

It is null when the provider reported no usage (not a free reply) and for
models OSA does not offer itself, which leaves OpenRouter out for now.

Refs #582.

Tested: new tests drive the real streams and graph for Bedrock and Anthropic
through scripted adapter chunks, with the cost worked out by hand; the API tests
fail when the wiring is removed. tests/test_api (minus the known chat-resume
401s) and tests/test_metrics pass.

* feat: print what a reply used under it in the CLI

osa ask and osa chat, streamed and not, print one line under the answer from the
usage object the server now sends, for example
"1,240 in (980 cached), 310 out, about $0.0021". It goes to stderr, so stdout
stays the answer alone for a pipe, and is left out when the server sent none.
The wording is tested against a table shared with the widget.

Refs #582.

Tested: respx-staged streams and responses through the real client; the four
printing tests fail without the change. tests/test_cli passes (177).

* feat: show what a reply used and cost under it in the widget

The widget reads the usage object from a reply's done event and shows one line
under the reply, between its sources and the feedback buttons, for example
"1,240 in (980 cached), 310 out, about $0.0021". A reply that runs code in the
browser spans several runs: the earlier runs' usage is kept aside from their
tool_request events and added to the last run's on done, so the line appears
once the reply is whole and shows the sum. The message keeps it, so a reload
shows it again. The wording is tested against the table the CLI uses.

Refs #582.

Tested: unit cases for the line, the sum and the done reducer in
test-streaming.js (99); DOM cases in test-widget-paced-streaming.js for a
single run, no usage, and a two-run reply (266); the render fails the DOM test
when removed. Every other widget suite and the Python frontend guard tests pass.

* fix: a bad token count must not cost the reader the answer

The usage object is built inside the done event. A count a provider reported
badly would have raised there and ended the stream with an error, after the
answer was written. It now logs a warning and sends no usage, as
_extract_token_usage does for the metrics.

Refs #582.

Tested: a fractional token count, which pydantic rejects, gives no usage and one
warning. tests/test_api/test_reply_usage.py passes (16).

* fix: say when a reply's usage leaves a run out, and tighten what usage can be

Review findings on the usage display:
- a reply some of whose model runs reported no tokens showed the others' figures
  as its total. The server now sends partial, the widget notices a missing run
  on either side of a sum, and both the widget and the CLI say "at least"
- ReplyUsage refuses negative counts, a negative or non-finite cost, and cached
  tokens above the input (an adapter counting the way Anthropic's own API does)
  instead of showing a wrong figure; the failure is logged at WARNING with the
  counts and ids, and any other failure at ERROR
- the widget and the CLI print identical cost text for every whole micro-dollar
  from 0 to 3,000,000 (checked), where toFixed and Python's formatter rounded ties
  differently; ties and non-ties are rows of the shared table
- the widget shows usage from a response that is not streamed, keeps only the
  fields it reads from the server and from saved history, and reports an
  unreadable usage once on the console (the CLI at debug level)
- the tool_request contract (ToolRequestEvent, to_request_event) carries usage
- documented: usage is per run on a stream, null for OpenRouter-routed requests
  (pinned to the OpenRouter slugs), cache writes are priced at the five-minute
  rate, and a failed attempt's tokens are not counted

Refs #582.

Tested: 3440 Python tests pass in tests/test_api, test_metrics, test_cli,
test_core and test_frontend (19 chat-resume failures, identical on develop);
every widget suite passes (test-streaming 115, paced-streaming 278); the partial
and missing-first-run handling fail when removed.

* refactor: simplify the usage display and make the CLI as strict as the widget

- the router's three helpers take their counts by keyword and decide partial in
  one place; the non-streaming helper takes the request like its neighbors
- the widget cleans a usage once and draws from the clean object, with the
  console warning at the one place untrusted data enters (so it is a real path,
  not only a test hook); _runs is _usageRuns
- the CLI treats a negative count, and a negative or non-finite cost, the way the
  widget does (a NaN cost no longer crashes it after the answer is printed);
  the shared table gained rows that pin it
- both cost formatters use the same if/elif chain and digit arithmetic, and still
  print identical text for every whole micro-dollar from 0 to 3,000,000
- tests: shared serve and ask helpers, imports hoisted, the fixture row looked up
  by name

Refs #582.

Tested: 253 usage tests pass (API, metrics, CLI) and every widget suite passes
(test-streaming 121, paced-streaming 279); the Python and JS cost text was compared
across 3,000,001 values.

* test: pin the usage paths the coverage review found open

- cache reads and writes in their own fields on the ask stream, the chat stream,
  the tool_request event and both non-streaming responses (a swap of the two
  passed the suite), including the per-lifetime cache write the real Anthropic
  adapter reports
- /chat/resume run 2 reports its own usage, not run 1's added, through the real
  endpoints
- a reply that was tried again reports the second try's usage, with the cache
  fields the real Bedrock stream parser gives, and agrees with the request's row
  in the metrics
- the widget's own saved history round-trips usage, and a reply whose second run
  failed saves nothing kept aside between runs
- reply_usage keeps a run with only input or only output; the CLI is tested
  against a server that sends no usage key, and its batch paths against stdout
  and stderr separately; the test cost uses the module's cache multipliers

Refs #582.

Tested: 373 Python usage tests pass and every widget suite passes
(paced-streaming 283); five mutants (swapped cache fields in three places, the
zero gate, a saved-history leak) each fail a test.
…gins (#584)

The Unreleased section becomes 0.8.17, as the changelog's instructions say for a
release, with a new empty Unreleased above it. The NWB documentation preview
origins (#579) had no entry; they do now.

Not code: the changelog only. Tested: the changelog renders as before and
test_frontend_job_parity and the docs tests are unaffected.
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://develop-demo.osc.earth
Branch develop
Commit b1a1c69

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

neuromechanist and others added 2 commits October 6, 2026 18:54
…log outages as outages (#588)

* fix: retry only what came after the response began, and report outages as outages

Release review round 1 on #585:
- the retry covered a failure before the response began, which botocore and the
  Anthropic SDK had already retried with backoff, so an outage could cost four to
  six calls per request; ModelFailure now says mid_stream (an exception event
  inside a stream, a stream ended with no messageStop, a dropped connection, an
  error event in a 200 stream) and only those are retried
- a failure that was worth a retry and reached the reader anyway is logged at
  ERROR; it was a warning for a reply that had used a tool and an error for one
  that had not
- bad token counts log one line with no traceback; a price-table defect logs at
  ERROR; a throttle on the caller's own key says the key is rate limited
- the cancel log names the model, session and failure kind
- the cost line rounded up to a cent or a dollar kept one decimal too many
  ($0.0100, $1.000); both formatters now judge the tier after rounding, and still
  print identical text for every whole micro-dollar from 0 to 3,000,000
- print_error escapes its message, since a model name with a bracket raised
- tests: retried failures are staged as in-stream errors, with a control that the
  same failure with no output is retried, request counts for a refused Bedrock
  request, usage and partial after a retry, and a cancel test that waits for the
  retry instead of a fixed sleep

Refs #578, #582.

Tested: 3494 Python tests pass across test_api, test_metrics, test_cli, test_core
and test_frontend (the 19 chat-resume 401s fail identically on develop, and
tests/test_core/test_tagged_citations.py's reading-time test is flaky on develop
too); every widget suite passes.

* docs: make the 0.8.17 changelog match the code after review

Both old error strings, the mid-stream scope of the retry, which clients retry
throttles, one develop stall and not a production one, -o json, the NEMAR rule as
the prompt states it, and that the wording and retry are for streamed replies.

Not code: the changelog only.

* docs: say which readers see the stall message

The widget aborts its request at 120 s, which fires before Bedrock's 120 s read
timeout (counted from the last byte), so a widget reader sees Connection timeout
and an API or CLI client sees the unavailable message.

Not code: the changelog only.
It runs inside the handlers that report a failure, so an exception from it cut
the stream with no error event, log line or metrics row. An error it cannot read
is now unknown and the reason is logged. Also corrects the wording of three
comments about the httpx fork the Anthropic SDK depends on, and the throttle
reasoning in worth_retrying_now.

Tested: tests/test_core/test_model_errors.py (new TestItNeverRaises cases).
A failure that surfaced as the stream was closed (GeneratorExit at the yield)
started a second model call nobody would read. The retry helper now notes the
close and re-raises. Also spells canceling the American way in a test name.

Tested: new TestTheReaderClosesTheStream fails without the guard and passes with it.
…st both fail

A check on the whole object has no field, so its line read "(: ..."; it now says
"usage". Counts that also make the cost invalid are the provider's, so they log
at WARNING, and only a cost-only failure (a price table defect) logs at ERROR.

Tested: tests/test_api/test_reply_usage.py (TestWhatTheOperatorReads).
An outage before the response began, or a read that timed out, was a WARNING
while the same outage mid-stream was an ERROR, so an alert on ERROR saw only
some requests. Unavailable, connection and timeout failures from a provider are
now ERROR (without a traceback unless a retry would have covered it); throttles
and the caller's own refused key stay WARNING.

Tested: tests/test_api/test_stream_failures.py asserts the level per phase.
The CLI and the widget printed any finite cost; a corrupt figure (1e305) filled the
line. Both now treat a cost at or above one billion dollars as no cost. The CLI's
print_error and print_warning also accept a message that is not a string.

Tested: shared table row in tests/fixtures/usage_lines.json (Python and widget),
print_error(None) in tests/test_cli/test_main.py.
AbortSignal.timeout aborts with a TimeoutError, not the AbortError the widget
checked for, so a stalled request fell through to the generic failure text. Both
names now read as the request timeout, streamed and not streamed.

Tested: new block in frontend/test-widget-paced-streaming.js (287 checks pass).
Without the half-up step, 31 of the 3,000,001 whole micro-dollar values print
differently, and none was in the shared table. Adds rows for three of them and for
the edges at $0.0001, $0.01 and $1.

Tested: Python and widget suites; mutants without the half-up step and with the
under-$0.0001 edge moved fail both.
classify_model_error reads mid_stream from the error it found, not the wrapper;
no test would have noticed the wrapper being read instead.

Tested: the new case fails with the wrapper read and passes as written.
Tested: tests/test_api/test_reply_usage.py; the any-for-all mutant fails.
…lure tests

- log level and traceback of a failure that was worth a retry but came too late or
  after a tool, and of an OpenRouter outage before the response
- a community key's throttle is not called the reader's, and another failure on
  the reader's key is not called a throttle
- the cancel log names the session
- an Anthropic stream lost inside the SDK's own httpx is retried end to end
- every streamed turn has a 60 s deadline so a retry loop fails instead of
  hanging, and the cancel tests poll for 30 s
- botocore's backoff sleep is skipped (the file ran 29 s and now runs about 10 s;
  the requests are still made and counted)

Tested: tests/test_api/test_stream_failures.py, 121 pass; each new assertion fails
against a mutant of the code it guards.
Outage logging at ERROR in every phase, the widget's own request timeout, the
CLI and cost hardening, the classifier that cannot raise, and the stream the
reader closes. Docs only; the code and tests are in the commits before it.
neuromechanist and others added 15 commits October 6, 2026 19:41
…try a canceled task

A failure that landed as the reader closed the stream was re-raised into a task nobody
awaits, so the only trace was asyncio's "Task exception was never retrieved" with no
request context; the helper now logs it with the endpoint, model, request and session.
A task canceled while the model's stream is open can end in the stream's own failure
in place of the CancelledError; the helper treated that as an ordinary failure and
retried. It now checks the task's cancelling() count as well as the close.

Tested: two new tests in TestTheReaderClosesTheStream; each fails without its guard.
… error once

One unreadable link (a wrapper whose __str__ raises) aborted the walk, so a readable
cause behind it (a throttle) came out unknown. A failure to say where a failure came
from discarded a known kind. The handlers that each classify one failure also logged an
unclassifiable one once each; it is now logged once per exception. Adds exception_text,
str() with a placeholder, for the log lines that report a failure. Also states that the
errors OpenRouter raises in a stream carry no status, instead of "never" marked.

Tested: tests/test_core/test_model_errors.py; the dedupe and the per-link isolation each
fail a test without them.
…ep a traceback

The docstring's colon list named the cases that get a traceback but read as examples of
the exception, omitted the caller's-key throttle wording, and ended in a ragged line;
after_retry keeps the traceback rather than raising the level, and the comment above
needs_traceback described the level. Comments only.
A __str__ that raises dropped the logging module's line (it prints "--- Logging error
---" and moves on), leaving the reader's error id matching nothing, and cut the stream in
the ValueError branches that put str(e) in the message. The failure line and those
messages now carry exception_text.

Tested: new test in tests/test_api/test_stream_failures.py; fails with the raw error in
the line.
data.get("message", default) keeps an explicit null, so the CLI printed "Error: None".
Also lets the error and warning printers take a message that is not a string.

Tested: two new stream tests in tests/test_cli/test_main.py; both fail with the old
fallback.
Tested: tests/test_cli (the config reset test reads the message).
The comment said Python's integer arithmetic could not take a larger cost, which is not
so; the cutoff keeps the CLI and the widget printing the same digits. Comment only.
… languages

Only a 1e305 row covered the cutoff, so moving it by one step passed. Rows for just under
it and for exactly it.

Tested: a <= mutant fails the Python and the widget suite.
…the browser

Only a TypeError that mentions "fetch" was taken for a network failure, so Safari's
"Load failed" and "The network connection was lost." and Chrome's "network error"
(a body read cut short) reached the banner as the browsers worded them. A TypeError that
matches the known wordings now reads "Network error. Please check your connection."; other
TypeErrors and errors of other kinds keep their text. Also states in the timeout helper's
comment only what is known: the widget aborts a request only by its own timeout.

Tested: new block in frontend/test-widget-paced-streaming.js (295 checks pass); the old
fetch-only check and a check that ignores the error's kind each fail it.
The earlier-warning sentence was wrong (an outage was always a warning before this
release); what the widget shows for its own timeout is the banner, plus "Connection
timeout" only on a reply that had text; the CLI's own 120 s timeout may win; a cost at or
above one billion is dropped; the OpenRouter boundary of the retry; the null CLI message,
the network wording and the cancel guard; the NWB origins are exact in the community's
cors_origins while the worker admits the suffix. Docs only.
…e, tidy test text

The Anthropic SDK depends on the published httpx2 package (anthropic 1.6.0 requires
httpx2>=2.0), which the comments called a vendored copy or a fork. A 503 or 500 answer
before the response is an error answer, not a refusal (a refusal is a 4xx the request
caused). The OpenRouter 5xx test said the client's own retries cover it, which its own
request count contradicts; the redundant 30 s wait_for in one test goes, since every
streamed turn has a deadline. Comments, test names and ids only.

Tested: the four touched test files, 246 pass.
The "Retrying ..." warning put the raw error in the log line, so an error whose __str__
raises dropped it (and, under a handler that raises, ended the stream instead of
retrying). It now uses exception_text, as the failure line does. Also drops a check in
the outage test that the kinds it names already imply.

Tested: new test in the next commit.
- botocore's retry of a refused request is asserted to exist, not only to equal itself
- a connection that could not be made is an outage (ERROR)
- a second failure of another kind after a retry is an ERROR with its traceback
- the retry line and the ValueError branches survive an error that cannot print
- the CLI's null message fallback for all four stream paths
- a failure the classifier can name but not place keeps its kind and is not retried
- the widget's network wording is anchored
- the close stand-in's docstring says what it is for

Tested: each new test fails against a mutant of the code it guards; 455 pass in the
touched Python files and 296 widget checks pass.
…7-review-2

Release 0.8.17 review, rounds 2 and 3: outages at ERROR in every phase, widget timeout and network text, test gaps
@neuromechanist
neuromechanist merged commit 26252b4 into main Oct 7, 2026
29 checks passed

This branch was previously deployed

1 inactive deployment
testpypi — b197dde8 Deployed Oct 7, 2026 by neuromechanist via Publish to TestPyPI #154
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.

Show tokens, cache use and estimated cost after each reply Production: every GPT-6 Luna request fails, so NWB, HED and BIDS return errors

2 participants