Skip to content

feat(core): add pi event adapter for 0.41 ingest - #1

Closed
ZeR020 wants to merge 2 commits into
stack/1-shared-spool-memoryfrom
stack/2-pi-hooks-adapter
Closed

feat(core): add pi event adapter for 0.41 ingest#1
ZeR020 wants to merge 2 commits into
stack/1-shared-spool-memoryfrom
stack/2-pi-hooks-adapter

Conversation

@ZeR020

@ZeR020 ZeR020 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Second stacked PR for the pi integration (kunickiaj#1430). Depends on kunickiaj#1473 (stack/1-shared-spool-memory).

This PR is opened on the fork because GitHub cannot use kunickiaj:stack/1-shared-spool-memory as a base (that branch lives on ZeR020 only). Diff vs layer 1 is the pi adapter only.

Why

Pi events need a core adapter that produces the same envelope shape ingestRawEvents already accepts, with source: "pi" explicit and deterministic ids so HTTP/CLI retries do not duplicate rows.

What

  • packages/core/src/pi-hooks.ts: map session/prompt/tool events; compaction is flush-only
  • Envelope fields include session_stream_id / session_id aliases required by 0.41 ingest
  • Test: ingestRawEvents persists source pi and creates zero opencode rows

Test plan

  • vitest run packages/core/src/pi-hooks.test.ts — 40/40 passed

Stacked on: kunickiaj#1473
Next: viewer /api/pi-hooks alias + memory-tool routes

Related: kunickiaj#1430, kunickiaj#1429, kunickiaj#1473

Copilot AI lite review requested due to automatic review settings August 17, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

ZeR020 added 2 commits August 28, 2026 13:12
Map pi extension events to AdapterEvent envelopes with source "pi"
and deterministic ids so later stacked routes can call ingestRawEvents
without a parallel writer.
@ZeR020
ZeR020 force-pushed the stack/2-pi-hooks-adapter branch from 280dc41 to 4e8d194 Compare August 29, 2026 07:40
@ZeR020

ZeR020 commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

Superseded by kunickiaj#1546 — layer 1 (kunickiaj#1473) merged upstream, so this layer was rebased onto upstream main and retargeted there.

@ZeR020 ZeR020 closed this Aug 29, 2026
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