Repository navigation
fix(notion-web): accept OpenAI content-parts arrays in transcript - #7896
diegosouzapw merged 1 commit into
Conversation
Agent clients often send message.content as [{type:\"text\",text:\"...\"}]
instead of a plain string. buildNotionMessageStep previously required a
string and silently dropped those turns, so system injects (jailbreak /
agentic conversion) and multimodal user messages never reached Notion.
Normalize string | content-parts | bare string parts via
extractNotionMessageText, and add regression coverage in the transcript
unit suite.
There was a problem hiding this comment.
Code Review
This pull request updates the Notion executor to correctly handle OpenAI-style message content that uses arrays of parts, rather than just plain strings. A new utility function, extractNotionMessageText, was introduced to normalize these content structures, ensuring that system and user messages are correctly processed and included in the Notion transcript. Corresponding unit tests were added to verify this behavior and ensure regression coverage. There are no review comments to address for this pull request.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
This is necessary to transform a web provider into an agentic provider by utilizing prompts for the exchange of tool and skill instructions. |
99135d7
into
cheaper-inference:release/v3.8.49
|
Merged — thanks @artickc! extractNotionMessageText() cleanly handles the OpenAI content-parts array shape that OpenCode/Cline send. Validated in the local merge-train (combined tree, full unit suite + vitest green) on tomni-proxmox-113 @ 998752fbca then squash-merged. |
Merge release/v3.8.49 into fix/notion-web-thread-continuity: the sticky thread-session cache (root binding, disk persistence, client pin via notion_thread_id/thread_id/X-Notion-Thread-Id) collided with cheaper-inference#7896's identical extractNotionMessageText/buildNotionMessageStep dedupe already landed on release — kept the PR's exported extractNotionMessageText plus release's content-parts docstring, and release's buildNotionMessageStep comment. Removed the dead @deprecated buildNotionCreateThreadRequestBody alias (zero call sites, confirmed by grep) flagged in review. Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com>
…eaper-inference#7896) Agent clients often send message.content as [{type:\"text\",text:\"...\"}] instead of a plain string. buildNotionMessageStep previously required a string and silently dropped those turns, so system injects (jailbreak / agentic conversion) and multimodal user messages never reached Notion. Normalize string | content-parts | bare string parts via extractNotionMessageText, and add regression coverage in the transcript unit suite.
…eaper-inference#7896) Agent clients often send message.content as [{type:\"text\",text:\"...\"}] instead of a plain string. buildNotionMessageStep previously required a string and silently dropped those turns, so system injects (jailbreak / agentic conversion) and multimodal user messages never reached Notion. Normalize string | content-parts | bare string parts via extractNotionMessageText, and add regression coverage in the transcript unit suite.
Summary
message.contentto be a plain string. Agent clients (Skills Manager, OpenCode-style tool runners, multimodal clients) often send OpenAI content-parts arrays ([{ type: \"text\", text: \"...\" }]).buildNotionMessageStep, so system injects (jailbreak / agentic conversion / client tool catalogs) and array-shaped user turns never reached Notion'srunInferenceTranscriptpayload.extractNotionMessageText()to normalize string | content-parts | bare string parts, and use it for system / user / assistant roles.Test plan
node --import tsx --test tests/unit/executor-notion-web.test.ts— 30/30 passcontext.instructionsand a user stepnotion-web/fable-5with system inject markers present in backend call log / transcriptNotes
open-sse/executors/notion-web.ts+ unit tests only.release/v3.8.49(where notion-web lives; same as feat: add Notion AI Web (Unofficial/Experimental) provider (#6758) #7600 / fix(notion-web): production-ready labels, multi-workspace, inference, usage (FINAL) #7768).