Skip to content

Commit 6e430bc

Browse files
authored
feat: remove models.yaml (#38)
1 parent 7c08651 commit 6e430bc

File tree

7 files changed

+9
-129
lines changed

7 files changed

+9
-129
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ The CLI is designed to be discoverable and production-ready. Run `pitaya --help`
136136
Highlights
137137

138138
- Strategy: `--strategy <name>` (use `-S key=value` for strategy params)
139-
- Model: `--model <alias>` (aliases resolved via `models.yaml` when applicable)
139+
- Model: `--model <name>`
140140
- Plugin: `--plugin <claude-code|codex>`
141141
- Parallel runs: `--runs <N>`
142142
- TUI controls: `--no-tui`, `--output <streaming|json|quiet>`
@@ -195,7 +195,7 @@ CLI overrides config; `-S` only affects the selected strategy.
195195

196196
## Models
197197

198-
Some plugins (e.g., Claude Code) validate model aliases via `models.yaml`. If an alias isn’t defined, Pitaya warns and passes the string through to the plugin.
198+
Plugins accept model identifiers as provided. Claude Code commonly uses `sonnet`, `haiku`, or `opus`; OpenAI‑compatible providers accept their own model IDs. No `models.yaml` mapping is used.
199199

200200
## Docker & Plugins
201201

@@ -234,7 +234,7 @@ Some plugins (e.g., Claude Code) validate model aliases via `models.yaml`. If an
234234

235235
- Cannot connect to Docker: start Docker Desktop / system service; run `docker info`
236236
- Missing credentials: set `CLAUDE_CODE_OAUTH_TOKEN` or `ANTHROPIC_API_KEY` (Claude), or `OPENAI_API_KEY` (Codex)
237-
- Model alias not found: add it to `models.yaml` or pass a direct model ID
237+
- Model not recognized by the agent: pass a valid model ID for your provider
238238
- Slow or flaky network: use `--parallel conservative` or `--max-parallel <n>`
239239
- Clean stale state: `pitaya --prune` and `pitaya --clean-containers <run_id>`
240240

models.yaml

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

src/cli.py

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def create_parser(cls) -> argparse.ArgumentParser:
144144
"--model",
145145
type=str,
146146
default="sonnet",
147-
help="Model name/alias (plugin-agnostic; see models.yaml)",
147+
help="Model name (plugin-agnostic)",
148148
)
149149
g_model.add_argument(
150150
"--plugin",
@@ -1753,23 +1753,7 @@ def _red(k, v):
17531753
except Exception:
17541754
pass
17551755

1756-
# Optional models.yaml drift note: only when alias missing/mismatch
1757-
try:
1758-
from .utils.model_mapping import load_model_mapping
1759-
1760-
mapping, checksum = load_model_mapping()
1761-
alias = full_config.get("model")
1762-
if alias:
1763-
if alias not in mapping:
1764-
self.console.print(
1765-
f"[yellow]models.yaml: alias '{alias}' not found (checksum {checksum[:8]}). Using alias as-is.[/yellow]"
1766-
)
1767-
elif mapping.get(alias) != alias:
1768-
self.console.print(
1769-
f"[dim]models.yaml drift: checksum {checksum[:8]}{alias} -> {mapping.get(alias)}[/dim]"
1770-
)
1771-
except Exception:
1772-
pass
1756+
# models.yaml alias mapping removed; no drift checks
17731757

17741758
# Validate merged configuration; render compact error table on invalid
17751759
if not self._validate_full_config(full_config, args):
@@ -2803,14 +2787,7 @@ def info_line(title: str, msg: str):
28032787
)
28042788
except Exception:
28052789
pass
2806-
# models.yaml
2807-
try:
2808-
from .utils.model_mapping import load_model_mapping
2809-
2810-
mapping, cs = load_model_mapping()
2811-
pass_line("models.yaml", f"checksum {cs[:8]}")
2812-
except Exception as e:
2813-
info_line("models.yaml", f"warn: {e}")
2790+
# models.yaml checks removed
28142791
# SELinux / WSL2 hints
28152792
try:
28162793
import platform

