Summary
Bear's /add-text x-callback-url action with mode=replace and header parameter silently fails when the header text contains certain URL-significant characters: /, &, [, ], |. The URL is accepted, open -g exits 0, but Bear does not perform the replacement. No error is surfaced.
This is a Bear app bug in its x-callback-url handler — it appears to interpret these characters at the URL-parsing level before decoding percent-encoded parameter values.
Affected characters
| Character |
Test Header |
Result |
/ |
Topic r/bearapp |
❌ Silent no-op |
& |
Q&A Section |
❌ Silent no-op |
[ ] |
Release [v2.5] |
❌ Silent no-op |
| |
Option A | Option B |
❌ Silent no-op |
Characters confirmed working
= ? # % + : ; , @ ! ' " — é → — all 15 pass correctly.
Test methodology
Each character was tested with an isolated create → replace → verify → archive cycle using MCP Inspector CLI:
- Create a note with three
## sections, the middle one containing the special character in its header name
- Call
bear-replace-text with scope=section targeting that header
- Wait 500ms for Bear to process
- Read the note back with
bear-open-note and check whether the section content changed
- Archive the test note
All 4 failing characters exhibit the same behavior: bear-replace-text reports success, but bear-open-note shows the original section text unchanged.
Root cause hypothesis
Bear's x-callback-url handler parses these characters structurally before decoding percent-encoded values in the header parameter:
& is treated as a query parameter delimiter — header=Q&A Section becomes header=Q plus an orphan parameter A Section
/ likely confuses internal URL path routing
[ ] have special meaning in RFC 3986 (IPv6 literals)
| is not valid in URIs; some parsers reject or mangle it
Impact
Section-level content replacement (/add-text?mode=replace&header=...) is unreliable for any note with these characters in section headers. Full-note-body replacement (mode=replace without header) is not affected.
Workaround
Perform section replacement client-side: read the full note, splice the section content in markdown, then use mode=replace without the header parameter to write the entire modified body.
Summary
Bear's
/add-textx-callback-url action withmode=replaceandheaderparameter silently fails when the header text contains certain URL-significant characters:/,&,[,],|. The URL is accepted,open -gexits 0, but Bear does not perform the replacement. No error is surfaced.This is a Bear app bug in its x-callback-url handler — it appears to interpret these characters at the URL-parsing level before decoding percent-encoded parameter values.
Affected characters
/Topic r/bearapp&Q&A Section[]Release [v2.5]|Option A | Option BCharacters confirmed working
=?#%+:;,@!'"—é→— all 15 pass correctly.Test methodology
Each character was tested with an isolated create → replace → verify → archive cycle using MCP Inspector CLI:
##sections, the middle one containing the special character in its header namebear-replace-textwithscope=sectiontargeting that headerbear-open-noteand check whether the section content changedAll 4 failing characters exhibit the same behavior:
bear-replace-textreports success, butbear-open-noteshows the original section text unchanged.Root cause hypothesis
Bear's x-callback-url handler parses these characters structurally before decoding percent-encoded values in the
headerparameter:&is treated as a query parameter delimiter —header=Q&A Sectionbecomesheader=Qplus an orphan parameterA Section/likely confuses internal URL path routing[]have special meaning in RFC 3986 (IPv6 literals)|is not valid in URIs; some parsers reject or mangle itImpact
Section-level content replacement (
/add-text?mode=replace&header=...) is unreliable for any note with these characters in section headers. Full-note-body replacement (mode=replacewithoutheader) is not affected.Workaround
Perform section replacement client-side: read the full note, splice the section content in markdown, then use
mode=replacewithout theheaderparameter to write the entire modified body.