Skip to content

feat(ponytail): add minimal-code system-prompt injector toggle#1915

Open
enjoyer-hub wants to merge 1 commit into
decolua:masterfrom
enjoyer-hub:feat/ponytail-mode
Open

feat(ponytail): add minimal-code system-prompt injector toggle#1915
enjoyer-hub wants to merge 1 commit into
decolua:masterfrom
enjoyer-hub:feat/ponytail-mode

Conversation

@enjoyer-hub

Copy link
Copy Markdown

What

Adds a Ponytail mode next to Caveman: a toggle that injects a "lazy senior dev / write the minimum code that works" system prompt into outgoing requests, to curb agent over-engineering (fewer files, fewer needless deps, less boilerplate) — while never cutting input validation, error handling, security, or accessibility.

Caveman trims output verbosity; Ponytail trims over-building. They're complementary and can be enabled together.

Ruleset adapted from DietrichGebert/ponytail (MIT), the same way Caveman credits its upstream.

How

  • open-sse/rtk/systemInject.js (new): the format-aware system-prompt injection (OpenAI / Claude / Gemini shapes) is extracted here from caveman.js, so both savers share one implementation (DRY).
  • caveman.js: refactored to call the shared helper — behavior unchanged.
  • open-sse/rtk/ponytailPrompts.js + ponytail.js (new): lite / full rulesets and injectPonytail.
  • chatCore.js: injects ponytail just after caveman, gated on ponytailEnabled && ponytailLevel.
  • src/sse/handlers/chat.js + settingsRepo.js: thread ponytailEnabled / ponytailLevel (defaults false / "full").
  • Dashboard: a Ponytail toggle + level picker in the existing Token Saver card.

Tests

  • tests/unit/ponytail.test.js — 10 cases: OpenAI/Claude/Gemini injection shapes, both levels, unknown-level + missing-body no-ops, and a guard that the shared refactor keeps Caveman working. All pass under the repo's vitest config.
 ✓ tests/unit/ponytail.test.js (10 tests)
 Test Files  1 passed (1)
      Tests  10 passed (10)

Note: pre-existing failures in tests/unit/rtk.test.js (it imports setRtkEnabled/isRtkEnabled, which open-sse/rtk/index.js doesn't export) are unrelated to this change — that file was not touched here.

Notes

  • No new dependencies. Disabled by default; opt-in via the dashboard toggle.
  • CLI was intentionally not changed, matching Caveman (which is also dashboard-only).

Adds a Ponytail token/complexity saver alongside Caveman: injects a lazy-senior-dev (write the minimum that works) system prompt to curb over-engineering, while never cutting validation, error handling, security or accessibility.

Refactors the format-aware system-prompt injection out of caveman.js into a shared open-sse/rtk/systemInject.js used by both caveman and ponytail (DRY). Wires ponytailEnabled/ponytailLevel through chatCore + chat settings, adds defaults, and a dashboard toggle next to Caveman. Ruleset adapted from DietrichGebert/ponytail (MIT).

Adds tests/unit/ponytail.test.js (10 cases: OpenAI/Claude/Gemini shapes, levels, no-ops).
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