Skip to content

Bug: openQuestions in Context Harness only accumulate, never clean up answered questions #74

Description

@tianxingzhivlog-droid

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

  1. Start OpenHorse with a target
  2. Ask a question (e.g., "为什么设置了目标无法启动?")
  3. The question gets added to openQuestions
  4. Agent fully answers the question
  5. 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

  1. Add a resolveQuestions(answeredQuestions) method to Context Harness
  2. After each agent turn, check if any open questions were addressed in the response
  3. Move resolved questions to a resolved set and exclude them from future context injection
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions