Skip to content

[B2b] Add brain_search_feedback tool for agent self-reporting #175

Description

@four-bytes-robby

Purpose

Agents can report whether a search was helpful. Updates the most recent matching search_analytics row.

Design

Register tool brain_search_feedback in src/four-opencode-brain.ts:

args: {
  query: string,        // match to search_analytics row
  helpful: boolean,     // was the search helpful?
  used_results: boolean // did the agent use any results?
}

Logic:

  • Find most recent search_analytics row where query matches (partial LIKE match)
  • Update helpful, used_results columns
  • Return { updated: true, id } or { updated: false, reason: "no matching search found" }

Acceptance

  • Tool registered and callable
  • Updates correct analytics row
  • Idempotent (calling twice updates same row)
  • Tests: feedback on existing search, feedback on non-existent query

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions