External Publication
Visit Post

Prevent repeated outputs across stateless Assistants API thread calls for same topic

OpenAI Developer Community June 5, 2026
Source

I am calling /v1/threads/runs from an automation workflow. Each call creates a brand new thread with a single user message containing clip_type, variant_number, and topic. The assistant has a knowledge base attached via vector store. The problem: when the same topic is requested across separate thread calls with different variant numbers, the assistant regenerates identical or near-identical prompts. I need strict non-repetition across all calls for a given topic. My current approach creates a new thread per run with no prior context passed. Questions: 1) Should I maintain a persistent thread per topic and keep appending to it, or is passing a compact list of prior prompt summaries in each new thread’s user message more reliable? 2) Is the Agents SDK state store the right tool here, or is application-side persistence with explicit prior-output context in every request the better pattern? 3) What is the most reliable architecture for guaranteed non-repetition across stateless thread calls to the same assistant? Stack: automation workflow calling /v1/threads/runs directly via HTTP, no SDK currently, outputs are structured JSON video prompts.

Discussion in the ATmosphere

Loading comments...