Skip to content

docs: clarify task name is optional in adk.acp.create_task#392

Merged
jromualdez-scale merged 1 commit into
nextfrom
task-name-optional-docstring
Jun 3, 2026
Merged

docs: clarify task name is optional in adk.acp.create_task#392
jromualdez-scale merged 1 commit into
nextfrom
task-name-optional-docstring

Conversation

@jromualdez-scale
Copy link
Copy Markdown

@jromualdez-scale jromualdez-scale commented Jun 3, 2026

Summary

task/create is get-or-create keyed on the task name, and name is optional. Reusing an existing name returns that task with its prior message history instead of creating a new one — a common cause of accidental duplicate / stale tasks, especially in multi-agent delegation where names are derived from prompts.

This documents that contract on adk.acp.create_task, the hand-written ADK entry point orchestrators call (the generated types//resources/ layer inherits the matching wording from the OpenAPI spec on the next Stainless regen, so this is the durable, hand-authored counterpart).

Change

  • src/agentex/lib/adk/_modules/acp.py: expand the name arg docstring — name is optional; omit it (or make it unique, e.g. append a UUID) for a fresh task each call; keep it globally unique when set.

Test plan

  • Docstring-only change; no behavior change. Verify rendering / no lint errors.

Made with Cursor

Greptile Summary

This PR clarifies the name parameter semantics for adk.acp.create_task via an expanded docstring. No behavior changes are introduced.

  • The name arg docstring now explains that task/create is get-or-create keyed on name, that omitting the name (or appending a UUID) is the correct way to guarantee a fresh task, and that a reused name returns the existing task along with its prior message history.
  • This is the hand-authored ADK entry point; the generated types//resources/ layer will pick up matching wording from the OpenAPI spec on the next Stainless regen.

Confidence Score: 5/5

Docstring-only change with no runtime code modified — safe to merge.

The single changed line range is a docstring expansion that accurately describes the existing get-or-create behavior of the task/create endpoint. No logic, imports, or signatures are touched.

No files require special attention.

Important Files Changed

Filename Overview
src/agentex/lib/adk/_modules/acp.py Docstring-only: expands the name param description in create_task to document the get-or-create semantics and recommend omitting or uniquifying the name for a fresh task.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["adk.acp.create_task(name=...)"] --> B{name provided?}
    B -- No --> C["Always creates a fresh task"]
    B -- Yes --> D{Name already exists?}
    D -- No --> E["Creates a new task"]
    D -- Yes --> F["Returns existing task\n(with prior message history)"]
    C --> G[Task returned]
    E --> G
    F --> G
Loading

Reviews (2): Last reviewed commit: "docs: clarify task name is optional in a..." | Re-trigger Greptile

task/create is get-or-create by name, so reusing an existing name returns that
task with its prior history rather than creating a new one. Document on the
hand-written ADK entry point that name is optional: omit it (or make it unique)
for a fresh task each call. Avoids accidental duplicate/stale tasks, especially
in multi-agent delegation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jromualdez-scale jromualdez-scale force-pushed the task-name-optional-docstring branch from 4a047b1 to 15ec179 Compare June 3, 2026 14:58
@jromualdez-scale jromualdez-scale changed the base branch from main to next June 3, 2026 14:58
@jromualdez-scale jromualdez-scale merged commit bd41d9b into next Jun 3, 2026
46 of 48 checks passed
@jromualdez-scale jromualdez-scale deleted the task-name-optional-docstring branch June 3, 2026 18:55
@stainless-app stainless-app Bot mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants