Skip to content

fix(notion): emit usable page, database and entry ids from the listing tools - #13863

Merged
kodjima33 merged 3 commits into
BasedHardware:mainfrom
lukiod:fix/notion-list-full-page-ids
Sep 15, 2026
Merged

kodjima33 merged 3 commits into
BasedHardware:mainfrom
lukiod:fix/notion-list-full-page-ids

Conversation

@lukiod

@lukiod lukiod commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

format_page_info in plugins/omi-notion-app/main.py printed each page id as page_id[:20] + "...". Notion page ids are 36 character dashed UUIDs (Page object, id), so every id that search and list_pages handed back was cut to 59833787-2cf9-4fdf-8. get_page, update_page and append_content send page_id verbatim to /pages/{id} and /blocks/{id}/children, so reading, retitling, archiving or appending to a page found through chat all ended in an object not found error.

format_database_info and query_database cut ids the same way, so list_databases (the documented way to find a database_id for query_database and create_page) and the entry ids query_database prints were unusable too.

Two commits: page ids from search/list_pages, then database and entry ids from list_databases/query_database. Each prints the complete id, matching what get_page and create_page already do.

Regression tests

ListedPageIdTests in the existing hermetic suite plugins/omi-notion-app/test_main.py (already registered as notion-page-content-tests in .github/checks-manifest.yaml) asserts that search and list_pages print the complete id, that the id round trips through get_page, update_page and append_content against a requests double that only resolves the complete id, that the 20 character prefix the old output produced is not a page, and that the id printed by list_databases is accepted by query_database and create_page with query_database printing complete entry ids. No network, credentials or third party packages.

Verification

python3 plugins/omi-notion-app/test_main.py
  23 tests OK on the branch head
  3 new tests failing against unchanged main.py
make preflight
scripts/pr-preflight --pr-body-file <this body>

I could not exercise this against a live Notion workspace; the user facing path is covered by the hermetic round trip above, which drives the actual handlers.

Same defect class as #13861 (Google Calendar plugin), kept as a separate PR because the plugins are independent surfaces.

Product invariants affected

none

Fixes #13862

Failure-Class: none

lukiod and others added 2 commits September 14, 2026 21:44
format_page_info printed each page id as the first 20 characters
followed by "...". Notion page ids are 36 character dashed UUIDs, so
every id that search and list_pages handed back was cut short, and
get_page, update_page and append_content, which send page_id verbatim
to /pages/{id} and /blocks/{id}/children, could not find the page.

Print the full id, the same way get_page and create_page already do,
and extend the hermetic suite so every id printed by search and
list_pages round trips through get_page, update_page and append_content
against a requests double that only resolves the complete id.

Verification:
  python3 plugins/omi-notion-app/test_main.py
    22 tests OK on this commit
    2 new tests failing against the unchanged main.py

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NTjKj3PbjJ6d315JjoTjUE
format_database_info and query_database cut ids the same way
format_page_info did. list_databases is the documented way to find a
database_id for query_database and create_page, and query_database
entries are pages whose ids feed get_page and update_page, so the same
read and modify flows were broken for databases.

Print the full ids and extend the round trip test: the id printed by
list_databases is accepted by query_database and create_page, and the
entry ids query_database prints are complete page ids.

Verification:
  python3 plugins/omi-notion-app/test_main.py
    23 tests OK on this commit
    the new test fails against the previous commit

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NTjKj3PbjJ6d315JjoTjUE
@lukiod lukiod changed the title fix(notion): emit usable page ids from search and list_pages fix(notion): emit usable page, database and entry ids from the listing tools Sep 14, 2026

@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

You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

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

Re-trigger cubic

Comment thread plugins/omi-notion-app/test_main.py Resolved
Review note: index() on a url without /v1 would raise instead of failing
the assertion with the recorded calls. Match method and suffix directly.

Verification:
  python3 plugins/omi-notion-app/test_main.py
    23 tests OK

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NTjKj3PbjJ6d315JjoTjUE
@Git-on-my-level Git-on-my-level added python positive-signal Automation verified a genuine fix/quality contribution labels Sep 14, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @lukiod — this is a real usability bug and a clean fix.

What I verified on 3f6162a:

  • plugins/omi-notion-app/main.py — the three truncation sites are exactly the ones that made listing output unusable downstream: format_page_info (line 202, feeds search and list_pages), format_database_info (line 224, feeds list_databases), and the entry loop in tool_query_database (line 868). All three ids originate from page.get("id", "") / db.get("id", "") / entry.get("id", ""), so printing them unsliced can't raise on a missing field, and get_page / update_page / append_content / create_page / query_database already forward ids verbatim — the complete id now round-trips end to end.
  • No [:20] truncation remains in the plugin, and this doesn't widen exposure: the URL: line already embeds the dashes-stripped id, so the shortened id never hid anything.
  • plugins/omi-notion-app/test_main.py — ListedPageIdTests is genuinely hermetic (requests/db doubles, no network, no credentials). I ran the suite in a network-isolated container: 23/23 pass on this head, and against an unchanged main.py the three new tests fail with the truncated ids in the assertion output — so the regression coverage is real, including the round-trip through get_page/update_page/append_content and the list_databases → query_database/create_page path.

No CI checks have reported on this PR yet; the suite is registered in .github/checks-manifest.yaml as notion-page-content-tests, so the local run above stands in for now.

Since this is a first contribution from this account, leaving the final merge sign-off to a maintainer — the change itself looks correct, minimal, and well tested.


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

huiyuansun28-cmyk added a commit to huiyuansun28-cmyk/omi that referenced this pull request Sep 15, 2026
@huiyuansun28-cmyk

Copy link
Copy Markdown
Contributor

PR: #14099

AUTO (AI Agent).

@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.

Fixes truncated Notion page/database/entry ids breaking get/update/append round-trip; well-tested. Confidence 5/5.

@kodjima33
kodjima33 merged commit 252d8b4 into BasedHardware:main Sep 15, 2026
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.

[Bounty proposal] fix(notion): search and list_pages print truncated page ids that get/update/append cannot use

4 participants