diff --git a/meshai/adapter_config/defaults.py b/meshai/adapter_config/defaults.py index 4157a0d..dcd2ecc 100644 --- a/meshai/adapter_config/defaults.py +++ b/meshai/adapter_config/defaults.py @@ -576,6 +576,11 @@ REGISTRY: dict[tuple[str, str], dict[str, Any]] = { "type": "int", "description": "Maximum characters for the locations field on line 4 of NWS wire. Truncates at word boundary.", }, + ("nws", "area_max_chars"): { + "default": 80, + "type": "int", + "description": "Maximum characters for the area field on line 2 of NWS wire. Truncates at last word boundary.", + }, # ================================================================= # AVALANCHE -- 1 setting (min danger level broadcast floor) diff --git a/meshai/central/nws_handler.py b/meshai/central/nws_handler.py index 6fbd956..d644d18 100644 --- a/meshai/central/nws_handler.py +++ b/meshai/central/nws_handler.py @@ -324,8 +324,12 @@ def _render(*, event_type, area_desc, geocoder_city, county, state, else: time_seg = "" area = (area_desc or "").split(";")[0].strip() - if len(area) > 50: - area = area[:50].rsplit(" ", 1)[0] + _area_limit = int(adapter_config.nws.area_max_chars) + if len(area) > _area_limit: + cut = area[:_area_limit].rsplit(" ", 1)[0] + if not cut: + cut = area[:_area_limit] + area = cut + "\u2026" if time_seg and area: line2 = f"{time_seg} — {area}" elif time_seg: