Skip to content

Commit a482fb2

Browse files
marcelsafinCopilot
andauthored
fix: correct nullable resolved directory annotation (#3771)
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 05cb3cb commit a482fb2

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/specify_cli/agents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def register_commands(
599599
source_dir: Path,
600600
project_root: Path,
601601
context_note: Optional[str] = None,
602-
_resolved_dir: Path = None,
602+
_resolved_dir: Optional[Path] = None,
603603
link_outputs: bool = False,
604604
extension_id: Optional[str] = None,
605605
) -> List[str]:

tests/test_agent_config_consistency.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import re
44
from pathlib import Path
5+
from typing import get_args, get_type_hints
56

67
import yaml
78

89
from specify_cli import AGENT_CONFIG
10+
from specify_cli.agents import CommandRegistrar as AgentCommandRegistrar
911
from specify_cli.extensions import CommandRegistrar
1012

1113
REPO_ROOT = Path(__file__).resolve().parent.parent
@@ -104,6 +106,14 @@ def _supported_agent_names_from_agent_request_template() -> list[str]:
104106
class TestAgentConfigConsistency:
105107
"""Ensure agent configuration stays synchronized across key surfaces."""
106108

109+
def test_register_commands_resolved_dir_annotation_accepts_none(self):
110+
"""The internal resolved-directory override defaults to None."""
111+
resolved_dir_type = get_type_hints(
112+
AgentCommandRegistrar.register_commands
113+
)["_resolved_dir"]
114+
115+
assert type(None) in get_args(resolved_dir_type)
116+
107117
def test_issue_template_agent_lists_match_runtime_integrations(self):
108118
"""GitHub issue templates should list all concrete built-in agents."""
109119
concrete_agent_keys = set(AGENT_CONFIG) - {"generic"}

0 commit comments

Comments
 (0)