Conversation sessions need a queryable product scope for project-bound transcripts

Open
#407 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
50/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php

Research direction

Start with the create/list ability definitions in src/Transcripts/register-agents-conversation-session-abilities.php:201-204 and 595-598, then trace persistence and filtering in src/Transcripts/class-wp-agent-cpt-conversation-store.php:151 and 225-256. Define a product-neutral scope or constrained metadata contract, then verify that callers can create scoped sessions and that the list/bootstrap path returns only the requested scope.

Written by the indexing model from the issue text.

Description

Problem

WordPress Build can store product target metadata on chat sessions, but the generic conversation-session list path only filters by owner, agent, and context. A product cannot ask for "the latest chat session for project X" through the canonical session surface.

Evidence

  • src/Transcripts/register-agents-conversation-session-abilities.php:201-204 accepts arbitrary metadata on create.
  • src/Transcripts/register-agents-conversation-session-abilities.php:595-598 documents metadata as JSON-serializable product-specific data.
  • src/Transcripts/class-wp-agent-cpt-conversation-store.php:236-256 lists sessions with owner/workspace plus optional agent_slug and context filters only.
  • src/Transcripts/class-wp-agent-cpt-conversation-store.php:151 and src/Transcripts/class-wp-agent-cpt-conversation-store.php:225 persist metadata as opaque JSON, so nested product keys are not queryable by the generic list.

Needed Primitive

Add a runtime-neutral way to scope/query conversation sessions, for example:

  • a canonical session_scope / thread_scope string on session create/list; or
  • a constrained metadata filter/index contract for namespaced product keys.

Acceptance Criteria

  • A caller can create a session scoped to an opaque product key like wp-build-project:123 without Agents API knowing what that means.
  • The list/bootstrap path can return sessions for that scope only.
  • The shape remains product-neutral and works for non-WordPress-Build callers.

Downstream WP Build issue will link here; the product need is project-scoped transcripts so switching projects switches/restores the right chat.

Dominant language
PHP
Stars
33
Forks
8
Avg merge
1h 39m
Merged PRs (30d)
30

Contributor guide

No contributing guide indexed for this repository

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 Automattic/agents-api

All issues in Automattic/agents-api

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.