Skip to content

Stamp source=opencode on recorded messages - #47

Merged
ajspig merged 3 commits into
plastic-labs:mainfrom
namredips:source-stamp
Oct 2, 2026
Merged

ajspig merged 3 commits into
plastic-labs:mainfrom
namredips:source-stamp

Conversation

@namredips

@namredips namredips commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Live message paths currently store the triggering event name (chat.message, tool.execute.after, event.message.updated) in metadata source, while the import path stamps opencode-sdk — so no single key identifies this integration as the writer, and operators sharing one Honcho workspace across integrations cannot census writers. This sets source: "opencode" on all three live paths and preserves the event name under a new event key (no information lost). Suite: 25 pass.

Part of a four-repo batch proposing the same source: <integration> convention in codex-honcho, claude-honcho, and cursor-honcho so a single metadata->>'source' census separates writers.

Summary by CodeRabbit

  • Improvements
    • Message metadata now consistently identifies OpenCode as the source and records the originating lifecycle event separately.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 041e4368-3b6b-447c-a3e1-87e8d71e8540

📥 Commits

Reviewing files that changed from the base of the PR and between 301396f and 9f53502.

📒 Files selected for processing (1)
  • src/index.ts
 ___________________________________________________
< What happens in code review stays in code review. >
 ---------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c8cf863d-f751-4ea2-a289-4a5e7962f61d

📥 Commits

Reviewing files that changed from the base of the PR and between 0aca416 and 301396f.

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

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The change standardizes Honcho metadata across assistant, user, and tool activity records. Each record now uses source: "opencode" and stores its originating lifecycle event in event.

Changes

Metadata normalization

Layer / File(s) Summary
Source and event metadata
src/index.ts
Assistant, user, and tool activity persistence paths now use a fixed source value and record the specific lifecycle event in event.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Suggested reviewers: ajspig

Merge Risk: ⚪ Minimal · up to 30139

The change standardizes message metadata while retaining lifecycle event details across assistant, user, and tool records. No current production impact or merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: recording messages with source=opencode.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

A rabbit sees the records align
One source stamp marks each little line
Events hop into their field
Clear metadata is revealed
Three paths now share a tidy sign

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

ajspig and others added 2 commits October 2, 2026 10:40
Cover user prompt, tool activity and assistant flush, which now go through
shared core functions on main, and keep the hook name under `event`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ajspig

ajspig commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Merged main into this branch (a merge rather than a rebase, to avoid force-pushing the fork) and resolved the conflicts: the 1.x hook bodies now delegate to shared core functions, so the stamp moved there. Also stamped the sites added since this PR was opened: user prompt capture, tool activity capture, and assistant flush. The import path still stamps opencode-sdk.

@ajspig
ajspig merged commit a1039df into plastic-labs:main Oct 2, 2026
1 check was pending
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