Skip to content

docs(pi): document PI 2.5 PI_* env vars for Agent subprocesses#1226

Merged
MistEO merged 1 commit intomainfrom
docs/PI_2.5
Mar 25, 2026
Merged

docs(pi): document PI 2.5 PI_* env vars for Agent subprocesses#1226
MistEO merged 1 commit intomainfrom
docs/PI_2.5

Conversation

@MistEO
Copy link
Copy Markdown
Member

@MistEO MistEO commented Mar 24, 2026

Align Project Interface docs and interface.schema.json with issue #1225: PI_INTERFACE_VERSION, PI_CLIENT_*, PI_VERSION, PI_CONTROLLER, PI_RESOURCE.

@MaaXYZ/ui-developers

fix #1225

Summary by Sourcery

为 Agent 子进程撰写 PI v2.5.0 环境变量约定的文档,并在接口版本相关的 schema/文档中进行统一。

Enhancements:

  • 更新 interface.schema.json,以反映澄清后的 interface_version 含义,以及在适用场景下新的 PI 环境变量约定。

Documentation:

  • 增加 PI v2.5.0 的发行条目,并描述在启动 Agent 子进程时,Client 应该注入的 PI_* 环境变量,包括客户端元数据以及选定的 controller/resource 上下文。
  • 澄清 interface.json 中的 interface_version 是一个固定的 JSON Schema 主版本号,与 PI 文档的语义化版本号不同,并据此更新英文和中文的 PI 文档。
Original summary in English

Summary by Sourcery

Document PI v2.5.0 environment variable conventions for Agent subprocesses and align the schema/docs around interface versioning.

Enhancements:

  • Update interface.schema.json to reflect the clarified meaning of interface_version and the new PI environment variable conventions where applicable.

Documentation:

  • Add PI v2.5.0 release entry and describe PI_* environment variables that Clients should inject when launching Agent subprocesses, including client metadata and selected controller/resource context.
  • Clarify that interface_version in interface.json is a fixed major JSON schema number distinct from the PI semantic documentation version, and update both English and Chinese PI docs accordingly.

Align Project Interface docs and interface.schema.json with issue #1225:
PI_INTERFACE_VERSION, PI_CLIENT_*, PI_VERSION, PI_CONTROLLER, PI_RESOURCE.

Made-with: Cursor
Copilot AI review requested due to automatic review settings March 24, 2026 08:37
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出一些整体性的反馈:

  • agent 是数组(多个子进程)时,最好能明确说明它们是否都会接收到相同的 PI_CONTROLLER/PI_RESOURCE 值,或者是否预期存在按代理(per-agent)的选择语义。
  • 对于 PI_CONTROLLERPI_RESOURCE,建议显式说明预期的字符编码和 JSON 转义规则(例如 UTF-8,如何处理非 ASCII 字符和引号),以便不同的 Client 和 Agent 实现能够一致地序列化/解析这些环境变量值。
面向 AI 代理的提示(Prompt)
Please address the comments from this code review:

## Overall Comments
- When `agent` is an array (multiple subprocesses), it would help to clarify whether all of them receive the same `PI_CONTROLLER`/`PI_RESOURCE` values or if there is any per-agent selection semantics expected.
- For `PI_CONTROLLER` and `PI_RESOURCE`, consider explicitly specifying the expected character encoding and JSON escaping rules (e.g., UTF-8, how to handle non-ASCII and quotes) so different Client and Agent implementations serialize/parse these environment values consistently.

Sourcery 对开源项目是免费的——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的审查建议。
Original comment in English

Hey - I've left some high level feedback:

  • When agent is an array (multiple subprocesses), it would help to clarify whether all of them receive the same PI_CONTROLLER/PI_RESOURCE values or if there is any per-agent selection semantics expected.
  • For PI_CONTROLLER and PI_RESOURCE, consider explicitly specifying the expected character encoding and JSON escaping rules (e.g., UTF-8, how to handle non-ASCII and quotes) so different Client and Agent implementations serialize/parse these environment values consistently.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- When `agent` is an array (multiple subprocesses), it would help to clarify whether all of them receive the same `PI_CONTROLLER`/`PI_RESOURCE` values or if there is any per-agent selection semantics expected.
- For `PI_CONTROLLER` and `PI_RESOURCE`, consider explicitly specifying the expected character encoding and JSON escaping rules (e.g., UTF-8, how to handle non-ASCII and quotes) so different Client and Agent implementations serialize/parse these environment values consistently.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR documents the new PI v2.5.0 convention for PI_* environment variables that a Client/UI should inject when launching Agent subprocesses, and aligns the Project Interface JSON schema descriptions with that documentation.

Changes:

  • Added PI v2.5.0 entry and a new “Agent subprocess environment variables” section to the English Project Interface V2 documentation.
  • Clarified the distinction between interface_version (major JSON structure version) and the PI documentation’s semantic versioning (e.g. v2.5.0).
  • Updated tools/interface.schema.json descriptions to point readers to the new PI v2.5.0 PI_* environment variable convention.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tools/interface.schema.json Adds v2.5.0 notes in schema descriptions to guide Clients to inject PI_* env vars for Agent subprocesses and clarifies interface_version meaning.
docs/en_us/3.3-ProjectInterfaceV2.md Documents PI v2.5.0 PI_* environment variables convention and clarifies versioning semantics in the English PI spec.

@MistEO MistEO merged commit 965647b into main Mar 25, 2026
5 checks passed
@MistEO MistEO deleted the docs/PI_2.5 branch March 25, 2026 08:06
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.

PI 2.5 协议草案,引入 interface 相关环境变量

2 participants