Skip to content

Commit 9d128f5

Browse files
Kowserclaude
andcommitted
S5: delete AgentScheduleClient — no backward compatibility
User decision supersedes the deprecated-shim compromise: SchedulerClient is the ONE schedule client. Removed schedule_client.py, the conductor.ai.agents.schedule.client re-export shim, the ScheduleClient alias, and OrkesClients.get_agent_schedule_client(). Runtime and control-plane accessors now hand out get_scheduler_client() (same shared instance). Tests migrate to a SchedulerClient double; a removal guard keeps the symbols from creeping back. Gates: unit 2568 passed / 1 skipped; suite21 11/11 live vs :8085 on a bare OrkesSchedulerClient fixture; suite24 5/5 (1 flaky rerun). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8336627 commit 9d128f5

11 files changed

Lines changed: 113 additions & 212 deletions

File tree

e2e/test_suite21_scheduling.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
Schedule,
3333
ScheduleNameConflict,
3434
)
35-
from conductor.ai.agents.schedule.client import ScheduleClient
3635
from conductor.client.ai.schedule import _from_workflow_schedule
36+
from conductor.client.scheduler_client import SchedulerClient
3737

3838
pytestmark = [pytest.mark.e2e]
3939

@@ -125,15 +125,12 @@ def agent_name(conductor_clients) -> Iterator[str]:
125125

126126

127127
@pytest.fixture()
128-
def schedule_client(conductor_clients) -> ScheduleClient:
129-
return ScheduleClient(
130-
conductor_clients.get_scheduler_client(),
131-
conductor_clients.get_workflow_client(),
132-
)
128+
def schedule_client(conductor_clients) -> SchedulerClient:
129+
return conductor_clients.get_scheduler_client()
133130

134131

135132
@pytest.fixture(autouse=True)
136-
def clean_schedules(schedule_client: ScheduleClient, agent_name: str):
133+
def clean_schedules(schedule_client: SchedulerClient, agent_name: str):
137134
"""Purge any leftover schedules for this agent before each test."""
138135
schedule_client.reconcile(agent_name, [])
139136
yield

examples/agents/hello_world_schedule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ def main() -> None:
107107
# 1. Register the workflow that the schedule will fire.
108108
register_hello_world_workflow(agent_name)
109109

110-
# 2. Build the agent schedule client against the scheduler-enabled
110+
# 2. Build the scheduler client against the scheduler-enabled
111111
# Conductor instance.
112112
clients = OrkesClients(configuration=Configuration(base_url="http://localhost:8080"))
113-
sched_client = clients.get_agent_schedule_client()
113+
sched_client = clients.get_scheduler_client()
114114

115115
# 3. Declarative deploy: one schedule, fires every 2 seconds.
116116
# Quartz 6-field cron: 'sec min hour day month day-of-week'.

src/conductor/ai/agents/runtime/http_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,19 @@ def _workflow_client(self) -> Any:
203203

204204
@property
205205
def schedules(self) -> Any:
206-
"""Cron schedule lifecycle client (:class:`AgentScheduleClient`).
206+
"""Cron schedule lifecycle client (:class:`SchedulerClient`).
207207
208-
Exposes ``save/get/list_for_agent/pause/resume/delete/run_now/
209-
preview_next/reconcile``. When bound to a runtime, this is the
210-
*same* :class:`AgentScheduleClient` instance the runtime uses — there
211-
is one shared schedule surface, not two.
208+
Exposes ``get_schedule/save_schedule/get_all_schedules`` plus the
209+
lifecycle methods ``pause/resume/delete/run_now/preview_next/
210+
reconcile``. When bound to a runtime, this is the *same*
211+
:class:`SchedulerClient` instance the runtime uses — there is one
212+
shared schedule surface, not two.
212213
"""
213214
if self._runtime is not None:
214215
return self._runtime.schedules_client()
215216
if self._schedule_client_instance is None:
216217
self._schedule_client_instance = (
217-
self._get_orkes_clients().get_agent_schedule_client()
218+
self._get_orkes_clients().get_scheduler_client()
218219
)
219220
return self._schedule_client_instance
220221

src/conductor/ai/agents/runtime/runtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,13 +2231,13 @@ def client(self) -> Any:
22312231
return self._http
22322232

22332233
def schedules_client(self) -> Any:
2234-
"""Return the shared :class:`ScheduleClient` for this runtime.
2234+
"""Return the shared :class:`SchedulerClient` for this runtime.
22352235
22362236
Delegates to :attr:`client` so the runtime and the control-plane
22372237
client expose the *same* schedule surface (one instance, not two).
22382238
"""
22392239
if self._schedule_client_instance is None:
2240-
self._schedule_client_instance = self._clients.get_agent_schedule_client()
2240+
self._schedule_client_instance = self._clients.get_scheduler_client()
22412241
return self._schedule_client_instance
22422242

