Skip to content

Normalize default-mode parsing and add regression test - #716

Open
thb-hash wants to merge 1 commit into
DietrichGebert:mainfrom
thb-hash:thb-hash-ponytail-bug-fix
Open

Normalize default-mode parsing and add regression test#716
thb-hash wants to merge 1 commit into
DietrichGebert:mainfrom
thb-hash:thb-hash-ponytail-bug-fix

Conversation

@thb-hash

Copy link
Copy Markdown

Why

Environment and config values for the Ponytail default mode were not being normalized, so values with extra whitespace or unusual casing (for example, " FULL " or "\tultra\n") were ignored. This caused unexpected fallbacks or failures when users set defaults via env vars or config files.

What I changed

  • Normalize PONYTAIL_DEFAULT_MODE and config.defaultMode through normalizeMode() in hooks/ponytail-config.js so whitespace and casing are handled, while still rejecting session-only modes like "review" as defaults.
  • Add a focused regression test in pi-extension/test/helpers.test.js that verifies trimming and normalization for both env and config values.

Notes & testing

  • Change is small and targeted: main logic moved to reuse existing normalizeMode() to avoid duplication and edge-case bugs.
  • Ran unit tests locally: the helper tests pass (12/12) and full test suite run earlier passed.

Files changed

  • hooks/ponytail-config.js — normalize env/config default parsing
  • pi-extension/test/helpers.test.js — new regression test

Reviewers: small utility fix; extra attention appreciated on the normalization and config-path logic on Windows paths if needed.

- Normalize parsing of PONYTAIL_DEFAULT_MODE and config.defaultMode via normalizeMode() so whitespace and casing are accepted while 'review' remains invalid as a default.

- Add unit test covering trimmed/normalized env and config values.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant