Skip to content

Fix Outlook search pagination and bound message payloads - #467

Open
zhouzhuozhzh-maker wants to merge 1 commit into
andrewyng:mainfrom
zhouzhuozhzh-maker:codex/fix-465-outlook-pagination
Open

Fix Outlook search pagination and bound message payloads#467
zhouzhuozhzh-maker wants to merge 1 commit into
andrewyng:mainfrom
zhouzhuozhzh-maker:codex/fix-465-outlook-pagination

Conversation

@zhouzhuozhzh-maker

Copy link
Copy Markdown

Summary

  • honor Outlook search limits up to a safe 100-message cap and follow opaque Microsoft Graph next links inside one tool call
  • deduplicate messages across pages, reject off-origin pagination URLs, and expose explicit returned_count, has_more, and query_complete metadata
  • keep search results compact with selected header fields, then add outlook_get_message for reading one chosen full message
  • guide the agent to narrow the existing query when the cap is reached instead of repeating or broadening it

Root cause

outlook_search_messages silently clamped max_results=100 to 20, returned the raw @odata.nextLink, and offered no continuation parameter. The model therefore had evidence of another page but no supported way to fetch it, which encouraged repeated overlapping searches. The list request also did not select compact fields.

Validation

  • .venv/bin/pytest tests/test_connectors.py -k outlook -q (7 passed)
  • .venv/bin/pytest -q (1117 passed, 1 skipped)
  • git diff --check

Compatibility and risk

The existing account/ok/data/value response shape remains available. Search results intentionally become summaries; callers can use the new read-only outlook_get_message tool when they need a full body. Pagination is bounded by both message and page limits.

Fixes #465

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.

Outlook connector loops on pagination, blows past token limit on single day inbox listing

1 participant