Skip to content

fix(composio): match personal-info keywords case-insensitively - #13524

Merged
kodjima33 merged 2 commits into
BasedHardware:mainfrom
Nukeys:fix/composio-personal-info-case
Sep 12, 2026
Merged

kodjima33 merged 2 commits into
BasedHardware:mainfrom
Nukeys:fix/composio-personal-info-case

Conversation

@Nukeys

@Nukeys Nukeys commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #13302.

contains_personal_info lowercased the input but compared mixed-case keywords, so first-person memories were dropped.

  • Unit tests for "I like ..."
  • Failure-Class: none

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread plugins/composio/src/notion.py Resolved
@Nukeys

Nukeys commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Fixed: format_as_memory replacements are now case-insensitive so lowercase input is formatted like capitalized input.

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified — nice first contribution, and thank you for adding tests.

What I checked on this head (fff8595):

  • plugins/composio/src/notion.py — contains_personal_info() lowercased the input but compared it against the mixed-case keyword list, so the exact repro from Composio Notion extraction drops first-person memories due to keyword case mismatch #13302 ("I like reading science fiction books on weekends") returned False at main and the memory was silently dropped. At this head it returns True, and lowercase input like "i'm tired today" is detected as well.
  • format_as_memory() — the rewrite from chained str.replace(...) to \b-anchored re.sub(..., flags=re.IGNORECASE) keeps every previously-working input formatting correctly (checked all branches — "I am"/"I'm"/"I like"/"I love"/"I enjoy"/"I prefer"/"I don't like"/"I do not like"/"I hate"/"my favorite"/"I have"/"my friend" in original, lower-, and upper-case), and now formats lowercase input too ("i am learning rust" → "User is learning rust").
  • plugins/composio/test_notion_personal_info.py — both tests pass against this head.

Two small behavior notes, non-blocking:

  1. count=1 means only the first occurrence is rewritten ("I like cats and I like dogs" → "User likes cats and I like dogs"); the old chained replace rewrote every occurrence. This reads fine for a one-sentence memory — just flagging the delta.
  2. contains_personal_info() still matches by substring while the formatter is now word-boundary anchored, so e.g. "the mali ambassador arrived" can be detected but falls through the \bi am\b substitution unchanged (and skips the "User note:" fallback since the branch was entered). That asymmetry predates this PR and behaves identically at main, so it's fine to leave for a future cleanup.

Minor: pytest isn't in plugins/composio/requirements.txt and no workflow runs the plugin's tests today, so these are contributor-run; not a blocker.

Note for a maintainer: #13304 also targets #13302, so one of the two will need to be picked — this one is small, focused, and verified as above. Leaving the merge choice to a human maintainer.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added python positive-signal Automation verified a genuine fix/quality contribution labels Sep 12, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Community bug-fix 5/5: case-insensitive keyword match verified correct, test added, scoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

positive-signal Automation verified a genuine fix/quality contribution python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composio Notion extraction drops first-person memories due to keyword case mismatch

3 participants