Skip to content

test: preserve native Pi Skill invocation and lifecycle #316

Description

@bkyssn

当前范围(2026-08-31 修订)

根据 Discussion #324 的已确认决定,本 Issue 改为复用 Pi 原生 Skill 调用与生命周期,不增加 OpenPI 的行内加载和正文恢复层。对应 PR #322;规范记录为 Decision 0002

这是维护者主动调整需求,不是原贡献者没有完成旧要求。旧需求保留在文末作为历史,不再作为当前验收依据。

当前合同

  • 模型自主选择 Skill:Pi 提供目录,正文通过原生 read 按需读取。
  • 用户显式调用:使用原生 /skill:name;补全、正文展开及 steering/follow-up 继续由 Pi 负责。
  • 正文通过普通用户消息或工具结果进入正常 Session 历史,压缩与恢复完全交给 Pi。
  • OpenPI 不提供专门的 $skill 语法、独立正文缓存、provider-only 隐藏投影、压缩后补回正文或保活重读入口。
  • 接受原生限制:压缩后不保证全文保留,也不保证模型自动重读;原生输出与上下文容量限制仍然适用。

当前验收

  • PR 候选撤掉行内解析、补全适配、正文快照、上下文注入及压缩后重新关联;未新建替代运行时模块。
  • README 和 Decision 说明原生用法、持久化差异与限制。
  • 测试加载整个 OpenPI 包,证明 $skill 不再触发程序注入,Pi 目录和原生读取仍可用。
  • 测试证明原生斜杠调用、explicit-only Skill、直接及 streaming steering/follow-up、正常历史保存可用。
  • 测试覆盖未知调用、文件读取失败、真实 Pi 压缩不额外补回正文、后续显式调用读取更新后的文件。
  • 本地完整检查与测试通过;不是模型遵循能力或新终端 UI 验收。
  • 当前 PR head 89f6c88fab44e489be38d276d76c7f9cd63c655f 的必需 CI 检查通过:Node 22.19.0 / Node 24 / Windows
  • 取得非最后推送者的有效 approve,满足仓库合并门槛。

以上勾选表示候选代码/本地验证,不代表已经合并或发布。CI 状态随 #322 当前提交核对。Parent #282#317 与 PR #321 没有因此自动关闭。


历史需求:行内 $skill+隐藏正文(已被上述原生方案替代)

Parent

What to build

Make $skill-name a working Inline Skill Reference for every normal Pi Session input path.

When a user submits a known reference, keep the raw user-visible message unchanged and add the referenced Skill content as hidden model-visible context. Resolve references only from the Skills that Pi supplies for that model turn. Pi remains responsible for Skill discovery, trust, collisions, diagnostics, and reload.

Acceptance criteria

  • A known $skill-name reference in a submitted message adds the corresponding frontmatter-stripped Skill content to model-visible context.
  • The raw user-visible message remains unchanged.
  • Expansion works at the shared Session boundary used by TUI, RPC, print mode, and other normal input paths.
  • $ begins a reference only at the start of input or after horizontal whitespace.
  • Normal punctuation can follow a known Skill name without becoming part of the reference.
  • Text such as abc$skill-name remains ordinary text.
  • An escaped \$skill-name remains unchanged and is not expanded.
  • An unknown $skill-name remains unchanged and adds no Skill content.
  • Each distinct referenced Skill is loaded once, in first-reference order.
  • References resolve only against Pi's Skills for the current model turn; OpenPI does not scan directories or maintain a Skill registry or cache.
  • A Skill read failure is surfaced through Pi's extension error path and is not reported as successfully loaded.
  • Tests separately prove raw user-visible text and hidden model-visible Skill content.
  • The repository's complete check and test commands pass from the current main branch.

Blocked by

  • None — can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions