# NousResearch/hermes-agent · IndexError from whitespace-only input in build_plan_path

## Open now

- Nothing open on GitHub.

Multiple bug reports and proposed fixes addressing an unguarded str.split() index access in build_plan_path that raises an IndexError when given whitespace-only input. Related guards are also proposed for Slack command text parsing.

## TL;DR

- 8 member(s): 0 open issue(s), 2 closed issue(s), 0 open PR(s), 1 merged PR(s), 5 PR(s) closed without merging.
- A fix was merged to main in PR #26245. Verify it addresses your case.
- **Recommended:** read PR #26245 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `partially_resolved` · deciding PR(s): `pr-26245`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.23`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #2745: \[Bug\]: Unchecked str.split() index access can raise IndexError
- #7576: \[Bug\]: IndexError in build_plan_path on whitespace-only input

## Prior & competing PRs

- **#7613: fix(plan): guard build_plan_path against whitespace-only input**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#7474`
- **#26245: fix(slack): guard split()\[0\] against whitespace-only command text**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `gateway/platforms/slack.py`, `scripts/release.py`
  - fix hunks:
  - `gateway/platforms/slack.py`

    ```diff
    @@ -2785,7 +2785,10 @@ async def _handle_slash_command(self, command: dict) -> None:
                 from hermes_cli.commands import slack_subcommand_map
                 subcommand_map = slack_subcommand_map()
                 subcommand_map["compact"] = "/compress"
    -            first_word = text.split()[0] if text else ""
    +            # Guard against whitespace-only text where ``text`` is truthy but
    +            # ``text.split()`` returns ``[]`` (e.g. user sends ``/hermes   ``).
    +            parts = text.split() if text else []
    +            first_word = parts[0] if parts else ""
                 if first_word in subcommand_map:
                     rest = text[len(first_word):].strip()
                     text = f"{subcommand_map[first_word]} {rest}".strip() if rest else subcommand_map[first_word]
    ```
  - `scripts/release.py`

    ```diff
    @@ -1069,6 +1069,8 @@
         "[redacted:email]": "yifengingit",  # PR #25589 salvage (AUTOINCREMENT id ordering)
         "[redacted:email]": "vanthinh6886",  # PR #25562 salvage (.env 0600 perms)
         "[redacted:email]": "Arkmusn",  # PR #25559 salvage (approvals.timeout from config)
    +    "[redacted:email]": "nidhi-singh02",  # PR #2752 salvage (slack whitespace-only IndexError guard)
    +    "[redacted:email]": "nidhi-singh02",
     }
     
     
    ```
- **#2752: fix: guard str.split() index access against empty results**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#26245`
- **#7474: fix(skills): prevent IndexError in build_plan_path on whitespace-only input**. closed without merge
  - maintainer direction: category `volume_quota`; implication `active`
- **#7692: fix: guard build_plan_path against whitespace-only input**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#7474`, `#7613`
- **#9102: fix(agent): handle whitespace-only input in build_plan_path**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `b2e124d08`, `#15047`

## Fix status

- Merged to main in PR #26245 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-05-15`.
- Subsystem: `agent`
