Repository navigation
fix(witan-core): stop calling a 503 refusal "could not connect" - #582
Merged
Merged
Conversation
StoreUnavailable always said witan "could not connect", including when the server answered every attempt with a 503 (an omnigraph 0.14 CLI exit 75, or the pooled transport's status). That sends an operator to the network when the problem is server state, e.g. a restart or a graph still loading. This words the message by whether the last attempt reached a server. At omnigraph v0.14.0 a data command exits 75 only for a refusal the server sent (command_outcome.rs exit_for); a connect failure exits 1. Claude-Session: https://claude.ai/code/session_01FGZebE9nnZy6bBL3eprDdQ
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the diagnostic-wording change.
No open issues 🎉
What changed in this PR
This PR improves witan-core’s StoreUnavailable diagnostics by distinguishing server refusals from connection failures when the retry budget is exhausted. Retry behavior and failure classification remain unchanged.
Changes:
- Selects error wording based on whether the last attempt received a server response.
- Adds four regression tests covering CLI and HTTP refusals, plus connection failures.
- Documents the diagnostic change in a changelog fragment.
| File | Description |
|---|---|
packages/witan-core/witan_core/omnigraph.py |
Detects server responses and updates the exhausted-retry message. |
packages/witan-core/tests/test_omnigraph.py |
Tests refusal and connection-failure wording across CLI and HTTP paths. |
packages/witan-core/changelog.d/20261105_090207_blarghmatey_omnigraph_503_unavailable_wording.md |
Records the improved unavailable-store diagnostics. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
witan task
tk-an-omnigraph-exit-75-503-raises-storeunavailable-dd7ce2, found by the independent review of #573.Description (What does it do?)
When a remote call exhausts the unavailable retry budget,
StoreUnavailablealways said witan "could not connect", including when the server answered every attempt with a 503. That sends an operator to the network when the problem is server state (a restart, a graph still loading). This words the message by whether the last attempt reached a server: "<url>answered but kept refusing it as unavailable" vs. "could not connect to<url>".Implementation details
_server_answeredinwitan_core/omnigraph.pytreats an attempt as answered when the pooled HTTP transport recorded a status, when the CLI exited 75, or when the error carries one of the 0.13 not-yet-serving wordings (_GRAPH_NOT_YET_SERVING, which 0.13 reports with exit 1).exit_forreturns 75 only foreffects: none, action: retry, which a data command gets from a server-served disposition or a server admission refusal. A connect or discovery failure carries no code orapi_contract_mismatchand exits 1._classify_cli_errorandomnigraph_http.py, so this does not overlap the 0.14 dispositions rework.How can this be tested?
just test-witan-core -k "'exhausted'"runs the four new tests: CLI exit 75 with a 503, a 0.13 loading-graph refusal, an HTTP 503 through_retry_loop, and a CLI connect failure.just test-witan-corelocally: 910 passed, 7 skipped, 1 failed. The failure istest_the_binary_on_path_is_the_declared_format, because the omnigraph on my PATH reads storage format 14.https://claude.ai/code/session_01FGZebE9nnZy6bBL3eprDdQ