Commit 1d53e80
docs: clarify that task name is optional and get-or-create by name (#269)
Documents the task identity contract in the places assistants and
clients already read: a task is identified by a UUID id, while name is
optional (nullable) and globally unique when set. Because task/create is
get-or-create keyed on name, reusing a name returns the existing task
(with its history) rather than creating a new one — so omit name, or
make it unique, when each call should produce a fresh task.
Updates CLAUDE.md, the Task concepts doc, the CreateTaskRequest.name
field description (surfaced via OpenAPI/SDK), and the
_get_or_create_task docstring.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This is a documentation-only PR that clarifies the task identity
contract across all the places where developers and assistants discover
it. The core behavior — that `task/create` is a get-or-create keyed on
`name`, that passing `params` on a name-matched task overwrites them,
and that `task_metadata` is creation-only — is accurately reflected in
all updated files.
- **CLAUDE.md** receives a concise one-sentence expansion of the Tasks
bullet point, capturing the UUID/name distinction and get-or-create
semantics.
- **`agentex/docs/docs/concepts/task.md`** gains a new \"Task Identity\"
section with a callout warning that matches the actual behavior verified
in `_get_or_create_task`.
- **`CreateTaskRequest` schema** (`agents_rpc.py` + `openapi.yaml`) and
the `_get_or_create_task` docstring are updated with matching, accurate
descriptions of the mutation side-effect when `params` is provided on an
existing task.
<details><summary><h3>Confidence Score: 5/5</h3></summary>
Documentation-only change with no logic modifications; all descriptions
were verified against the implementation.
Every claim in the updated docs — get-or-create keyed on name, params
overwrite on name-match, task_metadata creation-only — was confirmed
against the actual _get_or_create_task implementation. The descriptions
in CLAUDE.md, task.md, openapi.yaml, agents_rpc.py, and the docstring
are mutually consistent. No code paths were altered.
No files require special attention.
</details>
<h3>Important Files Changed</h3>
| Filename | Overview |
|----------|----------|
| CLAUDE.md | One-line Tasks bullet expanded with accurate
id/name/get-or-create description; no logic changes. |
| agentex/docs/docs/concepts/task.md | New 'Task Identity' section added
with accurate descriptions of id, name uniqueness, get-or-create
behavior, params overwrite, and task_metadata creation-only semantics —
all verified against the implementation. |
| agentex/openapi.yaml | name and params field descriptions updated to
reflect get-or-create semantics; matches agents_rpc.py descriptions
exactly. |
| agentex/src/api/schemas/agents_rpc.py | CreateTaskRequest.name and
.params Field descriptions expanded; consistent with openapi.yaml and
the docstring. |
| agentex/src/domain/use_cases/agents_acp_use_case.py |
_get_or_create_task docstring updated to accurately describe the
params-overwrite mutation path and task_metadata creation-only behavior;
verified to match the code exactly. |
</details>
<details><summary><h3>Flowchart</h3></summary>
```mermaid
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[task/create called] --> B{task_id provided?}
B -- Yes --> C[Fetch task by ID]
B -- No --> D{task_name provided?}
D -- Yes --> E{Name exists?}
D -- No --> F[Create new task\nname=None]
E -- No --> G[Create new task\nwith name]
E -- Yes --> H{task_params provided?}
H -- No --> I[Return existing task\nas-is]
H -- Yes --> J{params differ?}
J -- No --> I
J -- Yes --> K[Overwrite task.params\nthen return task]
C --> H
F --> L[task_metadata applied]
G --> L
L --> M[Return new task]
```
</details>
<sub>Reviews (3): Last reviewed commit: ["docs: plainer wording for
get-or-create
..."](0943b4c)
| [Re-trigger
Greptile](https://app.greptile.com/api/retrigger?id=35384849)</sub>
<!-- /greptile_comment -->
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 8b6d69d commit 1d53e80
5 files changed
Lines changed: 46 additions & 5 deletions
File tree
- agentex
- docs/docs/concepts
- src
- api/schemas
- domain/use_cases
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
16 | 31 | | |
17 | 32 | | |
18 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4503 | 4503 | | |
4504 | 4504 | | |
4505 | 4505 | | |
4506 | | - | |
| 4506 | + | |
| 4507 | + | |
| 4508 | + | |
| 4509 | + | |
| 4510 | + | |
4507 | 4511 | | |
4508 | 4512 | | |
4509 | 4513 | | |
4510 | 4514 | | |
4511 | 4515 | | |
4512 | 4516 | | |
4513 | | - | |
| 4517 | + | |
| 4518 | + | |
4514 | 4519 | | |
4515 | 4520 | | |
4516 | 4521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
26 | 35 | | |
27 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
274 | 282 | | |
275 | 283 | | |
276 | 284 | | |
| |||
0 commit comments