Skip to content

docs: replace removed session.idle.backgroundTasks field with the current aborted field - #2232

Open
examon wants to merge 1 commit into
mainfrom
sdk-bugfix-198
Open

docs: replace removed session.idle.backgroundTasks field with the current aborted field#2232
examon wants to merge 1 commit into
mainfrom
sdk-bugfix-198

Conversation

@examon

@examon examon commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #2231

What

The session.idle documentation still lists a backgroundTasks field of type BackgroundTasks. That field was removed from the payload a while ago and the docs were never updated; the type name no longer exists in the schema either. Meanwhile the optional field the event may carry, aborted, was undocumented.

This replaces the stale rows with the real field in all four places that named it.

Why it is wrong today

session-events.schema.json defines the payload as (field descriptions elided):

{
  "type": "object",
  "properties": {
    "aborted": { "type": "boolean" }
  },
  "additionalProperties": false,
  "title": "IdleData"
}

additionalProperties is false, and backgroundTasks appears nowhere in session-events.schema.json or api.schema.json. All six generated bindings expose only an optional/nullable boolean named aborted.

Verified on the wire against CLI 1.0.78-2 by capturing raw JSON-RPC frames:

// normal completion
{"type":"session.idle","data":{},"ephemeral":true, ...}

// after session.abort()
{"type":"session.idle","data":{"aborted":true},"ephemeral":true, ...}

session.idle is now emitted only after tracked active background work has quiesced, so a backgroundTasks snapshot on that payload would always be empty. Changes to background-task state are signalled separately, by the empty-payload session.background_tasks_changed event.

Before / after

docs/features/streaming-events.md (the session.idle data-field table):

-| `backgroundTasks` | `BackgroundTasks` | | Background agents/shells still running when the agent became idle |
+| `aborted` | `boolean` | | True when the preceding turn was cancelled via abort signal |

and the "at a glance" summary table:

-| `session.idle` | ✅ | Session | `backgroundTasks?` |
+| `session.idle` | ✅ | Session | `aborted?` |

The same stale cell is corrected in the two Node.js quick-reference tables (nodejs/docs/examples.md, nodejs/docs/agent-author.md).

The description is worded to match this guide's existing vocabulary for the same concept (see the abort event's "Why the turn was aborted" row). The Required column is left empty because aborted is optional (matching the convention used by other optional rows in the same file, e.g. interactionId and reasoningOpaque), and the at-a-glance table uses the ? suffix for the same reason.

Verification

  • rg -n 'backgroundTasks|BackgroundTasks' docs/ nodejs/docs/ returns no hits after the change. The only remaining matches in the repo are the generated BackgroundTasksChanged* types belonging to the separate session.background_tasks_changed event.
  • Every changed row keeps its table's column count; the two Node.js tables keep their existing pipe alignment.
  • Docs only: no code, schema, generated file, or public API is touched, so codegen output is unchanged.

Scope

Deliberately limited to the incorrect session.idle rows. No new event sections are added, and no other event's field table is changed.

…urrent `aborted` field

The `session.idle` reference tables listed a `backgroundTasks` field of type
`BackgroundTasks`. That field was removed from the payload and the docs were
never updated; the type name no longer exists in the schema either. The
payload's only member today is an optional `aborted` boolean, which was
undocumented.

Corrects the data-field row and the at-a-glance row in
docs/features/streaming-events.md, plus the two Node.js quick-reference
tables. Documentation only; no code, schema or generated file is affected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 3, 2026 16:23
@examon
examon requested a review from a team as a code owner August 3, 2026 16:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates session.idle documentation to match the current generated SDK payload.

Changes:

  • Replaces removed backgroundTasks references with optional aborted.
  • Updates detailed and quick-reference event tables.
Show a summary per file
File Description
docs/features/streaming-events.md Corrects the field reference and summary.
nodejs/docs/examples.md Updates the event quick reference.
nodejs/docs/agent-author.md Updates the agent author reference.

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR is documentation-only — it corrects stale session.idle field references in three Markdown files. No SDK source code is modified.

Summary:

  • The backgroundTasks field being removed from the docs was already absent from the schema (session-events.schema.json) and all six generated SDK bindings.
  • The aborted field being documented is already present in all SDK bindings.
  • No cross-SDK inconsistency is introduced or exists.

No action needed in other SDK implementations. The change correctly aligns docs with the current schema state.

Generated by SDK Consistency Review Agent for #2232 · sonnet46 16.2 AIC · ⌖ 5.35 AIC · ⊞ 6.6K ·

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.

docs: session.idle documents a removed backgroundTasks field instead of the current aborted field

2 participants