pactkit-opencode 2.9.0__tar.gz → 2.9.1__tar.gz
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.
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/PKG-INFO +1 -1
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/pyproject.toml +1 -1
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode/deployer.py +9 -23
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/PKG-INFO +1 -1
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_story073_command_model_routing.py +7 -17
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/README.md +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/setup.cfg +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode/__init__.py +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/SOURCES.txt +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/dependency_links.txt +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/entry_points.txt +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/requires.txt +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/top_level.txt +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_bug035_opencode_dual_layer.py +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_deploy_opencode_parity.py +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_story069_opencode_format.py +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_story070_opencode_compliance.py +0 -0
- {pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_story071_opencode_config_parity.py +0 -0
|
@@ -297,33 +297,19 @@ class OpenCodeDeployer(DeployerBase):
|
|
|
297
297
|
config["instructions"] = existing
|
|
298
298
|
|
|
299
299
|
# OpenCode auto-discovers commands from commands/*.md directory.
|
|
300
|
-
# opencode.json "command"
|
|
301
|
-
#
|
|
300
|
+
# opencode.json "command" section requires BOTH "model" AND "template" fields.
|
|
301
|
+
# Since we don't control template content (it's inline prompt text, not a file path),
|
|
302
|
+
# we must NOT write model-only entries — they cause OpenCode validation errors.
|
|
303
|
+
# Clean up any PactKit-managed command entries that lack template.
|
|
302
304
|
cmd_config = config.get("command", {})
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
for k in stale_keys:
|
|
307
|
-
del cmd_config[k]
|
|
308
|
-
# Remove legacy "template" fields (was incorrectly treated as file path)
|
|
309
|
-
for cmd_name in list(cmd_config):
|
|
310
|
-
if cmd_name.startswith("project-") and "template" in cmd_config[cmd_name]:
|
|
311
|
-
del cmd_config[cmd_name]["template"]
|
|
312
|
-
# Remove entry entirely if only template was present
|
|
313
|
-
if not cmd_config[cmd_name]:
|
|
314
|
-
del cmd_config[cmd_name]
|
|
315
|
-
|
|
316
|
-
# Apply model routing
|
|
317
|
-
if command_models and providers:
|
|
318
|
-
for cmd_name, model_short in command_models.items():
|
|
319
|
-
model_id = OpenCodeDeployer._resolve_opencode_model_id(model_short, providers)
|
|
320
|
-
if model_id:
|
|
321
|
-
if cmd_name not in cmd_config:
|
|
322
|
-
cmd_config[cmd_name] = {}
|
|
323
|
-
cmd_config[cmd_name]["model"] = model_id
|
|
305
|
+
for cmd_name in list(cmd_config):
|
|
306
|
+
if cmd_name.startswith("project-") and "template" not in cmd_config[cmd_name]:
|
|
307
|
+
del cmd_config[cmd_name]
|
|
324
308
|
|
|
325
309
|
if cmd_config:
|
|
326
310
|
config["command"] = cmd_config
|
|
311
|
+
else:
|
|
312
|
+
config.pop("command", None)
|
|
327
313
|
|
|
328
314
|
content = json.dumps(config, indent=2, ensure_ascii=False) + "\n"
|
|
329
315
|
atomic_write(json_path, content)
|
{pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_story073_command_model_routing.py
RENAMED
|
@@ -40,26 +40,16 @@ class TestAC1CommandModel:
|
|
|
40
40
|
deploy(format="opencode", target=str(out))
|
|
41
41
|
return out
|
|
42
42
|
|
|
43
|
-
def
|
|
44
|
-
"""
|
|
43
|
+
def test_no_model_only_entries_in_opencode_json(self, tmp_path):
|
|
44
|
+
"""Model-only command entries must NOT be written — OpenCode requires both model AND template."""
|
|
45
45
|
out = self._deploy_with_providers(tmp_path)
|
|
46
46
|
data = json.loads((out / "opencode.json").read_text())
|
|
47
47
|
cmd_config = data.get("command", {})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"""project-done model routing is in opencode.json command section."""
|
|
54
|
-
out = self._deploy_with_providers(tmp_path)
|
|
55
|
-
data = json.loads((out / "opencode.json").read_text())
|
|
56
|
-
assert "project-done" in data.get("command", {})
|
|
57
|
-
|
|
58
|
-
def test_check_model_in_opencode_json(self, tmp_path):
|
|
59
|
-
"""project-check model routing is in opencode.json command section."""
|
|
60
|
-
out = self._deploy_with_providers(tmp_path)
|
|
61
|
-
data = json.loads((out / "opencode.json").read_text())
|
|
62
|
-
assert "project-check" in data.get("command", {})
|
|
48
|
+
for cmd_name, cmd_val in cmd_config.items():
|
|
49
|
+
if cmd_name.startswith("project-"):
|
|
50
|
+
assert "template" in cmd_val, (
|
|
51
|
+
f"command.{cmd_name} has model but no template — OpenCode validation will fail"
|
|
52
|
+
)
|
|
63
53
|
|
|
64
54
|
def test_frontmatter_has_no_model(self, tmp_path):
|
|
65
55
|
"""Command frontmatter should NOT contain model: (routing is in opencode.json)."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/requires.txt
RENAMED
|
File without changes
|
{pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/src/pactkit_opencode.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_story070_opencode_compliance.py
RENAMED
|
File without changes
|
{pactkit_opencode-2.9.0 → pactkit_opencode-2.9.1}/tests/test_story071_opencode_config_parity.py
RENAMED
|
File without changes
|