main
md 50 lines 2.03 KB
Rendered Raw
1 # agents.py DOX
2
3 ## Purpose
4
5 - Own the `agents.py` API endpoint.
6 - This module lists available agent profiles for selection and delegation UI flows.
7 - Keep this file-level DOX profile synchronized with `agents.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `agents.py` owns the runtime implementation.
12 - `agents.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Classes:
14 - `Agents` (`ApiHandler`)
15 - `async process(self, input: Input, request: Request) -> Output`
16
17 ## Runtime Contracts
18
19 - HTTP handlers must derive from `helpers.api.ApiHandler`; WebSocket handlers must derive from `helpers.ws.WsHandler`.
20 - Update this file whenever request payloads, authentication or CSRF requirements, response shapes, route side effects, or WebSocket event contracts change.
21 - `Agents` is an `ApiHandler`.
22 - `Agents` defines `process(...)`.
23 - The response uses the shared `subagents.get_all_agents_list()` presentation
24 catalog; profile visibility rules belong to that helper.
25 - Imported dependency areas include: `helpers`, `helpers.api`.
26
27 ## Key Concepts
28
29 - Important called helpers/classes observed in the source: `subagents.get_all_agents_list`, `Exception`.
30 - Keep request/response, tool, or helper semantics documented here at the same time as source changes.
31
32 ## Work Guidance
33
34 - Preserve authentication, CSRF, loopback, and API-key checks unless the endpoint contract explicitly changes.
35 - Update frontend callers, plugin callers, and tests together when payload shape changes.
36 - Use `helpers.api.Response` for non-JSON responses, files, redirects, or status-specific replies.
37
38 ## Verification
39
40 - Run endpoint-specific or API/WebSocket tests for changed behavior; smoke-test browser callers when no focused test exists.
41 - Related tests observed by source search:
42 - `tests/test_default_prompt_budget.py`
43 - `tests/test_office_document_store.py`
44 - `tests/test_projects.py`
45 - `tests/test_skills_runtime.py`
46 - `tests/test_time_travel.py`
47
48 ## Child DOX Index
49
50 No child DOX files.