Codumentor logo Codumentor

Script Filter Plugin

The Script Filter plugin removes runs of non-Latin characters (CJK, kana,
hangul, fullwidth forms, …) that a model sometimes leaks into otherwise-Latin
output. It strips them live during streaming (replacing each run with a
placeholder) and, when the turn finishes, optionally **translates the removed
fragments** back into the surrounding language and revises the message in
place.

Configuration

plugins:
  - module: codumentor.plugins.script_filter
    class: ScriptFilterPlugin
    args:
      enabled: true
      scope: both              # both | content | thinking
      placeholder: "□"
      translate: true
      target_language: auto    # 'auto' = match the surrounding text
      request_timeout_seconds: 20.0
      defer_translation: true

Parameters

What you see

Settings → Script Filter lets each user toggle stripping and translation,
and set the placeholder and target language.

The placeholder briefly flashes during streaming; the translation lands
after the turn completes, as a post-hoc revision of the message.

Notes