src/instance_runner/api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ async def run_instance(
5151
session_group_key: Optional[str] = None,
5252
network_egress: Optional[str] = None,
5353
max_turns: Optional[int] = None,
54-
model_mapping_checksum: Optional[str] = None,
5554
allow_overwrite_protected_refs: bool = False,
5655
allow_global_session_volume: bool = False,
5756
agent_cli_args: Optional[list[str]] = None,
@@ -130,7 +129,6 @@ async def run_instance(
130129
skip_empty_import=skip_empty_import,
131130
network_egress=network_egress,
132131
max_turns=max_turns,
133-
model_mapping_checksum=model_mapping_checksum,
134132
allow_overwrite_protected_refs=allow_overwrite_protected_refs,
135133
allow_global_session_volume=allow_global_session_volume,
136134
agent_cli_args=agent_cli_args,

src/instance_runner/runner.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ async def run_instance(
100100
skip_empty_import: bool = True,
101101
network_egress: Optional[str] = None,
102102
max_turns: Optional[int] = None,
103-
model_mapping_checksum: Optional[str] = None,
104103
allow_overwrite_protected_refs: bool = False,
105104
allow_global_session_volume: bool = False,
106105
agent_cli_args: Optional[list[str]] = None,
@@ -161,36 +160,9 @@ async def run_instance(
161160
# Use plugin's default image if not specified
162161
if docker_image is None:
163162
docker_image = plugin.docker_image
164-
# Defensive model validation and resolution (via models.yaml mapping)
165-
# For non-validated plugins, allow passthrough model ids to the plugin.
163+
# Model IDs are passed through as provided; no models.yaml enforcement.
164+
# Plugins can interpret model identifiers as they see fit.
166165
resolved_model_id = model
167-
try:
168-
from ..utils.model_mapping import load_model_mapping
169-
170-
mapping, _checksum = load_model_mapping()
171-
# Optional handshake: ensure checksum matches orchestrator's view
172-
if model_mapping_checksum and _checksum != model_mapping_checksum:
173-
raise ValidationError(
174-
"models.yaml checksum mismatch between orchestration and runner"
175-
)
176-
allowed_models = set(mapping.keys())
177-
if model in allowed_models:
178-
resolved_model_id = mapping.get(model, model)
179-
else:
180-
# Only enforce strict validation for plugins that require mapping
181-
if getattr(plugin, "name", "claude-code") == "claude-code":
182-
raise ValidationError(
183-
f"Unknown model: {model}. Allowed: {sorted(allowed_models)}"
184-
)
185-
# For other plugins, keep original model (passthrough)
186-
except Exception:
187-
# Fallback strictness only for plugins that require mapping
188-
if getattr(plugin, "name", "claude-code") == "claude-code":
189-
allowed_models = {"sonnet", "opus", "haiku"}
190-
if model not in allowed_models:
191-
raise ValidationError(
192-
f"Unknown model: {model}. Allowed: {sorted(allowed_models)}"
193-
)
194166

195167
# Validate plugin environment
196168
# Convert AuthConfig to dict for plugin

src/orchestration/orchestrator.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,7 @@ def __init__(
110110
self.force_commit: bool = bool(force_commit)
111111
# Whether operator explicitly set max_parallel (override guards/policies)
112112
self._explicit_max_parallel = bool(explicit_max_parallel)
113-
# Load model mapping checksum for handshake (single-process still validates equality)
114-
try:
115-
from ..utils.model_mapping import load_model_mapping
116-
117-
_map, _cs = load_model_mapping()
118-
self._models_checksum = _cs
119-
except Exception:
120-
self._models_checksum = None
113+
# models.yaml mapping removed; no checksum handshake
121114

122115
# Log auth config for debugging
123116
if self.auth_config:
@@ -1763,7 +1756,6 @@ def _write_last_active():
17631756
reuse_container=bool(
17641757
(info.metadata or {}).get("reuse_container", True)
17651758
),
1766-
model_mapping_checksum=self._models_checksum,
17671759
allow_overwrite_protected_refs=self.allow_overwrite_protected_refs,
17681760
allow_global_session_volume=self.allow_global_session_volume,
17691761
agent_cli_args=(info.metadata or {}).get("agent_cli_args"),

src/utils/model_mapping.py

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

0 commit comments

Comments
 (0)