Automattic / Automattic/frontend-agent-chat

refactor: converge chat dispatch on the canonical Agents API REST contract

Open
#128 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Problem

Frontend Agent Chat implements `/frontend-agent-chat/v1/chat` and independently rebuilds input normalization, permission handling, `agents/chat` execution, and response projection while Agents API already owns `/agents-api/v1/chat`.

Relevant implementation: `inc/rest.php:17-63,417-486`.

## Impact

Attachment handling, client context, authorization, errors, and response semantics can drift across two public adapters.

## Acceptance criteria

- Keep product bootstrap/session behavior in Frontend Agent Chat.
- Consume the canonical Agents API chat transport contract for dispatch and normalization.
- Retain only a documented product response projection where necessary.
- Add parity tests for permissions, attachments, context, errors, and streaming/non-streaming responses.

Found while reviewing Extra Chill's production composition of Frontend Agent Chat and Agents API.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading inc/rest.php:17-63 and 417-486, then compare the frontend chat route with the canonical /agents-api/v1/chat contract. Trace normalization, permissions, attachments, context, errors, and streaming/non-streaming responses. Done means product bootstrap/session behavior remains, dispatch uses the canonical transport, any product projection is documented, and parity tests cover the listed cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
api, backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.