Skip to content

docs(sdk): document background delegation - #725

Open
KirschBluteX wants to merge 3 commits into
OpenHands:mainfrom
KirschBluteX:docs/background-delegation-2047
Open

KirschBluteX wants to merge 3 commits into
OpenHands:mainfrom
KirschBluteX:docs/background-delegation-2047

Conversation

@KirschBluteX

@KirschBluteX KirschBluteX commented Aug 15, 2026 •

Copy link
Copy Markdown
  • I have read and reviewed the documentation changes to the best of my ability.
  • If the change is significant, I have run the documentation site locally and confirmed it renders as expected.

Summary of changes

  • Document the TaskToolSet background lifecycle added by OpenHands/software-agent-sdk#4503.
  • Show the blocking default and explicit run_in_background=True opt-in.
  • Document task_output, task_stop, task states, cooperative cancellation, bounded close behavior, and exactly-once metrics settlement.
  • Clarify that task IDs are process-local and are not restored after a process restart; active resume is rejected.

Validation

  • git diff --check passed.
  • The documented imports and lifecycle match the SDK implementation and its 165 focused/related tests.
  • Full-checkout Mint and desktop/mobile render checks were run previously. The final sparse checkout reports baseline missing-file/navigation warnings for files outside this PR; those files are unchanged here.

The API details were checked against the SDK TaskToolSet definitions and manager: output reads are bounded by a finite timeout, stop is cooperative through the child LocalConversation, and task IDs remain process-local control handles.

Co-authored-by: openhands <openhands@all-hands.dev>
@KirschBluteX
KirschBluteX marked this pull request as ready for review August 15, 2026 14:57
@KirschBluteX
KirschBluteX requested a review from enyst as a code owner August 15, 2026 14:57
KirschBluteX and others added 2 commits August 15, 2026 10:46
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>

@enyst enyst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm an AI agent based on Opus 5.5, helping Engel Nyst (@enyst) with project work.

I checked this against SDK #4503 at its current head (97a18e4). run_in_background, task_output (block, finite timeout 0–3600), task_stop, the five statuses, and the rejection of a resume while a task is still active all match (definition.py#L65, definition.py#L128-L144, manager.py#L398).

  • #4503 is still open, so this should wait until it merges. That PR has changed quite a bit since Aug 18, so a quick re-check after it lands would help.
  • The rewrite removes the ready-to-run example code. The old block pointed at 40_task_tool_set.py, which no longer exists, so it was out of date. Please point the block at the current file instead of deleting it (see the inline comment).
  • The background snippet runs a separately created executor. In normal use, the parent LLM calls task(run_in_background=true), task_output, and task_stop itself. I'd say that first and label the snippet as direct/programmatic use.

```

<RunExampleCode path_to_script="examples/01_standalone_sdk/40_task_tool_set.py"/>
<RunExampleCode path_to_script="examples/01_standalone_sdk/41_task_tool_set.py"/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the example code here and point it at the current file (it's 41_, not 40_). Put this above the RunExampleCode line:

```python icon="python" expandable examples/01_standalone_sdk/41_task_tool_set.py
<current contents of examples/01_standalone_sdk/41_task_tool_set.py>
```

Blocks that carry an example path are synced from the SDK (see AGENTS.md), so the correct path is what keeps the code current.

This branch has not been deployed

No deployments
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