From 70d30571d52be66714d1b5cd67da49b9f2bf3752 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Sat, 25 Jul 2026 21:33:24 -0600 Subject: [PATCH] refactor(providers): tighten missing-model helper surface Drop has_cloud_model_request_mark from shared.py::__all__. Its only caller is is_cloud_model_not_found in the same module, and the repo has no star-imports from providers.shared, so exporting it added dead public surface without a consumer. Keep the chain-wide model-request marker, but document why it marks every exception in the chain: OpenHands _unwrap_provider_exception classifies __cause__ or __context__, so a mark on only the caught wrapper could be discarded before classification. Correct docs/design/openapi-client-contract.md for the RUNTIME_REASON_CODES line shift introduced by this branch. Validation record: the full make ci gate passed on the preceding tree with 15193 passed, 17 skipped, and Rust checks included. The two failures recorded in 270a13d11's message were subsequently attributed to an intermittent full-suite isolation issue with no causal path to this diff; those tests depend on observer-bundle temp-root hashing and speakers temp-journal route state, neither of which this branch touches. Co-Authored-By: Claude Opus 5 (1M context) --- docs/design/openapi-client-contract.md | 2 +- solstone/think/providers/shared.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/design/openapi-client-contract.md b/docs/design/openapi-client-contract.md index 0f3567607..1dd53ede3 100644 --- a/docs/design/openapi-client-contract.md +++ b/docs/design/openapi-client-contract.md @@ -130,7 +130,7 @@ global code that is not referenced by any operation is staleness only. Provider-readiness/runtime reason registries are separate string registries: `READINESS_REASON_CODES` and `REASON_CODES` live at `solstone/think/providers/state.py:33-47`, runtime codes live at -`solstone/think/providers/shared.py:213-225`, and readiness presentation lives +`solstone/think/providers/shared.py:250-269`, and readiness presentation lives at `solstone/convey/provider_readiness.py:83-299`. None of the 14 fragments should import those registries. diff --git a/solstone/think/providers/shared.py b/solstone/think/providers/shared.py index ac0bf4986..a9aed7e88 100644 --- a/solstone/think/providers/shared.py +++ b/solstone/think/providers/shared.py @@ -210,6 +210,8 @@ def _chain_has_status_code(exc: BaseException, code: int) -> bool: def mark_cloud_model_request(exc: BaseException) -> None: + # OpenHands may classify __cause__/__context__ via _unwrap_provider_exception, + # so marking only the caught wrapper would lose transport provenance. for item in exception_chain(exc): try: setattr(item, _CLOUD_MODEL_REQUEST_ATTR, True) @@ -724,7 +726,6 @@ __all__ = [ "classify_canned_generate", "classify_provider_error", "exception_chain", - "has_cloud_model_request_mark", "is_cloud_model_not_found", "mark_cloud_model_request", "safe_raw", -- 2.51.2