coderouter-cli 2.8.0__py3-none-any.whl → 2.8.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,15 +8,23 @@ from coderouter.adapters.anthropic_native import AnthropicAdapter
8
8
  from coderouter.adapters.base import BaseAdapter
9
9
  from coderouter.adapters.openai_compat import OpenAICompatAdapter
10
10
  from coderouter.config.schemas import ProviderConfig
11
+ from coderouter.logging import get_logger
11
12
 
12
13
  if TYPE_CHECKING:
13
14
  from coderouter.plugins.registry import PluginRegistry
14
15
 
16
+ logger = get_logger(__name__)
17
+
15
18
  # in-core kinds, in resolution order. Kept as a tuple (not derived from
16
19
  # the if-chain below) so the "Unknown adapter kind" error message and
17
20
  # the plugin-shadow guard have a single source of truth.
18
21
  _IN_CORE_KINDS: tuple[str, ...] = ("openai_compat", "anthropic", "agent_cli")
19
22
 
23
+ # Module-level flag so the Phase 2b in-core agent_cli deprecation warning
24
+ # (docs/designs/agent-cli-plugin-extraction.md §5.1) fires at most once per
25
+ # process, regardless of how many agent_cli providers are built.
26
+ _agent_cli_deprecation_logged = False
27
+
20
28
 
21
29
  def _plugin_kinds(plugin_registry: PluginRegistry | None) -> list[str]:
22
30
  """``kind`` values served by enabled adapter plugins, for error text."""
@@ -25,6 +33,36 @@ def _plugin_kinds(plugin_registry: PluginRegistry | None) -> list[str]:
25
33
  return [factory.kind for factory in plugin_registry.adapters]
26
34
 
27
35
 
