Agent API update - #2388
Open
s3inlc wants to merge 15 commits into
Open
Conversation
…generated openapi specs
s3inlc
marked this pull request as ready for review
August 5, 2026 13:23
jessevz
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrote the agent API (POST /api/server.php) from a procedural switch-based dispatcher with echo+die() handlers into a Slim 4 / PSR-7 application with typed controllers, middleware, and an auto-generated OpenAPI spec - all without changing the wire contract that agents depend on.
All 19 actions are now clean PSR-7 controllers returning ResponseInterface, with token authentication handled centrally by TokenAuthMiddleware, JSON body parsing by AgentBodyParserMiddleware, and exception handling that returns the correct action string and error message on failures.
The OpenAPI 3.1 spec is generated at runtime from a SchemaRegistry (referencing the existing PQuery/PResponse constants) is linted in CI with Redocly and Spectral using a relaxed ruleset.