Skip to content

Python: let the DevUI item endpoint resolve list item ids - #9863

Closed
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/devui-item-ids-list-get
Closed

Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/devui-item-ids-list-get

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Motivation & Context

The conversation items endpoints disagreed about identity. add_items mints item_<uuid> ids and get_item resolved only those, while list_items derives positional item_<index> ids from the stored messages. The only ids a client can discover through listing, including agent run messages that never pass through the add path, answered 404 on the item retrieval endpoint that documents itself as the OpenAI standard.

Description & Review Guide

  • What are the major changes? The per message conversion that list_items used inline is extracted into one helper, and get_item resolves positional ids by rebuilding the addressed message's items with that same helper, covering the item_<index>, item_<index>_call_<call id>, and item_<index>_result_<call id> shapes the list emits.
  • What is the impact of these changes? Listing and retrieval now agree on ids and content by construction because both render through the same conversion. The add path's uuid ids keep resolving exactly as before, and an unknown or out of range index still returns None.
  • What do you want reviewers to focus on? The helper extraction being behavior preserving for the list output, and the positional resolution reading the stored messages directly so it also covers messages written by agent runs.

Related Issue

Fixes #9862

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

list_items derives positional item ids while get_item only resolved the add path's uuid ids, so every id a client could discover through listing 404ed on retrieval. The per message conversion is now shared, and get_item resolves positional ids by rebuilding the addressed message's items, including call and result suffixes.

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
@ManoharPaturi

Copy link
Copy Markdown
Contributor Author

Understood, my mistake for opening this before the issue went through review. #9862 now follows the bug report template with the reproduction, and this PR stays closed until the team agrees.

This branch was previously deployed

1 inactive deployment
github-app-auth — 7a15b67c Deployed Oct 30, 2026 by ManoharPaturi via team_check #8068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: DevUI item ids returned by the items list cannot be fetched by id

2 participants