Skip to content

Workflow tool over-triggers on any mention of the word 'workflow' in prompt text #88

Description

@john-savepoint

Problem

The keyword trigger for the workflow tool is so loose that merely talking about workflows, the repo, or a file named workflow.ts rewrites the user's message and forces a workflow invocation. This is hostile to natural language: questions about the tool are converted into executions of the tool without the user asking for it.

Repro Steps

  1. Ensure default settings (no /workflows-trigger off) on QuintinShaw/pi-dynamic-workflows v2.13.2.
  2. Send any of these messages:
    • github.com/QuintinShaw/pi-dynamic-workflows
    • workflowRunner function
    • my-workflow-helper
    • Look at workflow.ts
    • the workflow tool engages any time
  3. Observe that the message is rewritten with a forcing directive (You MUST handle this request by calling the tool named exactly workflow) and the workflow tool is invoked.

Expected vs Actual

Expected: The workflow tool should only run when the user explicitly asks for it, e.g. via /workflows run <prompt> or an explicit keyword like workflow: / run a workflow / backticks-wrapped workflow.

Actual: Any substring match for workflow (with only a / lookbehind exclusion) arms the trigger. URLs, camelCase identifiers, hyphenated identifiers, filenames, and plain English sentences all fire it.

Proposed Fix

  1. Slash-command-only by default: Make /workflows run <prompt> the primary invocation path and change keywordTriggerEnabled default from true to false in src/workflow-editor.ts:563. Users who want keyword triggering can opt in with /workflows-trigger on.
  2. Narrow the default regex: If keyword triggering stays on by default, make the default 'workflow' regex use the same boundary matching as custom words ((?<![/A-Za-z0-9_-])workflow(?![A-Za-z0-9_-])) instead of the legacy substring (?<!\/)workflows?. Require the trigger word to be a standalone token, or only match workflow:, run a workflow, workflow_id, or backticks-wrapped workflow.
  3. Reduce self-priming in the tool description: Remove the 22 repetitions of For workflow, in src/workflow-tool.ts:162-185 and replace them with neutral phrasing so the LLM is not primed to call the tool whenever it sees the word.

Environment

  • Repository: QuintinShaw/pi-dynamic-workflows
  • Version: v2.13.2 (local clone commit 2f28a74)
  • Runtime: OMP (Oh My Pi)
  • Settings: model-tiers.json absent at session start (created later); keywordTriggerEnabled defaults to true

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    keyword-triggerKeyword-trigger default/behavior/self-priming redesign track

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions