Skip to content

Say how a Bot's run in a conversation ended - #2239

Merged
davidmckayv merged 1 commit into
mainfrom
api/conversation-run-outcome
Nov 26, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
api/conversation-run-outcome

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What

A new operation, getConversationRun: GET /api/v2/organizations/{organizationId}/conversations/{conversationId}/runs/{runId}. It says how one of a Bot's runs in a conversation ended, as the run's own last event said: succeeded, interrupted, cancelled or failed (an open enum), or null while the run is going or when it ended without saying how. A run the server keeps no record of in that conversation is a 404 (CONVERSATION_RUN_NOT_FOUND).

Why

When the app stops hearing a run before its end (a phone that slept during a long answer, a socket that dropped), it asks whether the conversation still has a run going. "No run going" did not say whether the run finished or stopped part way, so a run that finished was shown with "The Bot stopped before it finished" and Carry on. With this the app can tell the two apart and show a finished turn as finished.

Checks

  • bun run api:lint passes.
  • bun test api passes.
  • Additive only: a new path, its schemas, its 404 response and its example. The generated app and phone clients are regenerated.

The app change that uses it is #2240.

getConversationRun answers how one run ended, as its own last event
said: succeeded, interrupted, cancelled or failed, or null while it is
going or when it ended without saying how. A client that stopped
hearing a run before its end (a phone that slept, a socket that
dropped) asks it once the conversation has no run going, so a run that
finished is shown as finished rather than as one that stopped part way.

Additive: a new operation, its response and its 404.
@davidmckayv
davidmckayv force-pushed the api/conversation-run-outcome branch from bcf7be9 to 0949543 Compare November 26, 2026 02:48
@davidmckayv
davidmckayv merged commit a532886 into main Nov 26, 2026
23 checks passed
@davidmckayv
davidmckayv deleted the api/conversation-run-outcome branch November 26, 2026 02:58
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.

1 participant