refactor(codex): name progress delta capability semantically

Use a provider capability name that describes user-visible progress delta support instead of the runner implementation detail.

Made-with: Cursor
This commit is contained in:
Xubin Ren 2026-04-27 10:46:49 +00:00 committed by Xubin Ren
parent ae14142a87
commit fdfecd3ba6
5 changed files with 7 additions and 7 deletions

View File

@ -612,7 +612,7 @@ class AgentRunner:
wants_progress_streaming = (
not wants_streaming
and spec.progress_callback is not None
and getattr(self.provider, "stream_progress_via_chat_stream", False) is True
and getattr(self.provider, "supports_progress_deltas", False) is True
)
if wants_streaming:

View File

@ -91,7 +91,7 @@ _SYNTHETIC_USER_CONTENT = "(conversation continued)"
class LLMProvider(ABC):
"""Base class for LLM providers."""
stream_progress_via_chat_stream = False
supports_progress_deltas = False
_CHAT_RETRY_DELAYS = (1, 2, 4)
_PERSISTENT_MAX_DELAY = 60

View File

@ -26,7 +26,7 @@ DEFAULT_ORIGINATOR = "nanobot"
class OpenAICodexProvider(LLMProvider):
"""Use Codex OAuth to call the Responses API."""
stream_progress_via_chat_stream = True
supports_progress_deltas = True
def __init__(self, default_model: str = "openai-codex/gpt-5.1-codex"):
super().__init__(api_key=None, api_base=None)

View File

@ -137,7 +137,7 @@ class TestToolEventProgress:
"""Providers that opt in can stream content deltas through _progress messages."""
bus = MessageBus()
provider = MagicMock()
provider.stream_progress_via_chat_stream = True
provider.supports_progress_deltas = True
provider.get_default_model.return_value = "openai-codex/gpt-5.5"
async def chat_stream_with_retry(*, on_content_delta, **kwargs):
@ -175,7 +175,7 @@ class TestToolEventProgress:
) -> None:
"""If content was already streamed as progress, tool setup should not repeat it."""
loop = _make_loop(tmp_path)
loop.provider.stream_progress_via_chat_stream = True
loop.provider.supports_progress_deltas = True
tool_call = ToolCallRequest(id="call1", name="custom_tool", arguments={"path": "foo.txt"})
calls = iter([
LLMResponse(content="I will inspect it.", tool_calls=[tool_call]),

View File

@ -43,7 +43,7 @@ def test_explicit_provider_import_still_works(monkeypatch) -> None:
assert "nanobot.providers.anthropic_provider" in sys.modules
def test_openai_codex_opts_into_progress_streaming() -> None:
def test_openai_codex_supports_progress_deltas() -> None:
from nanobot.providers.openai_codex_provider import OpenAICodexProvider
assert OpenAICodexProvider.stream_progress_via_chat_stream is True
assert OpenAICodexProvider.supports_progress_deltas is True