36
+ def _warn_agent_cli_in_core_deprecated_once() -> None:
37
+ """Log ``agent-cli-in-core-deprecated`` once per process (§5.1).
38
+
39
+ Only called when the in-core ``agent_cli`` branch is taken AND an
40
+ adapter plugin has also registered a ``kind="agent_cli"`` factory —
41
+ i.e. the operator already has ``coderouter-plugin-agents`` installed
42
+ and enabled, but Core's in-core copy still wins resolution order
43
+ (§3.2) during the Phase 2b migration window. Nudges them toward the
44
+ plugin path ahead of its Phase 2c removal from Core.
45
+ """
46
+ global _agent_cli_deprecation_logged
47
+ if _agent_cli_deprecation_logged:
48
+ return
49
+ _agent_cli_deprecation_logged = True
50
+ logger.warning(
51
+ "agent-cli-in-core-deprecated",
52
+ extra={
53
+ "hint": (
54
+ "an 'agent_cli' adapter plugin is installed and enabled, "
55
+ "but Core's in-core agent_cli implementation still served "
56
+ "this request (in-core wins resolution during the Phase 2b "
57
+ "migration window). The in-core copy will be removed in "
58
+ "Phase 2c — no action is required yet, but new setups "
59
+ "should already be relying on the plugin path "
60
+ "(coderouter-plugin-agents)."
61
+ ),
62
+ },
63
+ )
64
+
65
+
28
66
  def build_adapter(
29
67
  provider: ProviderConfig,
30
68
  plugin_registry: PluginRegistry | None = None,
@@ -46,6 +84,10 @@ def build_adapter(
46
84
  # os plumbing) is only pulled in when a config actually uses it.
47
85
  from coderouter.adapters.agent_cli import AgentCliAdapter
48
86
 
87
+ if plugin_registry is not None and any(
88
+ factory.kind == "agent_cli" for factory in plugin_registry.adapters
89
+ ):
90
+ _warn_agent_cli_in_core_deprecated_once()
49
91
  return AgentCliAdapter(provider)
50
92
  if plugin_registry is not None:
51
93
  for factory in plugin_registry.adapters:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coderouter-cli
3
- Version: 2.8.0
3
+ Version: 2.8.1
4
4
  Summary: Local-first, free-first, fallback-built-in LLM router. Claude Code / OpenAI compatible.
5
5
  Project-URL: Homepage, https://github.com/zephel01/CodeRouter
6
6
  Project-URL: Repository, https://github.com/zephel01/CodeRouter
@@ -20,7 +20,7 @@ coderouter/adapters/agent_cli.py,sha256=0g0V92drEQLJACXq-Dn0hE-J6e3vmsuBr5UdnAkX
20
20
  coderouter/adapters/anthropic_native.py,sha256=CT9Hitun-c3z83YHT2zZXgwZpY3_t6eRnOfAmNud2aw,23610
21
21
  coderouter/adapters/base.py,sha256=ykKMaiIVVGr23oFFXilK2iP_YhI8-CtsEiJyFXaC9bE,10396
22
22
  coderouter/adapters/openai_compat.py,sha256=wcrd_UpV7N6ISpUyKvdFPGU-YjCrX5oMqGpjAFEeWfg,20356
23
- coderouter/adapters/registry.py,sha256=gvhKtoCPezCeSnNNz_4tpZoUerZGQHILEYNJ83d8W7s,2487
23
+ coderouter/adapters/registry.py,sha256=hwMhdBg-wurjJKa4MJIuDoMn1ClOOsorGppJ-s5pnF0,4311
24
24
  coderouter/config/__init__.py,sha256=FODEn74fN-qZnt4INPSHswqhOlEgpL6-_onxsitSx8g,274
25
25
  coderouter/config/capability_registry.py,sha256=RZgzHF54dXy0CCDocRCz2ee21qXGbbgTSKTkRI9iLL4,16936
26
26
  coderouter/config/env_file.py,sha256=CoMK27fuAXm-NtoLzXb8yN2E-wDFjHQuFwiIlmgTBQw,10356
@@ -69,8 +69,8 @@ coderouter/translation/__init__.py,sha256=PYXN7XVEwpG1uC8RLy6fvnGbzEZhhrEuUapH8I
69
69
  coderouter/translation/anthropic.py,sha256=aZkcYH4x82b0x7efJgJb9RWn9Hbyc9pEOthXe4vjUdU,11113
70
70
  coderouter/translation/convert.py,sha256=VV4kpu4dvLmGBmJfQnCLY5ryy_AnQcV2NuwjqRtaR8Q,52633
71
71
  coderouter/translation/tool_repair.py,sha256=DGOKArM53yfVbIfiAveoul1vGq9NEKmjagf43Qh4IkM,57630
72
- coderouter_cli-2.8.0.dist-info/METADATA,sha256=v_DJrJhY_mOdyE-dcIqR37OPgF-Ilv2bxG4H_p9kVEg,15546
73
- coderouter_cli-2.8.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
74
- coderouter_cli-2.8.0.dist-info/entry_points.txt,sha256=-dnLfD1YZ2WjH2zSdNCvlO65wYltM9bsHt9Fhg3yGss,51
75
- coderouter_cli-2.8.0.dist-info/licenses/LICENSE,sha256=wkEzoR86jFw33jvfOHjULqmkGEfxTFMgMaJnpR8mPRw,1065
76
- coderouter_cli-2.8.0.dist-info/RECORD,,
72
+ coderouter_cli-2.8.1.dist-info/METADATA,sha256=qRLxuyz0gjzAwHy4eSWMXl_E23g7fwG6AYuVonimdlg,15546
73
+ coderouter_cli-2.8.1.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
74
+ coderouter_cli-2.8.1.dist-info/entry_points.txt,sha256=-dnLfD1YZ2WjH2zSdNCvlO65wYltM9bsHt9Fhg3yGss,51
75
+ coderouter_cli-2.8.1.dist-info/licenses/LICENSE,sha256=wkEzoR86jFw33jvfOHjULqmkGEfxTFMgMaJnpR8mPRw,1065
76
+ coderouter_cli-2.8.1.dist-info/RECORD,,