From f82525a70e390dc07eac06dde323f3d79a067e18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 04:43:51 +0000 Subject: [PATCH 1/2] Initial plan From 416b8d487045bb057dc8c85bcf566d3aede7dac7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 04:49:11 +0000 Subject: [PATCH 2/2] fix: add regression test for devcontainer-lock.json JSON validity --- tests/unit/test_devcontainer_json.py | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/unit/test_devcontainer_json.py diff --git a/tests/unit/test_devcontainer_json.py b/tests/unit/test_devcontainer_json.py new file mode 100644 index 000000000..a434e2d8b --- /dev/null +++ b/tests/unit/test_devcontainer_json.py @@ -0,0 +1,43 @@ +"""Regression test: .devcontainer JSON files must be valid JSON. + +Guard against a past failure where a stray closing brace was appended to +devcontainer-lock.json, causing the devcontainers CLI to abort with: + SyntaxError: Unexpected non-whitespace character after JSON at position 2143 + +See: GitHub Actions run 29139965422, job 86511118286. +""" + +from __future__ import annotations + +import json +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[2] +DEVCONTAINER_DIR = REPO_ROOT / ".devcontainer" + + +def test_devcontainer_json_is_valid(): + path = DEVCONTAINER_DIR / "devcontainer.json" + assert path.exists(), f"{path} not found" + try: + json.loads(path.read_text(encoding="utf-8")) + except json.JSONDecodeError as exc: + raise AssertionError(f"devcontainer.json is invalid JSON: {exc}") from exc + + +def test_devcontainer_lock_json_is_valid(): + path = DEVCONTAINER_DIR / "devcontainer-lock.json" + assert path.exists(), f"{path} not found" + try: + json.loads(path.read_text(encoding="utf-8")) + except json.JSONDecodeError as exc: + raise AssertionError( + f"devcontainer-lock.json is invalid JSON: {exc}\n" + "Hint: check for a stray closing brace or bracket at the end of the file." + ) from exc + + +def test_devcontainer_lock_json_has_features_key(): + path = DEVCONTAINER_DIR / "devcontainer-lock.json" + data = json.loads(path.read_text(encoding="utf-8")) + assert "features" in data, "devcontainer-lock.json missing top-level 'features' key"