Skip to content

Add long-running chat run controls#39

Merged
chubes4 merged 2 commits into
mainfrom
feat/long-running-turn-primitives
May 29, 2026
Merged

Add long-running chat run controls#39
chubes4 merged 2 commits into
mainfrom
feat/long-running-turn-primitives

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 29, 2026

Summary

  • Adds backend-neutral runCapabilities primitives for optional active-run cancellation and queued follow-up messages.
  • Exposes activeRunId, getRunId, cancelRun, canCancelRun, and canQueueMessage through useChat so adapters can wire their own backend contract.
  • Updates ChatInput/message rendering to show a stop control and optimistic queued/failed message states only when the capability is supplied.

Notes

Verification

  • npm run build
  • homeboy test --path /Users/chubes/Developer/chat@feat-long-running-turn-primitives --extension nodejs (0 tests detected by repo)
  • homeboy lint --path /Users/chubes/Developer/chat@feat-long-running-turn-primitives --extension nodejs (no lint surface detected)
  • git diff --check

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Implementing the backend-neutral run-control API, UI state wiring, documentation, and verification. Chris remains responsible for review and merge.

@chubes4
Copy link
Copy Markdown
Member Author

chubes4 commented May 29, 2026

Follow-up alignment after Automattic/agents-api#237 merged:

  • Kept this package backend-neutral while making runId first-class on SendResult / ContinueResult from generic run_id wire fields.
  • Added generic ChatRun, ChatRunStatus, and QueueMessageResult types using camelCase adapter-facing names.
  • Passes the active runId into onQueueMessage so adapters can map cleanly to their backend queue contract.
  • Allows onQueueMessage to return { queuedMessageId, position, runId, sessionId, status } for adapters that receive queued-message acknowledgement payloads.

Verification after this update:

  • npm run build
  • homeboy test --path /Users/chubes/Developer/chat@feat-long-running-turn-primitives --extension nodejs (0 tests detected by repo)
  • homeboy lint --path /Users/chubes/Developer/chat@feat-long-running-turn-primitives --extension nodejs (no lint surface detected)
  • git diff --check

@chubes4 chubes4 merged commit 318014d into main May 29, 2026
@chubes4 chubes4 deleted the feat/long-running-turn-primitives branch May 29, 2026 00:46
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.

Add generic Stop and Queue UX for long-running chat turns

1 participant