Skip to content

fix(cli): read Notion page titles by property type instead of name - #1439

Open
tckaros wants to merge 1 commit into
getnao:mainfrom
tckaros:fix/notion-page-title-property-type
Open

fix(cli): read Notion page titles by property type instead of name#1439
tckaros wants to merge 1 commit into
getnao:mainfrom
tckaros:fix/notion-page-title-property-type

Conversation

@tckaros

@tckaros tckaros commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Closes #1438

extract_page_title looked for titles using a list of conventional property
names (title, Title, Name, name, and Page).

Notion database entries can name their title property freely—for example,
Topic. The lookup therefore missed custom-named title properties and fell
back to the raw page ID for both the filename and frontmatter title.

The content still synced correctly, but the opaque filename made the document
difficult for agents to discover when listing files for relevant context.

Notion pages have a property of type title, so the lookup now identifies the
title by property type instead of name. Existing behavior is preserved for
regular pages, and empty titles still fall back to the page ID.

Testing

  • Added unit tests covering:
    • a custom-named title property (Topic);
    • an empty title falling back to the page ID.
  • Notion and sync CLI test suites pass (111 tests).
  • Tested against a real Notion workspace: a database entry now syncs as
    ai-agents-karos-basic-knowledge-3ae5f0e8.md, with its actual title in the
    frontmatter, instead of 3ae5f0e8…-3ae5f0e8.md.

🤖 Generated with Claude Code

Review in cubic

Pages that are rows of a Notion database name their title property freely
(e.g. "Topic"), so matching on a list of conventional names fell back to
the raw page ID for the synced file's title and filename. Match on the
property type instead — every page has exactly one property of type
"title".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

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.

[bug] nao sync: Notion database entries use raw page IDs as titles and filenames

1 participant