Skip to content

💫 Toolkit to help you get started with SDD or any other process!

fix: correct nullable resolved directory annotation (#3771)

Marsel Safina482fb2fce42
diff --git a/src/specify_cli/agents.py b/src/specify_cli/agents.py
index a998f3992..a7f40a7ef 100644
--- a/src/specify_cli/agents.py
+++ b/src/specify_cli/agents.py
@@ -599,7 +599,7 @@ class CommandRegistrar:
source_dir: Path,
project_root: Path,
context_note: Optional[str] = None,
- _resolved_dir: Path = None,
+ _resolved_dir: Optional[Path] = None,
link_outputs: bool = False,
extension_id: Optional[str] = None,
) -> List[str]:
diff --git a/tests/test_agent_config_consistency.py b/tests/test_agent_config_consistency.py
index 6c20011c6..0ccaf99aa 100644
--- a/tests/test_agent_config_consistency.py
+++ b/tests/test_agent_config_consistency.py
@@ -2,10 +2,12 @@
import re
from pathlib import Path
+from typing import get_args, get_type_hints
import yaml
from specify_cli import AGENT_CONFIG
+from specify_cli.agents import CommandRegistrar as AgentCommandRegistrar
from specify_cli.extensions import CommandRegistrar
REPO_ROOT = Path(__file__).resolve().parent.parent
@@ -104,6 +106,14 @@ def _supported_agent_names_from_agent_request_template() -> list[str]:
class TestAgentConfigConsistency:
"""Ensure agent configuration stays synchronized across key surfaces."""
+ def test_register_commands_resolved_dir_annotation_accepts_none(self):
+ """The internal resolved-directory override defaults to None."""
+ resolved_dir_type = get_type_hints(
+ AgentCommandRegistrar.register_commands
+ )["_resolved_dir"]
+
+ assert type(None) in get_args(resolved_dir_type)
+
def test_issue_template_agent_lists_match_runtime_integrations(self):
"""GitHub issue templates should list all concrete built-in agents."""
concrete_agent_keys = set(AGENT_CONFIG) - {"generic"}