Skip to content

fix(pi): send tool_input/tool_output instead of input/output - #772

Merged
rohitg00 merged 1 commit into
mainfrom
fix/pi-observation-field-names
Jun 1, 2026
Merged

rohitg00 merged 1 commit into
mainfrom
fix/pi-observation-field-names

Conversation

@rohitg00

@rohitg00 rohitg00 commented Jun 1, 2026 •

Copy link
Copy Markdown
Owner

Problem

Reported in #759. pi integration users see every conversation observation rendered as No content provided / No actual conversation content was captured in this observation in the viewer timeline.

Root cause

integrations/pi/index.ts agent_end handler emits post_tool_use observations with field names input / output. src/functions/observe.ts reads tool_input / tool_output. The field-name mismatch leaves raw.toolInput / raw.toolOutput undefined, so src/functions/compress.ts finds no content to summarize and falls back to the empty-content text.

Other integrations (openclaw, hermes, filesystem-watcher) already use the correct names — pi was the only one affected.

Fix

Rename input → tool_input, output → tool_output in the pi agent_end observation payload.

Closes

Closes #759.

Summary by CodeRabbit

Release Notes

  • Chores
    • Improved the internal data structure used for recording agent conversations by updating property naming conventions to better organize tool-specific interaction data while maintaining existing message handling behavior for agent memory logging.

pi integration emitted post_tool_use observations with fields named
'input' and 'output', but observe.ts reads 'tool_input'/'tool_output'.
The field mismatch caused observe to record undefined inputs/outputs,
so the compress pipeline produced empty observations rendered as
'No content provided' in the viewer.
@vercel

vercel Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment Jun 1, 2026 11:40pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd3fa122-0679-402e-b29c-cab43a255f44

📥 Commits

Reviewing files that changed from the base of the PR and between fd9e3bd and db4dc3b.

📒 Files selected for processing (1)
  • integrations/pi/index.ts

📝 Walkthrough

Walkthrough

This PR updates the payload sent to the agentmemory server's observe endpoint in the agent_end handler. The property names for captured conversation data are renamed from input/output to tool_input/tool_output, with the same substring truncation logic preserved.

Changes

Agent Memory Observation Payload Update

Layer / File(s) Summary
Agent end handler observation payload
integrations/pi/index.ts
The observe endpoint payload renames conversation data field names from input/output to tool_input/tool_output while maintaining existing truncation behavior for lastPrompt and assistant text.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A tiny hop through property names so small,
From input and output to tool_input calls,
The payload now speaks a more precise tongue,
While truncation stays true, no logic undone. 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(pi): send tool_input/tool_output instead of input/output' accurately describes the main change: renaming fields in the pi integration's observation payload.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pi-observation-field-names

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rohitg00
rohitg00 merged commit 52e5f3f into main Jun 1, 2026
7 checks passed
@rohitg00
rohitg00 deleted the fix/pi-observation-field-names branch June 1, 2026 23:51
rohitg00 added a commit that referenced this pull request Jun 2, 2026
Bump to 0.9.25 across 9 files + CHANGELOG.

Closes #778 #775 #783 (PR #791), #758 #726 (PR #773), #759 (PR #772),
#752 (PR #774), #729 (PR #780), #781 (PR #782), #753 (PR #789), #771
(PR #786), #762 (PR #764).

Files bumped:
  - package.json
  - packages/mcp/package.json
  - plugin/.claude-plugin/plugin.json
  - plugin/.codex-plugin/plugin.json
  - plugin/plugin.json
  - src/version.ts
  - src/types.ts (ExportData.version union)
  - src/functions/export-import.ts (supportedVersions Set)
  - test/export-import.test.ts (assertion)

125 test files / 1379 tests pass. npm audit (root + website): 0 vulns.
healdigital pushed a commit to healdigital/agentmemory that referenced this pull request Jul 27, 2026
…0#772)

pi integration emitted post_tool_use observations with fields named
'input' and 'output', but observe.ts reads 'tool_input'/'tool_output'.
The field mismatch caused observe to record undefined inputs/outputs,
so the compress pipeline produced empty observations rendered as
'No content provided' in the viewer.
healdigital pushed a commit to healdigital/agentmemory that referenced this pull request Jul 27, 2026
Bump to 0.9.25 across 9 files + CHANGELOG.

Closes rohitg00#778 rohitg00#775 rohitg00#783 (PR rohitg00#791), rohitg00#758 rohitg00#726 (PR rohitg00#773), rohitg00#759 (PR rohitg00#772),
rohitg00#752 (PR rohitg00#774), rohitg00#729 (PR rohitg00#780), rohitg00#781 (PR rohitg00#782), rohitg00#753 (PR rohitg00#789), rohitg00#771
(PR rohitg00#786), rohitg00#762 (PR rohitg00#764).

Files bumped:
  - package.json
  - packages/mcp/package.json
  - plugin/.claude-plugin/plugin.json
  - plugin/.codex-plugin/plugin.json
  - plugin/plugin.json
  - src/version.ts
  - src/types.ts (ExportData.version union)
  - src/functions/export-import.ts (supportedVersions Set)
  - test/export-import.test.ts (assertion)

125 test files / 1379 tests pass. npm audit (root + website): 0 vulns.

This branch was successfully deployed

1 active deployment
Preview — db4dc3b8 Deployed Jun 1, 2026 by vercel[bot]
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.

1 participant