feat(ponytail): add minimal-code system-prompt injector toggle#1915
Open
enjoyer-hub wants to merge 1 commit into
Open
feat(ponytail): add minimal-code system-prompt injector toggle#1915enjoyer-hub wants to merge 1 commit into
enjoyer-hub wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromcaveman.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/fullrulesets andinjectPonytail.chatCore.js: injects ponytail just after caveman, gated onponytailEnabled && ponytailLevel.src/sse/handlers/chat.js+settingsRepo.js: threadponytailEnabled/ponytailLevel(defaultsfalse/"full").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.Note: pre-existing failures in
tests/unit/rtk.test.js(it importssetRtkEnabled/isRtkEnabled, whichopen-sse/rtk/index.jsdoesn't export) are unrelated to this change — that file was not touched here.Notes