Skip to content

fix: guard Ding-specific sections behind flavor check and prevent frustration self-trigger - #183

Open
MeGaurav4 wants to merge 1 commit into
tanweai:mainfrom
MeGaurav4:fix/issue-182-ding-flavor-guard
Open

fix: guard Ding-specific sections behind flavor check and prevent frustration self-trigger#183
MeGaurav4 wants to merge 1 commit into
tanweai:mainfrom
MeGaurav4:fix/issue-182-ding-flavor-guard

Conversation

@MeGaurav4

Copy link
Copy Markdown

Two related fixes for the always-on protocol and frustration trigger.

  1. Context bloat on non-ding flavors. The session-restore hook
    unconditionally injected ~2000 Chinese characters of Ding-specific
    protocol content into every session, regardless of flavor. Moved the
    Ding section behind a $PUA_FLAVOR = "ding" guard. The generic
    protocol template and auto-router table remain flavor-agnostic.

  2. Self-trigger loop in frustration hook. The TRIGGER_RE regex
    included 置身钉内|置身钉外 -- meta-terms the AI itself uses when
    describing the plugin. The user asking "why did you say that?" would
    match the regex, re-inject context, and create a loop. Removed the
    terms from the trigger. Also added a session-level marker file
    (/tmp/pua-frustration-fired-$PPID) to prevent re-injection within
    the same session.

Closes #182

…stration self-trigger

Two fixes:

1. session-restore.sh: moved the Ding reminder mode section into a
   conditional block so it only injects for the "ding" flavor. The
   generic protocol template and auto-router table stay flavor-agnostic.

2. frustration-trigger.sh: removed 置身钉内|置身钉外 from the trigger
   regex (these meta-terms caused a self-trigger loop). Added a
   session-level marker file guard to prevent repeated injection.

Closes tanweai#182
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.

Bug: Ding Inside/Outside chapters injected for non-ding flavors + frustration trigger self-loop

1 participant