Skip to content

Commit 9561d61

Browse files
chernistryclaude
andcommitted
fix: add missing super().__init__() in all adapter subclasses
CLIAdapter.__init__ sets _resource_limits, but five subclasses overrode __init__ without calling super(), causing AttributeError when _get_preexec_fn() was invoked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 95ff2bf commit 9561d61

5 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/bernstein/adapters/caching_adapter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def __init__(
5353
*,
5454
correlator: CacheBreakCorrelator | None = None,
5555
) -> None:
56+
super().__init__()
5657
self._inner = inner_adapter
5758
self._caching_mgr = PromptCachingManager(workdir)
5859
self._cache_break_path = workdir / ".sdd" / "metrics" / "cache_breaks.jsonl"

src/bernstein/adapters/claude.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class ClaudeCodeAdapter(CLIAdapter):
126126
}
127127

128128
def __init__(self) -> None:
129+
super().__init__()
129130
# Timestamp until which the provider is assumed rate-limited.
130131
self._rate_limit_until: float = 0.0
131132
# Timestamp of last successful (non-rate-limited) probe, for caching.

src/bernstein/adapters/generic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(
3737
extra_args: list[str] | None = None,
3838
display_name: str = "Generic CLI",
3939
) -> None:
40+
super().__init__()
4041
self._cli_command = cli_command
4142
self._prompt_flag = prompt_flag
4243
self._model_flag = model_flag

src/bernstein/adapters/iac.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class IaCAdapter(CLIAdapter):
9090

9191
def __init__(self, *, tool: str | None = None) -> None:
9292
"""Force a specific tool, or None to auto-detect at spawn time."""
93+
super().__init__()
9394
if tool is not None and tool not in _TOOL_DEFS:
9495
msg = f"Unknown IaC tool {tool!r}. Supported: {', '.join(_TOOL_DEFS)}"
9596
raise ValueError(msg)

src/bernstein/adapters/ollama.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class OllamaAdapter(CLIAdapter):
6464
"""
6565

6666
def __init__(self, *, base_url: str = OLLAMA_BASE_URL) -> None:
67+
super().__init__()
6768
self._base_url = base_url
6869

6970
def _resolve_model(self, model_name: str) -> str:

0 commit comments

Comments
 (0)