Skip to content

fix: list tables and text items in the editor outline - #58

Merged
PeterStaar-IBM merged 1 commit into
mainfrom
fix/editor-outline-and-lazy-extractor
Oct 21, 2026
Merged

PeterStaar-IBM merged 1 commit into
mainfrom
fix/editor-outline-and-lazy-extractor

Conversation

@dolfim-ibm

@dolfim-ibm dolfim-ibm commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Found while running DoclingEditingAgent against a remote LLM (watsonx.ai) to fill a form table.

_identify_document_items built the outline with the default OutlineMode.TABLE_OF_CONTENTS, which only lists headings. The model never saw the refs of tables or text items, which update_content and rewrite_content need. Asked to fill a form table, granite-4-h-small answered "ref": "#/table/1" and the run failed while resolving it.

The editor now uses OutlineMode.OUTLINE, which lists every item with its ref. With this change the same task fills the table without naming its ref in the prompt.

Note: the prompt grows with the number of items in the document, which matters for long documents (the existing TODO about the outline format is still relevant).

Tests

tests/test_editor_validation.py::TestIdentifyDocumentItems checks that the planning prompt contains the table ref. It fails on main and passes with this change. ruff, mypy and pytest -m "not slow" pass.

The lazy DocumentExtractor import that was first part of this PR moves to a separate PR, together with running on docling-slim.

@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @dolfim-ibm, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

🟢 Require two reviewer for test updates

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 1

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The editing agent planned its operation from the table-of-contents outline,
which only lists headings. The model could not see the refs of tables and
text items, so update_content on a table guessed refs such as "#/table/1".
Use the full outline, which lists every item with its ref.

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
@dolfim-ibm
dolfim-ibm force-pushed the fix/editor-outline-and-lazy-extractor branch from 7fd26d1 to 8fdf16f Compare October 20, 2026 18:37
@dolfim-ibm dolfim-ibm changed the title fix: list tables in the editor outline and import DocumentExtractor lazily fix: list tables and text items in the editor outline Oct 20, 2026

@ceberam ceberam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@PeterStaar-IBM
PeterStaar-IBM merged commit 0a91a95 into main Oct 21, 2026
11 checks passed
@PeterStaar-IBM
PeterStaar-IBM deleted the fix/editor-outline-and-lazy-extractor branch October 21, 2026 06:08
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.

3 participants