22432243
def _deploy_via_server(self, agent: Any, *, framework: Optional[str] = None) -> str:

src/conductor/ai/agents/schedule/client.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/conductor/client/ai/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"""Agent-facing clients and models for the Conductor SDK.
55
66
Canonical home of the ``/agent/*`` transport (:class:`AgentApiClient`), the
7-
agent cron-schedule client (:class:`AgentScheduleClient`), their models, and
8-
the agent exception hierarchy. Build the clients via
9-
``OrkesClients.get_agent_client()`` / ``get_agent_schedule_client()``.
7+
agent schedule models (:class:`Schedule`/:class:`ScheduleInfo`), and the agent
8+
exception hierarchy. Build the transport via ``OrkesClients.get_agent_client()``;
9+
the schedule lifecycle lives on ``OrkesClients.get_scheduler_client()``.
1010
1111
Everything here must stay importable without the ``[agents]`` extra and must
1212
not import ``conductor.ai`` (the agents authoring layer composes these
@@ -20,7 +20,6 @@
2020
AgentspanError,
2121
)
2222
from conductor.client.ai.schedule import Schedule, ScheduleInfo
23-
from conductor.client.ai.schedule_client import AgentScheduleClient, ScheduleClient
2423
from conductor.client.ai.schedule_errors import (
2524
InvalidCronExpression,
2625
ScheduleError,
@@ -32,11 +31,9 @@
3231
"AgentApiClient",
3332
"AgentAPIError",
3433
"AgentNotFoundError",
35-
"AgentScheduleClient",
3634
"AgentspanError",
3735
"InvalidCronExpression",
3836
"Schedule",
39-
"ScheduleClient",
4037
"ScheduleError",
4138
"ScheduleInfo",
4239
"ScheduleNameConflict",

src/conductor/client/ai/schedule.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
prefixed wire name plus server-computed fields like ``next_run``.
1010
1111
The private helpers below (payload mapping, wire-name prefixing, typed error
12-
translation) are shared by ``SchedulerClient``'s schedule-lifecycle methods,
13-
the module-level ``schedules.*`` API, and the deprecated ``AgentScheduleClient``
14-
shim. ``SchedulerClient``'s native ``get_schedule``/``save_schedule``/
15-
``get_all_schedules`` are the source of truth for reads/writes/lists; the
16-
``ScheduleInfo`` view exists for the module-level API.
12+
translation) are shared by ``SchedulerClient``'s schedule-lifecycle methods
13+
and the module-level ``schedules.*`` API. ``SchedulerClient``'s native
14+
``get_schedule``/``save_schedule``/``get_all_schedules`` are the source of
15+
truth for reads/writes/lists; the ``ScheduleInfo`` view exists for the
16+
module-level API.
1717
"""
1818

1919
from __future__ import annotations

src/conductor/client/ai/schedule_client.py

Lines changed: 0 additions & 134 deletions
This file was deleted.

src/conductor/client/orkes_clients.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,5 @@ def get_agent_client(self) -> "AgentApiClient": # noqa: F821
7777

7878
return AgentApiClient(self.configuration)
7979

80-
def get_agent_schedule_client(self) -> "AgentScheduleClient": # noqa: F821
81-
"""DEPRECATED — use :meth:`get_scheduler_client`; removal planned for the
82-
next major release.
83-
84-
``SchedulerClient`` now carries the schedule lifecycle itself
85-
(``pause``/``resume``/``delete``/``run_now``/``preview_next``/``reconcile``),
86-
with ``get_schedule``/``save_schedule``/``get_all_schedules`` as the
87-
source of truth for reads/writes/lists. This returns a pure delegation
88-
shim kept for backward compatibility.
89-
"""
90-
# Imported lazily: this module is on virtually every SDK program's import
91-
# path and must not grow import-time weight for the agent surface.
92-
from conductor.client.ai.schedule_client import AgentScheduleClient
93-
94-
return AgentScheduleClient(self.get_scheduler_client(), self.get_workflow_client())
95-
9680

9781
ConductorClients = OrkesClients

0 commit comments

Comments
 (0)