Skip to content

系统性处理超大 Prompt 原则注入 #9

Description

@MarkShawn2020

Review Context

  • Yoda task/session: yoda://task/a0bc223b-00b2-4254-a365-1d9cf04cef2f/e23b568e-3956-4cbc-bf52-b1d539f4ab89/session/79f299e5-2e35-43fe-a3f6-b9a181d96a14
  • Use this link to recover the original local Yoda task/session context before reviewing follow-up fixes.

Description

超大的 Prompt Principle 现在可以从 leaked system prompts 参考库添加并默认启用,但这类内容可能达到 100KB+。当前只针对本地 POSIX tmux 路径修过一次 command too long,还没有形成跨 runtime / 本地 / SSH 远程的一致大 payload 注入策略。

Status: unresolved. 这个 issue 用来跟踪系统性收口,避免后续只靠单点补丁。

Steps to Reproduce

  1. 打开 Library -> Prompts -> Leaked system prompts。
  2. 选择一条超大的条目,例如 fable-5 这类 100KB+ 的 prompt。
  3. 点击“添加为 Prompt 原则”,保持默认启用。
  4. 新建会话,尤其是在 SSH/远程项目、tmux 包裹或其他会把 provider 命令拼成 shell 字符串的路径下启动。

Expected Behavior

Yoda 对大 Prompt Principle 有统一处理:不把 100KB+ 内容直接内联进 shell/tmux 命令;本地、SSH 远程、不同 provider 的系统提示词注入路径都能稳定启动,并有明确的大小限制、错误提示或替代传输方式。

Actual Behavior

已知本地 POSIX tmux 路径曾因 --append-system-prompt <large text> 被内联进 tmux new-session 而报 command too long。commit 117f2833d 只把本地 tmux 分支改成超长命令落临时脚本;SSH/远程路径和整体的大 prompt 注入策略仍未系统验证/统一。

Environment

  • Repo: lovstudio/yoda
  • Related task: yoda://task/a0bc223b-00b2-4254-a365-1d9cf04cef2f/e23b568e-3956-4cbc-bf52-b1d539f4ab89/session/79f299e5-2e35-43fe-a3f6-b9a181d96a14
  • Relevant commits:
    • 690913d06 built-in leaked-system-prompts reference gallery
    • 79c2ee5e9 leaked prompts become atomic principles
    • 117f2833d local tmux workaround for large system prompts

Acceptance Criteria

  • Audit every path that transports appendSystemPrompt / Prompt Principles into provider CLI startup, including local tmux, non-tmux, SSH remote, and provider-specific config overrides.
  • Replace inline shell/tmux transport for large payloads with a robust mechanism, or define explicit size limits with actionable UI/runtime errors.
  • Add regression coverage for at least one 100KB+ Prompt Principle in local and SSH/remote spawn paths.
  • Ensure temporary files/scripts, if used, have clear lifecycle and cleanup behavior.
  • Decide whether leaked prompt principles should default to enabled or require explicit opt-in after creation.

Additional Context

The original task also produced a public write-up for the local tmux incident: https://lovstudio.ai/blog/tmux-command-too-long. This issue is intentionally broader than that single fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunresolvedKnown issue that has not been fully resolved yet

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions