Skip to content

Fix RelationshipMemory hook: parsed.userPrompt doesn't exist#1049

Open
qozle wants to merge 1 commit intodanielmiessler:mainfrom
qozle:fix/relationship-memory-971
Open

Fix RelationshipMemory hook: parsed.userPrompt doesn't exist#1049
qozle wants to merge 1 commit intodanielmiessler:mainfrom
qozle:fix/relationship-memory-971

Conversation

@qozle
Copy link
Copy Markdown

@qozle qozle commented Apr 7, 2026

Summary

  • RelationshipMemory.hook.ts references parsed.userPrompt which doesn't exist on ParsedTranscript — always undefined, so user messages are never captured
  • parsed.plainCompletion (tab-title string) is too short for relationship pattern regexes to match against assistant content
  • Fix: parse both user and assistant messages from parsed.raw JSONL lines using the existing contentToText() helper, matching the same approach used internally by parseLastAssistantMessage() and collectCurrentResponseText()

Test plan

  • Run a session with preference-indicating user messages (e.g. "I prefer when you...") and verify entries appear in MEMORY/RELATIONSHIP/
  • Run a session with SUMMARY: lines in assistant output and verify biographical notes are captured
  • Confirm no regressions in other Stop hooks (VoiceCompletion, LastResponseCache, UpdateTabTitle)

Fixes #971

…ield

The v4.0.0 refactor to use shared TranscriptParser left a reference to
parsed.userPrompt, which doesn't exist on ParsedTranscript. This made the
hook silently skip all user messages. The plainCompletion fallback for
assistant content is a short tab-title string, too narrow for relationship
pattern regexes to match.

Parse user and assistant messages directly from parsed.raw JSONL lines,
using the same contentToText() helper that TranscriptParser uses internally.

Fixes danielmiessler#971

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

RelationshipMemory.hook.ts silently broken in v4.0 — references nonexistent ParsedTranscript.userPrompt

1 participant