Private
Public Access
0
0

feat(gui): add _get_active_capabilities() helper to App class

Phase 5 t5.1: the helper reads the capability matrix for the currently
active (provider, model) pair and returns the VendorCapabilities.
Falls back to an 'unregistered' VendorCapabilities if the pair is
not in the registry (e.g., a brand-new model name the user types in).

The 9 UX adaptations in spec §6 will call this helper to read the
capability flags (vision, tool_calling, caching, streaming, etc.)
and adapt the GUI accordingly.

Also fixed pre-existing indentation inconsistency in the App class
property methods (current_provider / current_model): the first
@property had 2-space indent but the body and subsequent def had
1-space indent (matching the project style). The mismatch was
latent; the new helper exposed it. Now uniform 1-space indent.

38/38 regression tests still pass; no behavioral change beyond the
helper addition.
This commit is contained in:
2026-06-11 09:10:47 -04:00
parent 15b3b33081
commit 221cd33493
+7
View File
@@ -730,6 +730,13 @@ class App:
def current_model(self, value: str) -> None:
self.controller.current_model = value
def _get_active_capabilities(self) -> "VendorCapabilities":
from src.vendor_capabilities import VendorCapabilities, get_capabilities
try:
return get_capabilities(self.current_provider, self.current_model)
except KeyError:
return VendorCapabilities(vendor=self.current_provider, model=self.current_model, notes="unregistered")
@property
def perf_profiling_enabled(self) -> bool:
return self.controller.perf_profiling_enabled