Skip to content

docs(ai-transport): document interruption and steering#3471

Open
zknill wants to merge 5 commits into
mainfrom
zak/docs-steering
Open

docs(ai-transport): document interruption and steering#3471
zknill wants to merge 5 commits into
mainfrom
zak/docs-steering

Conversation

@zknill

@zknill zknill commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Documents the AI Transport interruption and steering feature, and verifies the affected agent-side docs against the SDK source (the ait-1017-steering-steps branch, the release target).

  • Replaces the old features/interruption.mdx with features/interruption-and-steering.mdx, covering the three change-direction patterns: steer the active Run with a follow-up prompt, cancel and re-prompt, or send alongside as a concurrent Run.
  • Adds a "Steer a Run" section to concepts/runs.mdx documenting the client-side steer() API ({ published, outcome }, consumed/runTerminalReason).
  • Repoints the nav entry ("Interruption" → "Interruption and steering") and cross-links in cancellation.mdx, concurrent-turns.mdx, double-texting.mdx, and why/index.mdx.
  • Fixes the agent loop in the steering page to match the SDK: createRun is synchronous (no await), drain run.view with loadOlder() before run.start(), feed run.view.getMessages() to the model (not run.messages, which is turn-only), and tear down with session.end(). Corrects a stray ActiveRun reference to ClientRun.
  • Fixes the cancellation page's server-side abort-signal snippet, which fed run.messages (this Run's own turn) straight to the model, losing all prior conversation context. It now drains run.view and feeds the full conversation.

@zknill zknill added the review-app Create a Heroku review app label Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4817df98-c566-4c3a-9548-cbf08021ae7c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch zak/docs-steering

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ably-ci
ably-ci temporarily deployed to ably-docs-zak-docs-stee-dhtkzh July 14, 2026 11:06 Inactive
@ably-ci
ably-ci temporarily deployed to ably-docs-zak-docs-stee-dhtkzh July 14, 2026 12:30 Inactive
@zknill
zknill force-pushed the zak/docs-steering branch from 83f68ff to aac02af Compare July 17, 2026 08:04
@zknill
zknill requested a review from VeskeR July 17, 2026 08:04
@zknill
zknill marked this pull request as ready for review July 17, 2026 08:04
@ably-ci
ably-ci temporarily deployed to ably-docs-zak-docs-stee-dhtkzh July 17, 2026 08:04 Inactive
{
name: 'Token streaming',
link: '/docs/ai-transport/features/token-streaming',
name: 'Agent presence',

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.

bringing in @m-hulbert comment from #3468 regarding alphabetical ordering here:

I agree that the feature list is rapidly expanding, and it would help to make that easier to navigate; however I'm not convinced that alphabetising the list is the right way to do this. In terms of releative 'importance' - is 'Agent presence' the first thing we believe should be read to understand the value proposition and how AI Transport works?

IMO, the core value proposition should be immediately stated and clear in the "About AI Transport". "How AI Transport works" is covered by "Concepts".
And "Features" then shows you what you can build with it. If you're just skimming through the docs to see the overall feature set, I don't think there's a material difference whether "Features" is sorted alphabetically or based on our assumptions of what we deem important - people will still be able to find what they want. But when you're returning to the documentation, having the list sorted makes it way easier to navigate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, well @m-hulbert if you have a concrete proposal for an order then please share that here. In the mean time, this re-ordering makes the features findable when you want to return to a page you already know exists.

(I'm highly allergic to comments along the lines of "not this thing", without "this instead")

Comment thread src/pages/docs/ai-transport/features/interruption-and-steering.mdx Outdated
Comment thread src/pages/docs/ai-transport/features/interruption-and-steering.mdx Outdated
Comment thread src/pages/docs/ai-transport/features/interruption-and-steering.mdx Outdated
Comment thread src/pages/docs/ai-transport/features/interruption-and-steering.mdx
Comment thread src/pages/docs/ai-transport/features/interruption-and-steering.mdx Outdated
Comment thread src/pages/docs/ai-transport/features/interruption-and-steering.mdx Outdated
Comment thread src/pages/docs/ai-transport/features/interruption-and-steering.mdx
zknill added 4 commits July 17, 2026 16:58
Replace the Interruption feature page with a combined Interruption and
steering page, and add a "Steer a Run" section to the Runs concept.
Repoint the nav entry and all cross-links from the old page, with a
redirect_from to preserve the old URL.

The page documents three ways a client changes direction mid-response:
steer the active Run with a follow-up prompt, cancel and re-prompt, or
send alongside as a concurrent Run.
The server-side abort-signal example fed run.messages straight to the
model. run.messages is only the current Run's own turn (its triggering
input plus its output), not the multi-turn conversation, so a model
called with it loses all prior context.

Drain run.view with loadOlder() before run.start() and feed
run.view.getMessages() through convertToModelMessages, matching the
agent hydration pattern used across the getting-started and
interruption-and-steering pages.
Order the Features section entries by name so the nav is predictable
and new pages have an obvious insertion point.
Bring the interruption and steering feature page in line with the
steering API and the Vercel codec used elsewhere on the page, and
capture the vocabulary rule that drove the copy edits in the write-docs
skill so future drafts inherit it.

- Rewrite the agent loop to use streamText + toUIMessageStream() and
  run.abortSignal, matching the Vercel examples used across the page
- Add a "Cancel the in-flight model call" section documenting onSteer,
  the stepAbort/AbortSignal.any pattern, and how to tell a steer
  interruption apart from a genuine cancel before ending the Run
- Add FAQ entries for cross-device cancel, steer persistence, batched
  steers, and an unreachable agent endpoint
- Replace off-vocabulary terms (noun "pass", "inference pass",
  "projection", "RunNode") with documented product vocabulary
- Rename the section to cancel-and-reprompt and fix the stale
  /interruption roadmap link to /interruption-and-steering
- Add a "Stay inside the product vocabulary" rule, grep, and reviewer
  checklist item to the write-docs skill
@zknill
zknill force-pushed the zak/docs-steering branch from aac02af to 4b72de9 Compare July 17, 2026 15:58
@ably-ci
ably-ci temporarily deployed to ably-docs-zak-docs-stee-dhtkzh July 17, 2026 15:59 Inactive
Resolve the remaining review comments on the interruption and steering
page. The steer outcome docs contradicted themselves on suspend, and
two smaller items were still open.

- Clarify when steer outcome resolves: a consumed steering message
  resolves even if the Run later suspends (runTerminalReason absent),
  while a not-yet-consumed message stays pending until the Run resumes
  and consumes it or ends. Aligns the property list with the
  suspended-Run edge case, which previously said outcome stays pending
  until the Run ends
- Drop the "How does steering differ from concurrent turns?" FAQ, which
  only compared two of the three patterns the How it works table
  already covers
- Rename the section heading to "Implement cancel and re-prompt" and its
  anchor so it matches the table row wording

@VeskeR VeskeR 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.

LGTM, one note about the skill change

**Writing standards**

9. Page complies with the rules in [`writing-style-guide.md`](../../../writing-style-guide.md). Use the verification greps above to spot the common violations (em dashes, bold-prefix bullets, Latin abbreviations, subjective phrases, vague modals, "we" as the subject, AI-fingerprint patterns).
10. Author ran `/deslop` (or equivalent AI-pattern check).

@VeskeR VeskeR Jul 17, 2026

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.

I think we should keep this as item 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

3 participants