Bug Description
The mergeList function in context-harness.js only appends new items to the openQuestions list. Once a question is added, it is never removed even after it has been clearly answered in the conversation. This causes the open questions list to grow indefinitely.
Reproduction
- Start OpenHorse with a target
- Ask a question (e.g., "为什么设置了目标无法启动?")
- The question gets added to
openQuestions
- Agent fully answers the question
- Check Context Harness: the question is still in
openQuestions
Root Cause
context-harness.js:mergeList() only does additive merging:
function mergeList(existing, incoming) {
return [...new Set([...existing, ...incoming])];
}
There is no mechanism to detect that a question has been answered and remove it from the list.
Expected Behavior
- When the agent provides a clear, complete answer to an open question, that question should be removed from
openQuestions
- Or: add a
resolvedQuestions list and filter them out when injecting context
Suggested Fix
- Add a
resolveQuestions(answeredQuestions) method to Context Harness
- After each agent turn, check if any open questions were addressed in the response
- Move resolved questions to a
resolved set and exclude them from future context injection
- Simple heuristic: if the agent response directly references an open question and provides substantive content, mark it resolved
Environment
- OpenHorse: v0.2.24
- Node.js: v22.23.1
- macOS Darwin
Bug Description
The
mergeListfunction incontext-harness.jsonly appends new items to theopenQuestionslist. Once a question is added, it is never removed even after it has been clearly answered in the conversation. This causes the open questions list to grow indefinitely.Reproduction
openQuestionsopenQuestionsRoot Cause
context-harness.js:mergeList()only does additive merging:There is no mechanism to detect that a question has been answered and remove it from the list.
Expected Behavior
openQuestionsresolvedQuestionslist and filter them out when injecting contextSuggested Fix
resolveQuestions(answeredQuestions)method to Context Harnessresolvedset and exclude them from future context injectionEnvironment