Uh oh!
There was an error while loading. Please reload this page.
feat(Assignments) - #522
Conversation
some stuff still missing Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Move business logic from CHattyLLMController to ChatServiec Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
There was a problem hiding this comment.
Pull request overview
This PR introduces an “Assignments” backend for the Assistant app and refactors the existing chat controller by moving business logic into a dedicated ChatService. It adds persistence (DB + migration), an OCS API for CRUD operations, and a background job to execute recurring assignments using RRULEs.
Changes:
- Refactor: extract chat/session/message/task scheduling logic from
ChattyLLMControllerintolib/Service/ChatService.php. - Feature: add Assignments domain (DB entity + mapper, OCS controller, service layer, OpenAPI schema) plus RRULE-based “due” evaluation.
- Operations: add a timed background job to run due assignments per user; add
simshaun/recurrdependency.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/psalm-baseline.xml | Adds Psalm baseline suppressions for logger('assistant') usage in the new Assignment entity. |
| openapi.json | Adds Assignment schema and CRUD-ish assignment endpoints under /ocs/v2.php/apps/assistant/assignments. |
| lib/Service/UnauthorizedException.php | New service-layer exception type for auth failures. |
| lib/Service/NotFoundException.php | New service-layer exception type for missing resources. |
| lib/Service/InternalException.php | New service-layer exception type for internal failures. |
| lib/Service/BadRequestException.php | New service-layer exception type for validation/user input issues. |
| lib/Service/ChatService.php | New service encapsulating chat session/message logic and task scheduling. |
| lib/Service/AssignmentsService.php | Implements assignment creation and due-run scheduling (including chat session linkage). |
| lib/ResponseDefinitions.php | Adds Psalm type AssistantAssignment used for response typing/OpenAPI extraction. |
| lib/Migration/Version030500Date20260430083738.php | Creates assistant_assignments table and adds assignment_id column/index to chat sessions. |
| lib/Listener/ChattyLLMTaskListener.php | Uses new Message::ROLE_ASSISTANT constant instead of raw string. |
| lib/Db/ChattyLLM/SessionMapper.php | Adds getUserSessionForAssignment() lookup by assignment_id. |
| lib/Db/ChattyLLM/Session.php | Adds assignmentId field and serializes assignment_id. |
| lib/Db/ChattyLLM/MessageMapper.php | Uses Message::ROLE_HUMAN constant; updates return typing docblock. |
| lib/Db/ChattyLLM/Message.php | Introduces ROLE_HUMAN / ROLE_ASSISTANT constants. |
| lib/Db/AssignmentMapper.php | New mapper to load assignments and enumerate due assignments. |
| lib/Db/Assignment.php | New Assignment entity with RRULE validation and “due to run” logic. |
| lib/Controller/ChattyLLMController.php | Refactors controller to delegate to ChatService and map service exceptions to HTTP responses. |
| lib/Controller/AssignmentsApiController.php | New OCS controller implementing assignment endpoints. |
| lib/BackgroundJob/RunAssignmentsJob.php | New timed background job to run due assignments for a user. |
| composer.lock | Locks new dependencies pulled in by RRULE library. |
| composer.json | Adds simshaun/recurr dependency. |
| appinfo/info.xml | Bumps app version to 3.5.0-dev.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
| */ | ||
| #[NoAdminRequired] | ||
| #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['assignments'])] | ||
| #[Http\Attribute\ApiRoute(verb: 'DELETE', url: '/assignments/{id}')] |
There was a problem hiding this comment.
Why not importing Http\Attribute\ApiRoute?
Uh oh!
There was an error while loading. Please reload this page.
Todo:
Use the assignment tools in nextcloud/context_agent#162 to schedule assignments from the UI, or use curl :)