Add searchMessages() method to query inside session history

Open
#2,376 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java, typescript

Research direction

Start by locating the session history and SessionEvent APIs in each SDK language, then compare existing asynchronous query or filtering patterns. Done means searchMessages(query, options) is available across all SDKs and supports string or regex matching, event-type filtering, case sensitivity options, and filtered SessionEvent results.

Written by the indexing model from the issue text.

Description

enhancement

Summary

Implement a searchMessages() method across all SDK languages to enable
in-session message filtering and search.

Problem

Users currently has to manually filter through all
session events to find specific messages. This is cumbersome for:

  • Debugging long conversations
  • Finding specific agent responses
  • Building audit/search features on top of the SDK

Proposed Solution

Add async searchMessages(query, options) method that:

  • Accepts string or regex patterns
  • Filters by event type (optional)
  • Supports case-sensitive/insensitive search
  • Returns filtered SessionEvent[] matching criteria

Example Usage

// TypeScript
const results = await session.searchMessages("authentication");
const assistantMsgs = await session.searchMessages("deploy", { 
  eventType: "assistant.message" 
});
Dominant language
Java
Stars
10.5k
Forks
1.5k
Avg merge
1d 12h
Merged PRs (30d)
133

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/copilot-sdk

All issues in github/copilot-sdk

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.