SDK proposal: `conversation.query(question: string...
# proj-sdk
w
SDK proposal:
conversation.query(question: string)
allows you to ask questions about the conversation state without modifying its history or running any actions. Just passes the convo history to an LLM and gets a result e.g.
Copy code
conversation.query("what's a good title for this conversation")
conversation.query("on a scale of 1-10, is the agent making good progress?")
conversation.query("Has the agent changed any files?")
conversation.query("Has the agent written any tests?")
conversation.query("What, if anything, is the agent stuck on? Reply NOTHING if nothing")
conversation.query("Roughly what percent of the way done is the task?")
conversation.query("Give me a list of assumptions the agent made that weren't explicitly requested by the user")
etc etc There's probably a smart way to add typing (bool, string, int, bigger schemas) to the output.
👍 2
c
i've discussed this with @strong-ice-84145 at some point nod maybe we can create an issue
👍 2
c
@nutritious-balloon-65098 open an issue on this. Feel free to look around the code and write down how you think it should be implemented. Note that this should be simple and the LLM call should not be part of agent’s history. Don’t make code changes yet, just write your suggestions in the issue. Use markdown like bold/headings for easy readability.
n
I'm on it! can track my progress here.
Summary of work • Opened a GitHub issue proposing Conversation.query(question) as a simple, read‑only API to ask questions about a conversation without modifying history or running actions. ◦ Issue: SDK: Conversation.query(question) — ask about conversation state without modifying history ◦ Link: https://github.com/OpenHands/software-agent-sdk/issues/968 What I did • Read the code to confirm feasibility and integration points: ◦ SDK: BaseConversation, LocalConversation, RemoteConversation, LLM, Message, events-to-messages pipeline, View.from_events, ConversationStats/LLMRegistry ◦ Server: conversation_router, conversation_service, event_service (patterned after generate_title) • Authored a detailed issue with: ◦ Summary, Motivation, Design Goals ◦ Proposed API and signature (string return by default; typed outputs as optional follow-up) ◦ Implementation Plan (Base interface + Local + Remote), ensuring no history/event side-effects ◦ Backward compatibility, Testing strategy, Open questions, Acceptance criteria, Rollout plan • Ensured the design explicitly keeps the LLM call out of the agent’s history: ◦ Local: no _on_event calls, no writes to state.events ◦ Remote: pure compute endpoint; no event/websocket emission Notes • No code changes were made—only a GitHub issue was opened per your request. • The proposal aligns with existing patterns (e.g., generate_title, View.from_events, LLMConvertibleEvent.events_to_messages) and keeps scope small. Would you like me to proceed with implementation next (Local first, then Remote) and prepare a corresponding docs update in OpenHands/docs (sdk/)? <sub>View full conversation</sub>