Skip to content

[good first issue-platform adapt-Pi] Add zero-code MemoryProxy adapter for Pi - #1174

Open
Nobeta-Work wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
Nobeta-Work:feat/pi-memoryproxy-adapter
Open

[good first issue-platform adapt-Pi] Add zero-code MemoryProxy adapter for Pi#1174
Nobeta-Work wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
Nobeta-Work:feat/pi-memoryproxy-adapter

Conversation

@Nobeta-Work

Copy link
Copy Markdown

Description | 描述

Adds Pi as a first-class MemoryProxy client through /pi/<spaceId>/v1/chat/completions.

The integration uses Pi's native models.json provider and dynamic x-session-id, requiring no plugin, hook, MCP server, or Pi source change. Static Team, Agent, and Task headers are validated before non-interactive session registration.

Pi reuses the existing authentication, session binding, Memory/Skill/Knowledge injection, write-back, observability, and credit pipelines. Compaction and branch summaries are strictly classified as auxiliary requests to prevent synthetic history from polluting memory. Missing or invalid presets fail open for the current request without persistently disabling the session.

Standalone English and Chinese setup guides are included under adapters/pi/.

Related Issue | 关联 Issue

Related to #926

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Additional Notes | 其他说明

Validation:

  • MemoryProxy test suite: 4 test files, 17 tests passed.
  • Real Pi 0.84.2 tested with --no-extensions.
  • Verified authentication, asset validation, session registration, <session_context> injection, streaming upstream forwarding, and credit reporting.
  • Captured requests contained a dynamic Pi session ID and the complete Team/Agent/Task preset.

This is a zero-code, configuration-only integration. Pi 0.84.2 is the verified compatibility baseline.

npm run typecheck still reports pre-existing SessionInfo, resetFlow, and private cost-guard type errors on the target branch; none originate from the Pi adapter.

Integrate Pi through its native models.json provider configuration instead of a client extension. Use Pi's x-session-id affinity header and validated static Team, Agent, and Task headers to preserve session binding without plugins, hooks, or MCP.

Classify Pi compaction and branch summaries as auxiliary requests, keep no-form initialization failures request-local and fail-open, and add route, credit, configuration, regression-test, smoke-validation, and bilingual setup coverage.

Signed-off-by: Nobeta-Work <377877931@qq.com>
@Nobeta-Work
Nobeta-Work force-pushed the feat/pi-memoryproxy-adapter branch from 335315a to 46d380b Compare August 27, 2026 01:59
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thank you so much for your attention and contribution! We will arrange an internal review for this PR shortly, and all feedback will be shared right here in the discussion.

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.

2 participants