Skip to content

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

Description

@chubes4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions