Skip to content

fix(witan-core): stop calling a 503 refusal "could not connect" - #582

Merged
blarghmatey merged 1 commit into
mainfrom
fix/omnigraph-503-unavailable-wording
Nov 5, 2026
Merged

blarghmatey merged 1 commit into
mainfrom
fix/omnigraph-503-unavailable-wording

Conversation

@blarghmatey

Copy link
Copy Markdown
Member

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, StoreUnavailable always 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_answered in witan_core/omnigraph.py treats 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 75 as proof the server answered is from upstream v0.14.0: exit_for returns 75 only for effects: 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 or api_contract_mismatch and exits 1.
  • A read cut off mid-flight over HTTP has no status and keeps the "could not connect" wording. That is outside this change.
  • Failure classification is unchanged in both _classify_cli_error and omnigraph_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-core locally: 910 passed, 7 skipped, 1 failed. The failure is test_the_binary_on_path_is_the_declared_format, because the omnigraph on my PATH reads storage format 14.

https://claude.ai/code/session_01FGZebE9nnZy6bBL3eprDdQ

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
Copilot AI balanced review requested due to automatic review settings November 5, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@blarghmatey
blarghmatey merged commit 6ba0201 into main Nov 5, 2026
25 of 26 checks passed
@blarghmatey
blarghmatey deleted the fix/omnigraph-503-unavailable-wording branch November 5, 2026 16:57
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