Skip to content

refactor(mark): consolidate note extraction and strip action wrapper from fallback titles#366

Merged
matt2e merged 2 commits intomainfrom
task-heading-issue
Mar 10, 2026
Merged

refactor(mark): consolidate note extraction and strip action wrapper from fallback titles#366
matt2e merged 2 commits intomainfrom
task-heading-issue

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Mar 10, 2026

Summary

  • Consolidate duplicated repo-note and project-note extraction logic into a shared resolve_note_title_and_body helper
  • Add strip_action_wrapper to remove leading <action>...</action> blocks from session prompts so fallback note titles reflect the user's actual text
  • Add comprehensive tests for strip_action_wrapper

🤖 Generated with Claude Code

matt2e and others added 2 commits March 11, 2026 10:14
Project-level chat sessions prepend an <action>...</action> block to the
stored session prompt. When the assistant's note lacks an H1 heading, the
fallback title was derived from the first 80 characters of this wrapped
prompt, causing raw XML to appear as the note title. Add
strip_action_wrapper() to remove the injected block before generating
fallback titles for both regular and project notes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…per tests

Extract resolve_note_title_and_body() to deduplicate the identical
title/body extraction + fallback-title logic that was copy-pasted
between the repo-note and project-note paths in run_post_completion_hooks.
Both paths now share a single loop over NoteTarget variants, scanning
assistant messages only once.

Add 6 unit tests for strip_action_wrapper covering: no wrapper, normal
wrapper, leading whitespace, missing closing tag, whitespace-only
remainder, and nested action tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners March 10, 2026 23:31
@matt2e matt2e merged commit ca87032 into main Mar 10, 2026
4 checks passed
@matt2e matt2e deleted the task-heading-issue branch March 10, 2026 23:49
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